@univerjs/sheets 0.10.12 → 0.10.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +1 -1
- package/lib/es/facade.js +982 -970
- package/lib/facade.js +982 -970
- package/lib/types/facade/f-permission.d.ts +7 -2
- package/lib/umd/facade.js +1 -1
- package/package.json +7 -7
package/lib/es/facade.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { Inject as
|
|
5
|
-
import { FBase as
|
|
6
|
-
import { WorksheetProtectionRuleModel as
|
|
7
|
-
import { IDefinedNamesService as
|
|
8
|
-
var
|
|
9
|
-
for (var
|
|
10
|
-
(
|
|
11
|
-
return
|
|
12
|
-
}, I = (
|
|
13
|
-
function
|
|
14
|
-
const n = t.getDefinedNameMap(
|
|
1
|
+
var rt = Object.defineProperty;
|
|
2
|
+
var st = (a, e, t) => e in a ? rt(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
|
|
3
|
+
var b = (a, e, t) => st(a, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { Inject as g, Injector as M, ICommandService as _, IPermissionService as ge, IAuthzIoService as Oe, LocaleService as je, generateRandomId as Le, Rectangle as x, cellToRange as ot, HorizontalAlign as A, VerticalAlign as D, RANGE_TYPE as w, TextStyleValue as Se, RichTextValue as N, BooleanNumber as m, WrapStrategy as G, DEFAULT_STYLES as Ce, covertCellValue as oe, covertCellValues as ve, Dimension as T, isNullCell as B, Direction as j, ObjectMatrix as X, ILogService as ze, mergeWorksheetSnapshotWithDefault as fe, Tools as Ie, UndoCommand as it, RedoCommand as at, toDisposable as Ge, UniverInstanceType as P, IResourceLoaderService as ht, IUniverInstanceService as ie, CanceledError as f } from "@univerjs/core";
|
|
5
|
+
import { FBase as me, FBaseInitialable as _e, FUniver as $e, FEnum as dt, FEventName as ct } from "@univerjs/core/facade";
|
|
6
|
+
import { WorksheetProtectionRuleModel as qe, RangeProtectionRuleModel as Ke, WorksheetProtectionPointModel as Ye, SetDefinedNameCommand as ae, SCOPE_WORKBOOK_VALUE_DEFINED_NAME as O, RemoveDefinedNameCommand as ut, WorkbookPermissionService as lt, PermissionPointsDefinitions as gt, WorkbookEditablePermission as Je, UnitObject as F, AddWorksheetProtectionMutation as mt, DeleteWorksheetProtectionMutation as _t, getAllWorksheetPermissionPoint as kt, getAllWorksheetPermissionPointByPointPanel as Re, SetWorksheetPermissionPointsMutation as wt, AddRangeProtectionMutation as St, DeleteRangeProtectionMutation as Ct, SetRangeProtectionMutation as vt, WorksheetEditPermission as ft, WorksheetViewPermission as It, SetBorderBasicCommand as Rt, SetStyleCommand as p, SetTextRotationCommand as bt, SetRangeValuesCommand as V, SetTextWrapCommand as he, SetVerticalTextAlignCommand as pt, SetHorizontalTextAlignCommand as Et, addMergeCellsUtil as Z, getAddMergeMutationRangeByType as be, RemoveWorksheetMergeCommand as yt, getPrimaryForRange as $, SetSelectionsOperation as ke, SplitTextToColumnsCommand as Ut, SetWorksheetRangeThemeStyleCommand as Pt, DeleteWorksheetRangeThemeStyleCommand as xt, SheetRangeThemeService as Qe, ClearSelectionAllCommand as Xe, ClearSelectionContentCommand as Ze, ClearSelectionFormatCommand as et, InsertRangeMoveDownCommand as Mt, InsertRangeMoveRightCommand as Nt, DeleteRangeMoveUpCommand as Tt, DeleteRangeMoveLeftCommand as At, getNextPrimaryCell as Dt, SetWorksheetDefaultStyleMutation as Wt, SetColDataCommand as pe, SetRowDataCommand as Ee, copyRangeStyles as L, InsertRowByRangeCommand as ye, RemoveRowByRangeCommand as Bt, MoveRowsCommand as Ft, SetRowHiddenCommand as Ue, SetSpecificRowsVisibleCommand as Pe, SetWorksheetRowIsAutoHeightMutation as Vt, SetRowHeightCommand as xe, SetWorksheetRowIsAutoHeightCommand as ee, InsertColByRangeCommand as Me, RemoveColByRangeCommand as Ht, MoveColsCommand as Ot, SetColHiddenCommand as Ne, SetSpecificColsVisibleCommand as Te, SetColWidthCommand as jt, SetFrozenCommand as te, CancelFrozenCommand as Lt, ToggleGridlinesCommand as de, SetGridlinesColorCommand as ce, SetTabColorCommand as zt, SetRangeValuesMutation as Ae, SetWorksheetHideCommand as Gt, SetWorksheetShowCommand as $t, SetWorksheetNameCommand as ue, AppendRowCommand as qt, SetWorksheetRowCountCommand as Kt, SetWorksheetColumnCountCommand as Yt, SheetsSelectionsService as tt, SetWorkbookNameCommand as Jt, InsertSheetCommand as q, SetWorksheetActiveOperation as H, RemoveSheetCommand as le, CopySheetCommand as Qt, SetWorksheetOrderCommand as Xt, RegisterWorksheetRangeThemeStyleCommand as Zt, UnregisterWorksheetRangeThemeStyleCommand as en, RangeThemeStyle as tn, SetWorksheetOrderMutation as De, SetTabColorMutation as We, SetWorksheetHideMutation as Be, COMMAND_LISTENER_VALUE_CHANGE as nn, getValueChangedEffectedRange as rn, SheetsFreezeSyncController as sn, SheetValueChangeType as on, SheetSkeletonChangeType as an, SplitDelimiterEnum as hn } from "@univerjs/sheets";
|
|
7
|
+
import { IDefinedNamesService as nt, serializeRange as we, serializeRangeWithSheet as dn, FormulaDataModel as cn, deserializeRangeWithSheet as un } from "@univerjs/engine-formula";
|
|
8
|
+
var ln = Object.getOwnPropertyDescriptor, gn = (a, e, t, n) => {
|
|
9
|
+
for (var r = n > 1 ? void 0 : n ? ln(e, t) : e, s = a.length - 1, o; s >= 0; s--)
|
|
10
|
+
(o = a[s]) && (r = o(r) || r);
|
|
11
|
+
return r;
|
|
12
|
+
}, I = (a, e) => (t, n) => e(t, n, a);
|
|
13
|
+
function mn(a, e, t) {
|
|
14
|
+
const n = t.getDefinedNameMap(a);
|
|
15
15
|
if (n == null)
|
|
16
16
|
return e.t("definedName.defaultName") + 1;
|
|
17
|
-
const
|
|
18
|
-
if (t.getValueByName(
|
|
19
|
-
return
|
|
20
|
-
let
|
|
17
|
+
const s = Array.from(Object.values(n)).length + 1, o = e.t("definedName.defaultName") + s;
|
|
18
|
+
if (t.getValueByName(a, o) == null)
|
|
19
|
+
return o;
|
|
20
|
+
let i = s + 1;
|
|
21
21
|
for (; ; ) {
|
|
22
|
-
const h = e.t("definedName.defaultName") +
|
|
23
|
-
if (t.getValueByName(
|
|
22
|
+
const h = e.t("definedName.defaultName") + i;
|
|
23
|
+
if (t.getValueByName(a, h) == null)
|
|
24
24
|
return h;
|
|
25
|
-
|
|
25
|
+
i++;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
class
|
|
28
|
+
class Q {
|
|
29
29
|
constructor() {
|
|
30
|
-
|
|
30
|
+
b(this, "_definedNameParam");
|
|
31
31
|
this._definedNameParam = {
|
|
32
|
-
id:
|
|
32
|
+
id: Le(10),
|
|
33
33
|
unitId: "",
|
|
34
34
|
name: "",
|
|
35
35
|
formulaOrRefString: "",
|
|
36
|
-
localSheetId:
|
|
36
|
+
localSheetId: O
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
@@ -104,12 +104,12 @@ class Y {
|
|
|
104
104
|
* fWorkbook.insertDefinedNameBuilder(definedNameBuilder);
|
|
105
105
|
* ```
|
|
106
106
|
*/
|
|
107
|
-
setRefByRange(e, t, n,
|
|
108
|
-
return this._definedNameParam.formulaOrRefString =
|
|
107
|
+
setRefByRange(e, t, n, r) {
|
|
108
|
+
return this._definedNameParam.formulaOrRefString = we({
|
|
109
109
|
startRow: e,
|
|
110
110
|
endRow: e + (n != null ? n : 1) - 1,
|
|
111
111
|
startColumn: t,
|
|
112
|
-
endColumn: t + (
|
|
112
|
+
endColumn: t + (r != null ? r : 1) - 1
|
|
113
113
|
}), this;
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
@@ -168,7 +168,7 @@ class Y {
|
|
|
168
168
|
* ```
|
|
169
169
|
*/
|
|
170
170
|
setScopeToWorkbook() {
|
|
171
|
-
return this._definedNameParam.localSheetId =
|
|
171
|
+
return this._definedNameParam.localSheetId = O, this;
|
|
172
172
|
}
|
|
173
173
|
/**
|
|
174
174
|
* Sets the hidden status of the defined name builder.
|
|
@@ -228,12 +228,12 @@ class Y {
|
|
|
228
228
|
return this._definedNameParam = e, this;
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
let
|
|
232
|
-
constructor(
|
|
233
|
-
super(), this._definedNameParam =
|
|
231
|
+
let K = class extends me {
|
|
232
|
+
constructor(a, e, t, n, r, s, o, i, h, d) {
|
|
233
|
+
super(), this._definedNameParam = a, this._injector = e, this._commandService = t, this._permissionService = n, this._worksheetProtectionRuleModel = r, this._rangeProtectionRuleModel = s, this._worksheetProtectionPointRuleModel = o, this._authzIoService = i, this._localeService = h, this._definedNamesService = d;
|
|
234
234
|
}
|
|
235
235
|
_apply() {
|
|
236
|
-
this._definedNameParam.name === "" && (this._definedNameParam.name =
|
|
236
|
+
this._definedNameParam.name === "" && (this._definedNameParam.name = mn(this._definedNameParam.unitId, this._localeService, this._definedNamesService)), this._commandService.syncExecuteCommand(ae.id, this._definedNameParam);
|
|
237
237
|
}
|
|
238
238
|
/**
|
|
239
239
|
* Gets the name of the defined name.
|
|
@@ -258,8 +258,8 @@ let $ = class extends le {
|
|
|
258
258
|
* definedName?.setName('NewDefinedName');
|
|
259
259
|
* ```
|
|
260
260
|
*/
|
|
261
|
-
setName(
|
|
262
|
-
this._definedNameParam.name =
|
|
261
|
+
setName(a) {
|
|
262
|
+
this._definedNameParam.name = a, this._apply();
|
|
263
263
|
}
|
|
264
264
|
/**
|
|
265
265
|
* Sets the formula of the defined name.
|
|
@@ -271,8 +271,8 @@ let $ = class extends le {
|
|
|
271
271
|
* definedName?.setFormula('SUM(Sheet1!$A$1)');
|
|
272
272
|
* ```
|
|
273
273
|
*/
|
|
274
|
-
setFormula(
|
|
275
|
-
this._definedNameParam.formulaOrRefString = `=${
|
|
274
|
+
setFormula(a) {
|
|
275
|
+
this._definedNameParam.formulaOrRefString = `=${a}`, this._apply();
|
|
276
276
|
}
|
|
277
277
|
/**
|
|
278
278
|
* Sets the reference of the defined name.
|
|
@@ -284,8 +284,8 @@ let $ = class extends le {
|
|
|
284
284
|
* definedName?.setRef('Sheet1!$A$1');
|
|
285
285
|
* ```
|
|
286
286
|
*/
|
|
287
|
-
setRef(
|
|
288
|
-
this._definedNameParam.formulaOrRefString =
|
|
287
|
+
setRef(a) {
|
|
288
|
+
this._definedNameParam.formulaOrRefString = a, this._apply();
|
|
289
289
|
}
|
|
290
290
|
/**
|
|
291
291
|
* Gets the formula or reference string of the defined name.
|
|
@@ -313,10 +313,10 @@ let $ = class extends le {
|
|
|
313
313
|
* definedName?.setRefByRange(1, 3, 2, 5); // D2:H3
|
|
314
314
|
* ```
|
|
315
315
|
*/
|
|
316
|
-
setRefByRange(
|
|
317
|
-
this._definedNameParam.formulaOrRefString =
|
|
318
|
-
startRow:
|
|
319
|
-
endRow:
|
|
316
|
+
setRefByRange(a, e, t, n) {
|
|
317
|
+
this._definedNameParam.formulaOrRefString = we({
|
|
318
|
+
startRow: a,
|
|
319
|
+
endRow: a + (t != null ? t : 1) - 1,
|
|
320
320
|
startColumn: e,
|
|
321
321
|
endColumn: e + (n != null ? n : 1) - 1
|
|
322
322
|
}), this._apply();
|
|
@@ -344,8 +344,8 @@ let $ = class extends le {
|
|
|
344
344
|
* definedName?.setComment('This is a comment');
|
|
345
345
|
* ```
|
|
346
346
|
*/
|
|
347
|
-
setComment(
|
|
348
|
-
this._definedNameParam.comment =
|
|
347
|
+
setComment(a) {
|
|
348
|
+
this._definedNameParam.comment = a, this._apply();
|
|
349
349
|
}
|
|
350
350
|
/**
|
|
351
351
|
* Sets the scope of the defined name to the worksheet.
|
|
@@ -360,8 +360,8 @@ let $ = class extends le {
|
|
|
360
360
|
* definedName?.setScopeToWorksheet(sheets[1]);
|
|
361
361
|
* ```
|
|
362
362
|
*/
|
|
363
|
-
setScopeToWorksheet(
|
|
364
|
-
this._definedNameParam.localSheetId =
|
|
363
|
+
setScopeToWorksheet(a) {
|
|
364
|
+
this._definedNameParam.localSheetId = a.getSheetId(), this._apply();
|
|
365
365
|
}
|
|
366
366
|
/**
|
|
367
367
|
* Sets the scope of the defined name to the workbook.
|
|
@@ -373,7 +373,7 @@ let $ = class extends le {
|
|
|
373
373
|
* ```
|
|
374
374
|
*/
|
|
375
375
|
setScopeToWorkbook() {
|
|
376
|
-
this._definedNameParam.localSheetId =
|
|
376
|
+
this._definedNameParam.localSheetId = O, this._apply();
|
|
377
377
|
}
|
|
378
378
|
/**
|
|
379
379
|
* Sets the hidden status of the defined name.
|
|
@@ -385,8 +385,8 @@ let $ = class extends le {
|
|
|
385
385
|
* definedName?.setHidden(true);
|
|
386
386
|
* ```
|
|
387
387
|
*/
|
|
388
|
-
setHidden(
|
|
389
|
-
this._definedNameParam.hidden =
|
|
388
|
+
setHidden(a) {
|
|
389
|
+
this._definedNameParam.hidden = a, this._apply();
|
|
390
390
|
}
|
|
391
391
|
/**
|
|
392
392
|
* Deletes the defined name.
|
|
@@ -398,7 +398,7 @@ let $ = class extends le {
|
|
|
398
398
|
* ```
|
|
399
399
|
*/
|
|
400
400
|
delete() {
|
|
401
|
-
this._commandService.syncExecuteCommand(
|
|
401
|
+
this._commandService.syncExecuteCommand(ut.id, this._definedNameParam);
|
|
402
402
|
}
|
|
403
403
|
/**
|
|
404
404
|
* Gets the local sheet id of the defined name.
|
|
@@ -424,7 +424,7 @@ let $ = class extends le {
|
|
|
424
424
|
* ```
|
|
425
425
|
*/
|
|
426
426
|
isWorkbookScope() {
|
|
427
|
-
return this._definedNameParam.localSheetId ===
|
|
427
|
+
return this._definedNameParam.localSheetId === O;
|
|
428
428
|
}
|
|
429
429
|
/**
|
|
430
430
|
* Converts the defined name to a defined name builder.
|
|
@@ -443,42 +443,46 @@ let $ = class extends le {
|
|
|
443
443
|
* ```
|
|
444
444
|
*/
|
|
445
445
|
toBuilder() {
|
|
446
|
-
const
|
|
447
|
-
return
|
|
446
|
+
const a = this._injector.createInstance(Q);
|
|
447
|
+
return a.load(this._definedNameParam), a;
|
|
448
448
|
}
|
|
449
449
|
};
|
|
450
|
-
|
|
451
|
-
I(1,
|
|
452
|
-
I(2,
|
|
453
|
-
I(3,
|
|
454
|
-
I(4,
|
|
455
|
-
I(5,
|
|
456
|
-
I(6,
|
|
457
|
-
I(7,
|
|
458
|
-
I(8,
|
|
459
|
-
I(9,
|
|
460
|
-
],
|
|
461
|
-
var
|
|
462
|
-
for (var
|
|
463
|
-
(
|
|
464
|
-
return
|
|
465
|
-
},
|
|
466
|
-
let
|
|
467
|
-
constructor(e, t, n, s, o, i,
|
|
450
|
+
K = gn([
|
|
451
|
+
I(1, g(M)),
|
|
452
|
+
I(2, _),
|
|
453
|
+
I(3, ge),
|
|
454
|
+
I(4, g(qe)),
|
|
455
|
+
I(5, g(Ke)),
|
|
456
|
+
I(6, g(Ye)),
|
|
457
|
+
I(7, g(Oe)),
|
|
458
|
+
I(8, g(je)),
|
|
459
|
+
I(9, nt)
|
|
460
|
+
], K);
|
|
461
|
+
var _n = Object.getOwnPropertyDescriptor, kn = (a, e, t, n) => {
|
|
462
|
+
for (var r = n > 1 ? void 0 : n ? _n(e, t) : e, s = a.length - 1, o; s >= 0; s--)
|
|
463
|
+
(o = a[s]) && (r = o(r) || r);
|
|
464
|
+
return r;
|
|
465
|
+
}, E = (a, e) => (t, n) => e(t, n, a);
|
|
466
|
+
let Y = class extends me {
|
|
467
|
+
constructor(e, t, n, r, s, o, i, h) {
|
|
468
468
|
super();
|
|
469
469
|
/**
|
|
470
470
|
* Permission point definition, can read the point constructor want to modify from here
|
|
471
471
|
*/
|
|
472
|
-
|
|
472
|
+
b(this, "permissionPointsDefinition", gt);
|
|
473
473
|
/**
|
|
474
474
|
* An observable object used to monitor permission change events within a range, thereby triggering corresponding subsequent processing.
|
|
475
475
|
*/
|
|
476
|
-
|
|
476
|
+
b(this, "rangeRuleChangedAfterAuth$");
|
|
477
477
|
/**
|
|
478
478
|
* An observable object used to monitor permission change events within a worksheet, thereby triggering corresponding subsequent processing.
|
|
479
479
|
*/
|
|
480
|
-
|
|
481
|
-
|
|
480
|
+
b(this, "sheetRuleChangedAfterAuth$");
|
|
481
|
+
/**
|
|
482
|
+
* An observable object used to monitor the initialization state changes of unit permissions.
|
|
483
|
+
*/
|
|
484
|
+
b(this, "unitPermissionInitStateChange$");
|
|
485
|
+
this._injector = e, this._commandService = t, this._permissionService = n, this._worksheetProtectionRuleModel = r, this._rangeProtectionRuleModel = s, this._worksheetProtectionPointRuleModel = o, this._workbookPermissionService = i, this._authzIoService = h, this.rangeRuleChangedAfterAuth$ = this._rangeProtectionRuleModel.ruleRefresh$, this.sheetRuleChangedAfterAuth$ = this._worksheetProtectionRuleModel.ruleRefresh$, this.unitPermissionInitStateChange$ = this._workbookPermissionService.unitPermissionInitStateChange$;
|
|
482
486
|
}
|
|
483
487
|
/**
|
|
484
488
|
* Configures a specific permission point for a workbook.
|
|
@@ -497,8 +501,8 @@ let q = class extends le {
|
|
|
497
501
|
* ```
|
|
498
502
|
*/
|
|
499
503
|
setWorkbookPermissionPoint(e, t, n) {
|
|
500
|
-
const
|
|
501
|
-
this._permissionService.getPermissionPoint(
|
|
504
|
+
const r = new t(e);
|
|
505
|
+
this._permissionService.getPermissionPoint(r.id) || this._permissionService.addPermissionPoint(r), this._permissionService.updatePermissionPoint(r.id, n);
|
|
502
506
|
}
|
|
503
507
|
/**
|
|
504
508
|
* Check if a specific permission point is enabled for a workbook.
|
|
@@ -516,9 +520,9 @@ let q = class extends le {
|
|
|
516
520
|
* ```
|
|
517
521
|
*/
|
|
518
522
|
checkWorkbookPermissionPoint(e, t) {
|
|
519
|
-
const n = new t(e),
|
|
520
|
-
if (
|
|
521
|
-
return
|
|
523
|
+
const n = new t(e), r = this._permissionService.getPermissionPoint(n.id);
|
|
524
|
+
if (r)
|
|
525
|
+
return r.value;
|
|
522
526
|
}
|
|
523
527
|
/**
|
|
524
528
|
* This function is used to set whether the workbook can be edited
|
|
@@ -534,7 +538,7 @@ let q = class extends le {
|
|
|
534
538
|
* ```
|
|
535
539
|
*/
|
|
536
540
|
setWorkbookEditPermission(e, t) {
|
|
537
|
-
this.setWorkbookPermissionPoint(e,
|
|
541
|
+
this.setWorkbookPermissionPoint(e, Je, t);
|
|
538
542
|
}
|
|
539
543
|
/**
|
|
540
544
|
* This function is used to add a base permission for a worksheet.
|
|
@@ -561,8 +565,8 @@ let q = class extends le {
|
|
|
561
565
|
async addWorksheetBasePermission(e, t) {
|
|
562
566
|
if (this._rangeProtectionRuleModel.getSubunitRuleList(e, t).length > 0)
|
|
563
567
|
throw new Error("sheet protection cannot intersect with range protection");
|
|
564
|
-
const
|
|
565
|
-
objectType:
|
|
568
|
+
const r = await this._authzIoService.create({
|
|
569
|
+
objectType: F.Worksheet,
|
|
566
570
|
worksheetObject: {
|
|
567
571
|
collaborators: [],
|
|
568
572
|
unitID: e,
|
|
@@ -571,17 +575,17 @@ let q = class extends le {
|
|
|
571
575
|
scope: void 0
|
|
572
576
|
}
|
|
573
577
|
});
|
|
574
|
-
if (this._commandService.syncExecuteCommand(
|
|
578
|
+
if (this._commandService.syncExecuteCommand(mt.id, {
|
|
575
579
|
unitId: e,
|
|
576
580
|
subUnitId: t,
|
|
577
581
|
rule: {
|
|
578
|
-
permissionId:
|
|
579
|
-
unitType:
|
|
582
|
+
permissionId: r,
|
|
583
|
+
unitType: F.Worksheet,
|
|
580
584
|
unitId: e,
|
|
581
585
|
subUnitId: t
|
|
582
586
|
}
|
|
583
587
|
}))
|
|
584
|
-
return
|
|
588
|
+
return r;
|
|
585
589
|
}
|
|
586
590
|
/**
|
|
587
591
|
* Delete the entire table protection set for the worksheet and reset the point permissions of the worksheet to true
|
|
@@ -599,12 +603,12 @@ let q = class extends le {
|
|
|
599
603
|
* ```
|
|
600
604
|
*/
|
|
601
605
|
removeWorksheetPermission(e, t) {
|
|
602
|
-
this._commandService.syncExecuteCommand(
|
|
606
|
+
this._commandService.syncExecuteCommand(_t.id, {
|
|
603
607
|
unitId: e,
|
|
604
608
|
subUnitId: t
|
|
605
|
-
}), [...
|
|
606
|
-
const
|
|
607
|
-
this._permissionService.updatePermissionPoint(
|
|
609
|
+
}), [...kt(), ...Re()].forEach((n) => {
|
|
610
|
+
const r = new n(e, t);
|
|
611
|
+
this._permissionService.updatePermissionPoint(r.id, !0);
|
|
608
612
|
}), this._worksheetProtectionPointRuleModel.deleteRule(e, t);
|
|
609
613
|
}
|
|
610
614
|
/**
|
|
@@ -629,21 +633,21 @@ let q = class extends le {
|
|
|
629
633
|
* permission.setWorksheetPermissionPoint(unitId, subUnitId, permission.permissionPointsDefinition.WorksheetEditPermission, false);
|
|
630
634
|
* ```
|
|
631
635
|
*/
|
|
632
|
-
async setWorksheetPermissionPoint(e, t, n,
|
|
633
|
-
const
|
|
634
|
-
let
|
|
635
|
-
if (n ===
|
|
636
|
-
if (
|
|
637
|
-
|
|
636
|
+
async setWorksheetPermissionPoint(e, t, n, r) {
|
|
637
|
+
const s = this._worksheetProtectionRuleModel.getRule(e, t);
|
|
638
|
+
let o;
|
|
639
|
+
if (n === ft || n === It)
|
|
640
|
+
if (s)
|
|
641
|
+
o = s.permissionId;
|
|
638
642
|
else {
|
|
639
643
|
if (this._rangeProtectionRuleModel.getSubunitRuleList(e, t).length > 0)
|
|
640
644
|
throw new Error("sheet protection cannot intersect with range protection");
|
|
641
|
-
|
|
645
|
+
o = await this.addWorksheetBasePermission(e, t);
|
|
642
646
|
}
|
|
643
647
|
else {
|
|
644
648
|
const c = this._worksheetProtectionPointRuleModel.getRule(e, t);
|
|
645
|
-
c ?
|
|
646
|
-
objectType:
|
|
649
|
+
c ? o = c.permissionId : (o = await this._authzIoService.create({
|
|
650
|
+
objectType: F.Worksheet,
|
|
647
651
|
worksheetObject: {
|
|
648
652
|
collaborators: [],
|
|
649
653
|
unitID: e,
|
|
@@ -651,10 +655,10 @@ let q = class extends le {
|
|
|
651
655
|
name: "",
|
|
652
656
|
scope: void 0
|
|
653
657
|
}
|
|
654
|
-
}), this._commandService.syncExecuteCommand(
|
|
658
|
+
}), this._commandService.syncExecuteCommand(wt.id, { unitId: e, subUnitId: t, rule: { unitId: e, subUnitId: t, permissionId: o } }));
|
|
655
659
|
}
|
|
656
660
|
const h = new n(e, t);
|
|
657
|
-
return this._permissionService.getPermissionPoint(h.id) || this._permissionService.addPermissionPoint(h), this._permissionService.updatePermissionPoint(h.id,
|
|
661
|
+
return this._permissionService.getPermissionPoint(h.id) || this._permissionService.addPermissionPoint(h), this._permissionService.updatePermissionPoint(h.id, r), o;
|
|
658
662
|
}
|
|
659
663
|
/**
|
|
660
664
|
* Check if a specific permission point is enabled for a worksheet.
|
|
@@ -676,9 +680,9 @@ let q = class extends le {
|
|
|
676
680
|
* ```
|
|
677
681
|
*/
|
|
678
682
|
checkWorksheetPermissionPoint(e, t, n) {
|
|
679
|
-
const
|
|
680
|
-
if (
|
|
681
|
-
return
|
|
683
|
+
const r = new n(e, t), s = this._permissionService.getPermissionPoint(r.id);
|
|
684
|
+
if (s)
|
|
685
|
+
return s.value;
|
|
682
686
|
}
|
|
683
687
|
/**
|
|
684
688
|
* Adds a range protection to the worksheet.
|
|
@@ -707,34 +711,34 @@ let q = class extends le {
|
|
|
707
711
|
* ```
|
|
708
712
|
*/
|
|
709
713
|
async addRangeBaseProtection(e, t, n) {
|
|
710
|
-
const
|
|
711
|
-
objectType:
|
|
714
|
+
const r = await this._authzIoService.create({
|
|
715
|
+
objectType: F.SelectRange,
|
|
712
716
|
selectRangeObject: {
|
|
713
717
|
collaborators: [],
|
|
714
718
|
unitID: e,
|
|
715
719
|
name: "",
|
|
716
720
|
scope: void 0
|
|
717
721
|
}
|
|
718
|
-
}),
|
|
722
|
+
}), s = `ruleId_${Le(6)}`;
|
|
719
723
|
if (this._worksheetProtectionRuleModel.getRule(e, t))
|
|
720
724
|
throw new Error("sheet protection cannot intersect with range protection");
|
|
721
|
-
if (this._rangeProtectionRuleModel.getSubunitRuleList(e, t).some((c) => c.ranges.some((
|
|
725
|
+
if (this._rangeProtectionRuleModel.getSubunitRuleList(e, t).some((c) => c.ranges.some((l) => n.some((u) => x.intersects(u.getRange(), l)))))
|
|
722
726
|
throw new Error("range protection cannot intersect");
|
|
723
|
-
if (this._commandService.syncExecuteCommand(
|
|
727
|
+
if (this._commandService.syncExecuteCommand(St.id, {
|
|
724
728
|
unitId: e,
|
|
725
729
|
subUnitId: t,
|
|
726
730
|
rules: [{
|
|
727
|
-
permissionId:
|
|
728
|
-
unitType:
|
|
731
|
+
permissionId: r,
|
|
732
|
+
unitType: F.SelectRange,
|
|
729
733
|
unitId: e,
|
|
730
734
|
subUnitId: t,
|
|
731
735
|
ranges: n.map((c) => c.getRange()),
|
|
732
|
-
id:
|
|
736
|
+
id: s
|
|
733
737
|
}]
|
|
734
738
|
}))
|
|
735
739
|
return {
|
|
736
|
-
permissionId:
|
|
737
|
-
ruleId:
|
|
740
|
+
permissionId: r,
|
|
741
|
+
ruleId: s
|
|
738
742
|
};
|
|
739
743
|
}
|
|
740
744
|
/**
|
|
@@ -759,13 +763,13 @@ let q = class extends le {
|
|
|
759
763
|
* ```
|
|
760
764
|
*/
|
|
761
765
|
removeRangeProtection(e, t, n) {
|
|
762
|
-
this._commandService.syncExecuteCommand(
|
|
766
|
+
this._commandService.syncExecuteCommand(Ct.id, {
|
|
763
767
|
unitId: e,
|
|
764
768
|
subUnitId: t,
|
|
765
769
|
ruleIds: n
|
|
766
|
-
}) && this._rangeProtectionRuleModel.getSubunitRuleList(e, t).length === 0 && (this._worksheetProtectionPointRuleModel.deleteRule(e, t), [...
|
|
767
|
-
const
|
|
768
|
-
this._permissionService.updatePermissionPoint(
|
|
770
|
+
}) && this._rangeProtectionRuleModel.getSubunitRuleList(e, t).length === 0 && (this._worksheetProtectionPointRuleModel.deleteRule(e, t), [...Re()].forEach((o) => {
|
|
771
|
+
const i = new o(e, t);
|
|
772
|
+
this._permissionService.updatePermissionPoint(i.id, i.value);
|
|
769
773
|
}));
|
|
770
774
|
}
|
|
771
775
|
/**
|
|
@@ -795,9 +799,9 @@ let q = class extends le {
|
|
|
795
799
|
* permission.setRangeProtectionPermissionPoint(unitId,subUnitId,permissionId, permission.permissionPointsDefinition.RangeProtectionPermissionEditPoint, false);
|
|
796
800
|
* ```
|
|
797
801
|
*/
|
|
798
|
-
setRangeProtectionPermissionPoint(e, t, n,
|
|
799
|
-
const
|
|
800
|
-
this._permissionService.getPermissionPoint(
|
|
802
|
+
setRangeProtectionPermissionPoint(e, t, n, r, s) {
|
|
803
|
+
const o = new r(e, t, n);
|
|
804
|
+
this._permissionService.getPermissionPoint(o.id) || this._permissionService.addPermissionPoint(o), this._permissionService.updatePermissionPoint(o.id, s);
|
|
801
805
|
}
|
|
802
806
|
/**
|
|
803
807
|
* Sets the ranges for range protection in a worksheet.
|
|
@@ -826,18 +830,18 @@ let q = class extends le {
|
|
|
826
830
|
* permission.setRangeProtectionRanges(unitId, subUnitId, ruleId, [newRange]);
|
|
827
831
|
* ```
|
|
828
832
|
*/
|
|
829
|
-
setRangeProtectionRanges(e, t, n,
|
|
830
|
-
const
|
|
831
|
-
if (
|
|
832
|
-
if (this._rangeProtectionRuleModel.getSubunitRuleList(e, t).filter((h) => h.id !== n).some((h) => h.ranges.some((d) =>
|
|
833
|
+
setRangeProtectionRanges(e, t, n, r) {
|
|
834
|
+
const s = this._rangeProtectionRuleModel.getRule(e, t, n);
|
|
835
|
+
if (s) {
|
|
836
|
+
if (this._rangeProtectionRuleModel.getSubunitRuleList(e, t).filter((h) => h.id !== n).some((h) => h.ranges.some((d) => r.some((c) => x.intersects(c.getRange(), d)))))
|
|
833
837
|
throw new Error("range protection cannot intersect");
|
|
834
|
-
this._commandService.syncExecuteCommand(
|
|
838
|
+
this._commandService.syncExecuteCommand(vt.id, {
|
|
835
839
|
unitId: e,
|
|
836
840
|
subUnitId: t,
|
|
837
841
|
ruleId: n,
|
|
838
842
|
rule: {
|
|
839
|
-
...
|
|
840
|
-
ranges:
|
|
843
|
+
...s,
|
|
844
|
+
ranges: r.map((h) => h.getRange())
|
|
841
845
|
}
|
|
842
846
|
});
|
|
843
847
|
}
|
|
@@ -879,98 +883,106 @@ let q = class extends le {
|
|
|
879
883
|
* }
|
|
880
884
|
* ```
|
|
881
885
|
*/
|
|
882
|
-
getPermissionInfoWithCell(e, t, n,
|
|
883
|
-
const
|
|
884
|
-
if (
|
|
886
|
+
getPermissionInfoWithCell(e, t, n, r) {
|
|
887
|
+
const s = ot(n, r), o = this._rangeProtectionRuleModel.getSubunitRuleList(e, t).find((i) => i.ranges.some((d) => x.intersects(s, d)));
|
|
888
|
+
if (o)
|
|
885
889
|
return {
|
|
886
|
-
permissionId:
|
|
887
|
-
ruleId:
|
|
890
|
+
permissionId: o.permissionId,
|
|
891
|
+
ruleId: o.id
|
|
888
892
|
};
|
|
889
893
|
}
|
|
890
894
|
};
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
895
|
+
Y = kn([
|
|
896
|
+
E(0, g(M)),
|
|
897
|
+
E(1, _),
|
|
898
|
+
E(2, ge),
|
|
899
|
+
E(3, g(qe)),
|
|
900
|
+
E(4, g(Ke)),
|
|
901
|
+
E(5, g(Ye)),
|
|
902
|
+
E(6, g(lt)),
|
|
903
|
+
E(7, g(Oe))
|
|
904
|
+
], Y);
|
|
905
|
+
function wn(a) {
|
|
906
|
+
switch (a) {
|
|
902
907
|
case "left":
|
|
903
|
-
return
|
|
908
|
+
return A.LEFT;
|
|
904
909
|
case "center":
|
|
905
|
-
return
|
|
910
|
+
return A.CENTER;
|
|
906
911
|
case "normal":
|
|
907
|
-
return
|
|
912
|
+
return A.RIGHT;
|
|
908
913
|
default:
|
|
909
|
-
throw new Error(`Invalid horizontal alignment: ${
|
|
914
|
+
throw new Error(`Invalid horizontal alignment: ${a}`);
|
|
910
915
|
}
|
|
911
916
|
}
|
|
912
|
-
function
|
|
913
|
-
switch (
|
|
914
|
-
case
|
|
917
|
+
function Fe(a) {
|
|
918
|
+
switch (a) {
|
|
919
|
+
case A.LEFT:
|
|
915
920
|
return "left";
|
|
916
|
-
case
|
|
921
|
+
case A.CENTER:
|
|
917
922
|
return "center";
|
|
918
|
-
case
|
|
923
|
+
case A.RIGHT:
|
|
919
924
|
return "normal";
|
|
920
925
|
default:
|
|
921
926
|
return "general";
|
|
922
927
|
}
|
|
923
928
|
}
|
|
924
|
-
function
|
|
925
|
-
switch (
|
|
929
|
+
function Sn(a) {
|
|
930
|
+
switch (a) {
|
|
926
931
|
case "top":
|
|
927
|
-
return
|
|
932
|
+
return D.TOP;
|
|
928
933
|
case "middle":
|
|
929
|
-
return
|
|
934
|
+
return D.MIDDLE;
|
|
930
935
|
case "bottom":
|
|
931
|
-
return
|
|
936
|
+
return D.BOTTOM;
|
|
932
937
|
default:
|
|
933
|
-
throw new Error(`Invalid vertical alignment: ${
|
|
938
|
+
throw new Error(`Invalid vertical alignment: ${a}`);
|
|
934
939
|
}
|
|
935
940
|
}
|
|
936
|
-
function
|
|
937
|
-
switch (
|
|
938
|
-
case
|
|
941
|
+
function Ve(a) {
|
|
942
|
+
switch (a) {
|
|
943
|
+
case D.TOP:
|
|
939
944
|
return "top";
|
|
940
|
-
case
|
|
945
|
+
case D.MIDDLE:
|
|
941
946
|
return "middle";
|
|
942
|
-
case
|
|
947
|
+
case D.BOTTOM:
|
|
943
948
|
return "bottom";
|
|
944
949
|
default:
|
|
945
950
|
return "general";
|
|
946
951
|
}
|
|
947
952
|
}
|
|
948
|
-
function
|
|
953
|
+
function ne(a, e) {
|
|
949
954
|
return {
|
|
950
|
-
startRow:
|
|
951
|
-
endRow:
|
|
955
|
+
startRow: a.startRow,
|
|
956
|
+
endRow: a.endRow,
|
|
952
957
|
startColumn: 0,
|
|
953
958
|
endColumn: e.getColumnCount() - 1,
|
|
954
|
-
rangeType:
|
|
959
|
+
rangeType: w.ROW
|
|
955
960
|
};
|
|
956
961
|
}
|
|
957
|
-
function
|
|
962
|
+
function re(a, e) {
|
|
958
963
|
return {
|
|
959
964
|
startRow: 0,
|
|
960
965
|
endRow: e.getRowCount() - 1,
|
|
961
|
-
startColumn:
|
|
962
|
-
endColumn:
|
|
963
|
-
rangeType:
|
|
966
|
+
startColumn: a.startColumn,
|
|
967
|
+
endColumn: a.endColumn,
|
|
968
|
+
rangeType: w.COLUMN
|
|
964
969
|
};
|
|
965
970
|
}
|
|
966
|
-
var
|
|
967
|
-
for (var
|
|
968
|
-
(
|
|
969
|
-
return
|
|
970
|
-
},
|
|
971
|
-
let
|
|
972
|
-
constructor(
|
|
973
|
-
super(
|
|
971
|
+
var Cn = Object.getOwnPropertyDescriptor, vn = (a, e, t, n) => {
|
|
972
|
+
for (var r = n > 1 ? void 0 : n ? Cn(e, t) : e, s = a.length - 1, o; s >= 0; s--)
|
|
973
|
+
(o = a[s]) && (r = o(r) || r);
|
|
974
|
+
return r;
|
|
975
|
+
}, se = (a, e) => (t, n) => e(t, n, a), W;
|
|
976
|
+
let k = (W = class extends _e {
|
|
977
|
+
constructor(e, t, n, r, s, o) {
|
|
978
|
+
super(r), this._workbook = e, this._worksheet = t, this._range = n, this._injector = r, this._commandService = s, this._formulaDataModel = o, this._runInitializers(
|
|
979
|
+
this._injector,
|
|
980
|
+
this._workbook,
|
|
981
|
+
this._worksheet,
|
|
982
|
+
this._range,
|
|
983
|
+
this._commandService,
|
|
984
|
+
this._formulaDataModel
|
|
985
|
+
);
|
|
974
986
|
}
|
|
975
987
|
/**
|
|
976
988
|
* Get the unit ID of the current workbook
|
|
@@ -1129,8 +1141,8 @@ let _ = class extends ge {
|
|
|
1129
1141
|
* ```
|
|
1130
1142
|
*/
|
|
1131
1143
|
isMerged() {
|
|
1132
|
-
const { startColumn:
|
|
1133
|
-
return this._worksheet.getMergedCellRange(e, r, n
|
|
1144
|
+
const { startColumn: e, startRow: t, endColumn: n, endRow: r } = this._range;
|
|
1145
|
+
return this._worksheet.getMergedCellRange(t, e, r, n).some((o) => x.equals(o, this._range));
|
|
1134
1146
|
}
|
|
1135
1147
|
/**
|
|
1136
1148
|
* Return first cell style data in this range. Please note that if there are row styles, col styles and (or)
|
|
@@ -1150,8 +1162,8 @@ let _ = class extends ge {
|
|
|
1150
1162
|
* console.log(fRange.getCellStyleData());
|
|
1151
1163
|
* ```
|
|
1152
1164
|
*/
|
|
1153
|
-
getCellStyleData(
|
|
1154
|
-
return
|
|
1165
|
+
getCellStyleData(e = "row") {
|
|
1166
|
+
return e !== "cell" ? this._worksheet.getComposedCellStyle(this._range.startRow, this._range.startColumn, e === "row") : this._worksheet.getCellStyle(this._range.startRow, this._range.startColumn);
|
|
1155
1167
|
}
|
|
1156
1168
|
/**
|
|
1157
1169
|
* Get the font family of the cell.
|
|
@@ -1170,9 +1182,9 @@ let _ = class extends ge {
|
|
|
1170
1182
|
* console.log(fRange.getFontFamily());
|
|
1171
1183
|
* ```
|
|
1172
1184
|
*/
|
|
1173
|
-
getFontFamily(
|
|
1174
|
-
var
|
|
1175
|
-
return (
|
|
1185
|
+
getFontFamily(e = "row") {
|
|
1186
|
+
var t, n;
|
|
1187
|
+
return (n = (t = this.getCellStyleData(e)) == null ? void 0 : t.ff) != null ? n : null;
|
|
1176
1188
|
}
|
|
1177
1189
|
/**
|
|
1178
1190
|
* Get the font size of the cell.
|
|
@@ -1191,9 +1203,9 @@ let _ = class extends ge {
|
|
|
1191
1203
|
* console.log(fRange.getFontSize());
|
|
1192
1204
|
* ```
|
|
1193
1205
|
*/
|
|
1194
|
-
getFontSize(
|
|
1195
|
-
var
|
|
1196
|
-
return (
|
|
1206
|
+
getFontSize(e = "row") {
|
|
1207
|
+
var t, n;
|
|
1208
|
+
return (n = (t = this.getCellStyleData(e)) == null ? void 0 : t.fs) != null ? n : null;
|
|
1197
1209
|
}
|
|
1198
1210
|
/**
|
|
1199
1211
|
* Return first cell style in this range.
|
|
@@ -1212,9 +1224,9 @@ let _ = class extends ge {
|
|
|
1212
1224
|
* console.log(fRange.getCellStyle());
|
|
1213
1225
|
* ```
|
|
1214
1226
|
*/
|
|
1215
|
-
getCellStyle(
|
|
1216
|
-
const
|
|
1217
|
-
return
|
|
1227
|
+
getCellStyle(e = "row") {
|
|
1228
|
+
const t = this.getCellStyleData(e);
|
|
1229
|
+
return t ? Se.create(t) : null;
|
|
1218
1230
|
}
|
|
1219
1231
|
/**
|
|
1220
1232
|
* Returns the cell styles for the cells in the range.
|
|
@@ -1233,16 +1245,16 @@ let _ = class extends ge {
|
|
|
1233
1245
|
* console.log(fRange.getCellStyles());
|
|
1234
1246
|
* ```
|
|
1235
1247
|
*/
|
|
1236
|
-
getCellStyles(
|
|
1237
|
-
return this.getCellDatas().map((
|
|
1248
|
+
getCellStyles(e = "row") {
|
|
1249
|
+
return this.getCellDatas().map((n, r) => n.map((s, o) => {
|
|
1238
1250
|
if (!s) return null;
|
|
1239
|
-
const i =
|
|
1240
|
-
return i ?
|
|
1251
|
+
const i = e !== "cell" ? this._worksheet.getComposedCellStyle(r + this._range.startRow, o + this._range.startColumn, e === "row") : this._worksheet.getCellStyle(r + this._range.startRow, o + this._range.startColumn);
|
|
1252
|
+
return i ? Se.create(i) : null;
|
|
1241
1253
|
}));
|
|
1242
1254
|
}
|
|
1243
|
-
getValue(
|
|
1244
|
-
var
|
|
1245
|
-
return
|
|
1255
|
+
getValue(e) {
|
|
1256
|
+
var t, n;
|
|
1257
|
+
return e ? this.getValueAndRichTextValue() : (n = (t = this._worksheet.getCell(this._range.startRow, this._range.startColumn)) == null ? void 0 : t.v) != null ? n : null;
|
|
1246
1258
|
}
|
|
1247
1259
|
/**
|
|
1248
1260
|
* Returns the raw value of the top-left cell in the range. Empty cells return `null`.
|
|
@@ -1264,9 +1276,9 @@ let _ = class extends ge {
|
|
|
1264
1276
|
* ```
|
|
1265
1277
|
*/
|
|
1266
1278
|
getRawValue() {
|
|
1267
|
-
var
|
|
1268
|
-
const
|
|
1269
|
-
return
|
|
1279
|
+
var t, n;
|
|
1280
|
+
const e = this._worksheet.getCellMatrix().getValue(this._range.startRow, this._range.startColumn);
|
|
1281
|
+
return e != null && e.p && ((t = e.p.body) != null && t.dataStream) ? e.p.body.dataStream : (n = e == null ? void 0 : e.v) != null ? n : null;
|
|
1270
1282
|
}
|
|
1271
1283
|
/**
|
|
1272
1284
|
* Returns the displayed value of the top-left cell in the range. The value is a String. Empty cells return an empty string.
|
|
@@ -1288,20 +1300,20 @@ let _ = class extends ge {
|
|
|
1288
1300
|
* ```
|
|
1289
1301
|
*/
|
|
1290
1302
|
getDisplayValue() {
|
|
1291
|
-
var
|
|
1292
|
-
const
|
|
1293
|
-
return
|
|
1303
|
+
var t, n, r;
|
|
1304
|
+
const e = this._worksheet.getCell(this._range.startRow, this._range.startColumn);
|
|
1305
|
+
return e != null && e.p && ((t = e.p.body) != null && t.dataStream) ? e.p.body.dataStream : (r = (n = e == null ? void 0 : e.v) == null ? void 0 : n.toString()) != null ? r : "";
|
|
1294
1306
|
}
|
|
1295
|
-
getValues(
|
|
1296
|
-
var i,
|
|
1297
|
-
if (
|
|
1307
|
+
getValues(e) {
|
|
1308
|
+
var i, h;
|
|
1309
|
+
if (e)
|
|
1298
1310
|
return this.getValueAndRichTextValues();
|
|
1299
|
-
const { startRow:
|
|
1300
|
-
for (let
|
|
1301
|
-
const
|
|
1302
|
-
for (let
|
|
1303
|
-
|
|
1304
|
-
o.push(
|
|
1311
|
+
const { startRow: t, endRow: n, startColumn: r, endColumn: s } = this._range, o = [];
|
|
1312
|
+
for (let d = t; d <= n; d++) {
|
|
1313
|
+
const c = [];
|
|
1314
|
+
for (let l = r; l <= s; l++)
|
|
1315
|
+
c.push((h = (i = this._worksheet.getCell(d, l)) == null ? void 0 : i.v) != null ? h : null);
|
|
1316
|
+
o.push(c);
|
|
1305
1317
|
}
|
|
1306
1318
|
return o;
|
|
1307
1319
|
}
|
|
@@ -1348,15 +1360,15 @@ let _ = class extends ge {
|
|
|
1348
1360
|
* ```
|
|
1349
1361
|
*/
|
|
1350
1362
|
getRawValues() {
|
|
1351
|
-
var i,
|
|
1352
|
-
const
|
|
1353
|
-
for (let
|
|
1354
|
-
const
|
|
1355
|
-
for (let
|
|
1356
|
-
const u =
|
|
1357
|
-
u != null && u.p && ((i = u.p.body) != null && i.dataStream) ?
|
|
1363
|
+
var i, h;
|
|
1364
|
+
const e = this._worksheet.getCellMatrix(), { startRow: t, endRow: n, startColumn: r, endColumn: s } = this._range, o = [];
|
|
1365
|
+
for (let d = t; d <= n; d++) {
|
|
1366
|
+
const c = [];
|
|
1367
|
+
for (let l = r; l <= s; l++) {
|
|
1368
|
+
const u = e.getValue(d, l);
|
|
1369
|
+
u != null && u.p && ((i = u.p.body) != null && i.dataStream) ? c.push(u.p.body.dataStream) : c.push((h = u == null ? void 0 : u.v) != null ? h : null);
|
|
1358
1370
|
}
|
|
1359
|
-
o.push(
|
|
1371
|
+
o.push(c);
|
|
1360
1372
|
}
|
|
1361
1373
|
return o;
|
|
1362
1374
|
}
|
|
@@ -1403,15 +1415,15 @@ let _ = class extends ge {
|
|
|
1403
1415
|
* ```
|
|
1404
1416
|
*/
|
|
1405
1417
|
getDisplayValues() {
|
|
1406
|
-
var o, i,
|
|
1407
|
-
const { startRow:
|
|
1408
|
-
for (let
|
|
1409
|
-
const
|
|
1410
|
-
for (let
|
|
1411
|
-
const u = this._worksheet.getCell(
|
|
1412
|
-
u != null && u.p && ((o = u.p.body) != null && o.dataStream) ?
|
|
1418
|
+
var o, i, h;
|
|
1419
|
+
const { startRow: e, endRow: t, startColumn: n, endColumn: r } = this._range, s = [];
|
|
1420
|
+
for (let d = e; d <= t; d++) {
|
|
1421
|
+
const c = [];
|
|
1422
|
+
for (let l = n; l <= r; l++) {
|
|
1423
|
+
const u = this._worksheet.getCell(d, l);
|
|
1424
|
+
u != null && u.p && ((o = u.p.body) != null && o.dataStream) ? c.push(u.p.body.dataStream) : c.push((h = (i = u == null ? void 0 : u.v) == null ? void 0 : i.toString()) != null ? h : "");
|
|
1413
1425
|
}
|
|
1414
|
-
s.push(
|
|
1426
|
+
s.push(c);
|
|
1415
1427
|
}
|
|
1416
1428
|
return s;
|
|
1417
1429
|
}
|
|
@@ -1427,8 +1439,8 @@ let _ = class extends ge {
|
|
|
1427
1439
|
* ```
|
|
1428
1440
|
*/
|
|
1429
1441
|
getCellData() {
|
|
1430
|
-
var
|
|
1431
|
-
return (
|
|
1442
|
+
var e;
|
|
1443
|
+
return (e = this._worksheet.getCell(this._range.startRow, this._range.startColumn)) != null ? e : null;
|
|
1432
1444
|
}
|
|
1433
1445
|
/**
|
|
1434
1446
|
* Alias for getCellDataGrid.
|
|
@@ -1456,11 +1468,11 @@ let _ = class extends ge {
|
|
|
1456
1468
|
* ```
|
|
1457
1469
|
*/
|
|
1458
1470
|
getCellDataGrid() {
|
|
1459
|
-
const { startRow:
|
|
1460
|
-
for (let o =
|
|
1471
|
+
const { startRow: e, endRow: t, startColumn: n, endColumn: r } = this._range, s = [];
|
|
1472
|
+
for (let o = e; o <= t; o++) {
|
|
1461
1473
|
const i = [];
|
|
1462
|
-
for (let
|
|
1463
|
-
i.push(this._worksheet.getCellRaw(o,
|
|
1474
|
+
for (let h = n; h <= r; h++)
|
|
1475
|
+
i.push(this._worksheet.getCellRaw(o, h));
|
|
1464
1476
|
s.push(i);
|
|
1465
1477
|
}
|
|
1466
1478
|
return s;
|
|
@@ -1479,8 +1491,8 @@ let _ = class extends ge {
|
|
|
1479
1491
|
* ```
|
|
1480
1492
|
*/
|
|
1481
1493
|
getRichTextValue() {
|
|
1482
|
-
const
|
|
1483
|
-
return
|
|
1494
|
+
const e = this.getCellData();
|
|
1495
|
+
return e != null && e.p ? new N(e.p) : null;
|
|
1484
1496
|
}
|
|
1485
1497
|
/**
|
|
1486
1498
|
* Returns the rich text value for the cells in the range.
|
|
@@ -1496,7 +1508,7 @@ let _ = class extends ge {
|
|
|
1496
1508
|
* ```
|
|
1497
1509
|
*/
|
|
1498
1510
|
getRichTextValues() {
|
|
1499
|
-
return this.getCellDataGrid().map((
|
|
1511
|
+
return this.getCellDataGrid().map((t) => t.map((n) => n != null && n.p ? new N(n.p) : null));
|
|
1500
1512
|
}
|
|
1501
1513
|
/**
|
|
1502
1514
|
* Returns the value and rich text value for the cell at the start of this range.
|
|
@@ -1512,8 +1524,8 @@ let _ = class extends ge {
|
|
|
1512
1524
|
* ```
|
|
1513
1525
|
*/
|
|
1514
1526
|
getValueAndRichTextValue() {
|
|
1515
|
-
const
|
|
1516
|
-
return
|
|
1527
|
+
const e = this.getCellData();
|
|
1528
|
+
return e != null && e.p ? new N(e.p) : e == null ? void 0 : e.v;
|
|
1517
1529
|
}
|
|
1518
1530
|
/**
|
|
1519
1531
|
* Returns the value and rich text value for the cells in the range.
|
|
@@ -1527,7 +1539,7 @@ let _ = class extends ge {
|
|
|
1527
1539
|
* ```
|
|
1528
1540
|
*/
|
|
1529
1541
|
getValueAndRichTextValues() {
|
|
1530
|
-
return this.getCellDatas().map((
|
|
1542
|
+
return this.getCellDatas().map((t) => t.map((n) => n != null && n.p ? new N(n.p) : n == null ? void 0 : n.v));
|
|
1531
1543
|
}
|
|
1532
1544
|
/**
|
|
1533
1545
|
* Returns the formula (A1 notation) of the top-left cell in the range, or an empty string if the cell is empty or doesn't contain a formula.
|
|
@@ -1541,13 +1553,13 @@ let _ = class extends ge {
|
|
|
1541
1553
|
* ```
|
|
1542
1554
|
*/
|
|
1543
1555
|
getFormula() {
|
|
1544
|
-
var
|
|
1545
|
-
return (
|
|
1556
|
+
var e;
|
|
1557
|
+
return (e = this._formulaDataModel.getFormulaStringByCell(
|
|
1546
1558
|
this._range.startRow,
|
|
1547
1559
|
this._range.startColumn,
|
|
1548
1560
|
this._worksheet.getSheetId(),
|
|
1549
1561
|
this._workbook.getUnitId()
|
|
1550
|
-
)) != null ?
|
|
1562
|
+
)) != null ? e : "";
|
|
1551
1563
|
}
|
|
1552
1564
|
/**
|
|
1553
1565
|
* Returns the formulas (A1 notation) for the cells in the range. Entries in the 2D array are empty strings for cells with no formula.
|
|
@@ -1561,16 +1573,16 @@ let _ = class extends ge {
|
|
|
1561
1573
|
* ```
|
|
1562
1574
|
*/
|
|
1563
1575
|
getFormulas() {
|
|
1564
|
-
const
|
|
1565
|
-
for (let
|
|
1566
|
-
const
|
|
1567
|
-
for (let
|
|
1568
|
-
const
|
|
1569
|
-
|
|
1576
|
+
const e = [], { startRow: t, endRow: n, startColumn: r, endColumn: s } = this._range, o = this._worksheet.getSheetId(), i = this._workbook.getUnitId();
|
|
1577
|
+
for (let h = t; h <= n; h++) {
|
|
1578
|
+
const d = [];
|
|
1579
|
+
for (let c = r; c <= s; c++) {
|
|
1580
|
+
const l = this._formulaDataModel.getFormulaStringByCell(h, c, o, i);
|
|
1581
|
+
d.push(l || "");
|
|
1570
1582
|
}
|
|
1571
|
-
|
|
1583
|
+
e.push(d);
|
|
1572
1584
|
}
|
|
1573
|
-
return
|
|
1585
|
+
return e;
|
|
1574
1586
|
}
|
|
1575
1587
|
/**
|
|
1576
1588
|
* Gets whether text wrapping is enabled for top-left cell in the range.
|
|
@@ -1584,7 +1596,7 @@ let _ = class extends ge {
|
|
|
1584
1596
|
* ```
|
|
1585
1597
|
*/
|
|
1586
1598
|
getWrap() {
|
|
1587
|
-
return this._worksheet.getRange(this._range).getWrap() ===
|
|
1599
|
+
return this._worksheet.getRange(this._range).getWrap() === m.TRUE;
|
|
1588
1600
|
}
|
|
1589
1601
|
/**
|
|
1590
1602
|
* Gets whether text wrapping is enabled for cells in the range.
|
|
@@ -1597,10 +1609,10 @@ let _ = class extends ge {
|
|
|
1597
1609
|
* console.log(fRange.getWraps());
|
|
1598
1610
|
*/
|
|
1599
1611
|
getWraps() {
|
|
1600
|
-
const
|
|
1601
|
-
return
|
|
1612
|
+
const e = this.getCellDatas(), t = this._workbook.getStyles();
|
|
1613
|
+
return e.map((n) => n.map((r) => {
|
|
1602
1614
|
var s;
|
|
1603
|
-
return ((s =
|
|
1615
|
+
return ((s = t.getStyleByCell(r)) == null ? void 0 : s.tb) === G.WRAP;
|
|
1604
1616
|
}));
|
|
1605
1617
|
}
|
|
1606
1618
|
/**
|
|
@@ -1629,8 +1641,8 @@ let _ = class extends ge {
|
|
|
1629
1641
|
* ```
|
|
1630
1642
|
*/
|
|
1631
1643
|
getHorizontalAlignment() {
|
|
1632
|
-
const
|
|
1633
|
-
return
|
|
1644
|
+
const e = this._worksheet.getRange(this._range).getHorizontalAlignment();
|
|
1645
|
+
return Fe(e);
|
|
1634
1646
|
}
|
|
1635
1647
|
/**
|
|
1636
1648
|
* Returns the horizontal alignments of the cells in the range.
|
|
@@ -1644,7 +1656,7 @@ let _ = class extends ge {
|
|
|
1644
1656
|
* ```
|
|
1645
1657
|
*/
|
|
1646
1658
|
getHorizontalAlignments() {
|
|
1647
|
-
return this._worksheet.getRange(this._range).getHorizontalAlignments().map((
|
|
1659
|
+
return this._worksheet.getRange(this._range).getHorizontalAlignments().map((t) => t.map((n) => Fe(n)));
|
|
1648
1660
|
}
|
|
1649
1661
|
/**
|
|
1650
1662
|
* Returns the vertical alignment (top/middle/bottom) of the top-left cell in the range.
|
|
@@ -1658,7 +1670,7 @@ let _ = class extends ge {
|
|
|
1658
1670
|
* ```
|
|
1659
1671
|
*/
|
|
1660
1672
|
getVerticalAlignment() {
|
|
1661
|
-
return
|
|
1673
|
+
return Ve(this._worksheet.getRange(this._range).getVerticalAlignment());
|
|
1662
1674
|
}
|
|
1663
1675
|
/**
|
|
1664
1676
|
* Returns the vertical alignments of the cells in the range.
|
|
@@ -1672,7 +1684,7 @@ let _ = class extends ge {
|
|
|
1672
1684
|
* ```
|
|
1673
1685
|
*/
|
|
1674
1686
|
getVerticalAlignments() {
|
|
1675
|
-
return this._worksheet.getRange(this._range).getVerticalAlignments().map((
|
|
1687
|
+
return this._worksheet.getRange(this._range).getVerticalAlignments().map((t) => t.map((n) => Ve(n)));
|
|
1676
1688
|
}
|
|
1677
1689
|
/**
|
|
1678
1690
|
* Set custom meta data for first cell in current range.
|
|
@@ -1686,9 +1698,9 @@ let _ = class extends ge {
|
|
|
1686
1698
|
* console.log(fRange.getCustomMetaData());
|
|
1687
1699
|
* ```
|
|
1688
1700
|
*/
|
|
1689
|
-
setCustomMetaData(
|
|
1701
|
+
setCustomMetaData(e) {
|
|
1690
1702
|
return this.setValue({
|
|
1691
|
-
custom:
|
|
1703
|
+
custom: e
|
|
1692
1704
|
});
|
|
1693
1705
|
}
|
|
1694
1706
|
/**
|
|
@@ -1706,8 +1718,8 @@ let _ = class extends ge {
|
|
|
1706
1718
|
* console.log(fRange.getCustomMetaDatas());
|
|
1707
1719
|
* ```
|
|
1708
1720
|
*/
|
|
1709
|
-
setCustomMetaDatas(
|
|
1710
|
-
return this.setValues(
|
|
1721
|
+
setCustomMetaDatas(e) {
|
|
1722
|
+
return this.setValues(e.map((t) => t.map((n) => ({ custom: n }))));
|
|
1711
1723
|
}
|
|
1712
1724
|
/**
|
|
1713
1725
|
* Returns the custom meta data for the cell at the start of this range.
|
|
@@ -1721,9 +1733,9 @@ let _ = class extends ge {
|
|
|
1721
1733
|
* ```
|
|
1722
1734
|
*/
|
|
1723
1735
|
getCustomMetaData() {
|
|
1724
|
-
var
|
|
1725
|
-
const
|
|
1726
|
-
return (
|
|
1736
|
+
var t;
|
|
1737
|
+
const e = this.getCellData();
|
|
1738
|
+
return (t = e == null ? void 0 : e.custom) != null ? t : null;
|
|
1727
1739
|
}
|
|
1728
1740
|
/**
|
|
1729
1741
|
* Returns the custom meta data for the cells in the range.
|
|
@@ -1737,9 +1749,9 @@ let _ = class extends ge {
|
|
|
1737
1749
|
* ```
|
|
1738
1750
|
*/
|
|
1739
1751
|
getCustomMetaDatas() {
|
|
1740
|
-
return this.getCellDataGrid().map((
|
|
1741
|
-
var
|
|
1742
|
-
return (
|
|
1752
|
+
return this.getCellDataGrid().map((t) => t.map((n) => {
|
|
1753
|
+
var r;
|
|
1754
|
+
return (r = n == null ? void 0 : n.custom) != null ? r : null;
|
|
1743
1755
|
}));
|
|
1744
1756
|
}
|
|
1745
1757
|
/**
|
|
@@ -1756,15 +1768,15 @@ let _ = class extends ge {
|
|
|
1756
1768
|
* fRange.setBorder(univerAPI.Enum.BorderType.ALL, univerAPI.Enum.BorderStyleTypes.THIN, '#ff0000');
|
|
1757
1769
|
* ```
|
|
1758
1770
|
*/
|
|
1759
|
-
setBorder(
|
|
1760
|
-
return this._commandService.syncExecuteCommand(
|
|
1771
|
+
setBorder(e, t, n) {
|
|
1772
|
+
return this._commandService.syncExecuteCommand(Rt.id, {
|
|
1761
1773
|
unitId: this._workbook.getUnitId(),
|
|
1762
1774
|
subUnitId: this._worksheet.getSheetId(),
|
|
1763
1775
|
ranges: [this._range],
|
|
1764
1776
|
value: {
|
|
1765
|
-
type:
|
|
1766
|
-
style:
|
|
1767
|
-
color:
|
|
1777
|
+
type: e,
|
|
1778
|
+
style: t,
|
|
1779
|
+
color: n
|
|
1768
1780
|
}
|
|
1769
1781
|
}), this;
|
|
1770
1782
|
}
|
|
@@ -1781,9 +1793,9 @@ let _ = class extends ge {
|
|
|
1781
1793
|
* ```
|
|
1782
1794
|
*/
|
|
1783
1795
|
getBackground() {
|
|
1784
|
-
var
|
|
1785
|
-
const
|
|
1786
|
-
return (
|
|
1796
|
+
var t, n;
|
|
1797
|
+
const e = this.getCellStyle();
|
|
1798
|
+
return (n = (t = e == null ? void 0 : e.background) == null ? void 0 : t.rgb) != null ? n : Ce.bg.rgb;
|
|
1787
1799
|
}
|
|
1788
1800
|
/**
|
|
1789
1801
|
* Returns the background colors of the cells in the range.
|
|
@@ -1797,9 +1809,9 @@ let _ = class extends ge {
|
|
|
1797
1809
|
* ```
|
|
1798
1810
|
*/
|
|
1799
1811
|
getBackgrounds() {
|
|
1800
|
-
return this.getCellStyles().map((
|
|
1801
|
-
var
|
|
1802
|
-
return (s = (
|
|
1812
|
+
return this.getCellStyles().map((t) => t.map((n) => {
|
|
1813
|
+
var r, s;
|
|
1814
|
+
return (s = (r = n == null ? void 0 : n.background) == null ? void 0 : r.rgb) != null ? s : Ce.bg.rgb;
|
|
1803
1815
|
}));
|
|
1804
1816
|
}
|
|
1805
1817
|
/**
|
|
@@ -1814,15 +1826,15 @@ let _ = class extends ge {
|
|
|
1814
1826
|
* fRange.setBackgroundColor('red');
|
|
1815
1827
|
* ```
|
|
1816
1828
|
*/
|
|
1817
|
-
setBackgroundColor(
|
|
1818
|
-
return this._commandService.syncExecuteCommand(
|
|
1829
|
+
setBackgroundColor(e) {
|
|
1830
|
+
return this._commandService.syncExecuteCommand(p.id, {
|
|
1819
1831
|
unitId: this._workbook.getUnitId(),
|
|
1820
1832
|
subUnitId: this._worksheet.getSheetId(),
|
|
1821
1833
|
range: this._range,
|
|
1822
1834
|
style: {
|
|
1823
1835
|
type: "bg",
|
|
1824
1836
|
value: {
|
|
1825
|
-
rgb:
|
|
1837
|
+
rgb: e
|
|
1826
1838
|
}
|
|
1827
1839
|
}
|
|
1828
1840
|
}), this;
|
|
@@ -1839,8 +1851,8 @@ let _ = class extends ge {
|
|
|
1839
1851
|
* fRange.setBackground('red');
|
|
1840
1852
|
* ```
|
|
1841
1853
|
*/
|
|
1842
|
-
setBackground(
|
|
1843
|
-
return this.setBackgroundColor(
|
|
1854
|
+
setBackground(e) {
|
|
1855
|
+
return this.setBackgroundColor(e), this;
|
|
1844
1856
|
}
|
|
1845
1857
|
/**
|
|
1846
1858
|
* Set rotation for text in current range.
|
|
@@ -1854,12 +1866,12 @@ let _ = class extends ge {
|
|
|
1854
1866
|
* fRange.setTextRotation(45);
|
|
1855
1867
|
* ```
|
|
1856
1868
|
*/
|
|
1857
|
-
setTextRotation(
|
|
1858
|
-
return this._commandService.syncExecuteCommand(
|
|
1869
|
+
setTextRotation(e) {
|
|
1870
|
+
return this._commandService.syncExecuteCommand(bt.id, {
|
|
1859
1871
|
unitId: this._workbook.getUnitId(),
|
|
1860
1872
|
subUnitId: this._worksheet.getSheetId(),
|
|
1861
1873
|
range: this._range,
|
|
1862
|
-
value:
|
|
1874
|
+
value: e
|
|
1863
1875
|
}), this;
|
|
1864
1876
|
}
|
|
1865
1877
|
/**
|
|
@@ -1876,15 +1888,15 @@ let _ = class extends ge {
|
|
|
1876
1888
|
* fRange.setValue({ v: 234, s: { bg: { rgb: '#ff0000' } } });
|
|
1877
1889
|
* ```
|
|
1878
1890
|
*/
|
|
1879
|
-
setValue(
|
|
1880
|
-
const
|
|
1881
|
-
if (!
|
|
1891
|
+
setValue(e) {
|
|
1892
|
+
const t = oe(e);
|
|
1893
|
+
if (!t)
|
|
1882
1894
|
throw new Error("Invalid value");
|
|
1883
|
-
return this._commandService.syncExecuteCommand(
|
|
1895
|
+
return this._commandService.syncExecuteCommand(V.id, {
|
|
1884
1896
|
unitId: this._workbook.getUnitId(),
|
|
1885
1897
|
subUnitId: this._worksheet.getSheetId(),
|
|
1886
1898
|
range: this._range,
|
|
1887
|
-
value:
|
|
1899
|
+
value: t
|
|
1888
1900
|
}), this;
|
|
1889
1901
|
}
|
|
1890
1902
|
/**
|
|
@@ -1901,11 +1913,11 @@ let _ = class extends ge {
|
|
|
1901
1913
|
* fRange.setValueForCell({ v: 234, s: { bg: { rgb: '#ff0000' } } });
|
|
1902
1914
|
* ```
|
|
1903
1915
|
*/
|
|
1904
|
-
setValueForCell(
|
|
1905
|
-
const
|
|
1906
|
-
if (!
|
|
1916
|
+
setValueForCell(e) {
|
|
1917
|
+
const t = oe(e);
|
|
1918
|
+
if (!t)
|
|
1907
1919
|
throw new Error("Invalid value");
|
|
1908
|
-
return this._commandService.syncExecuteCommand(
|
|
1920
|
+
return this._commandService.syncExecuteCommand(V.id, {
|
|
1909
1921
|
unitId: this._workbook.getUnitId(),
|
|
1910
1922
|
subUnitId: this._worksheet.getSheetId(),
|
|
1911
1923
|
range: {
|
|
@@ -1914,7 +1926,7 @@ let _ = class extends ge {
|
|
|
1914
1926
|
endColumn: this._range.startColumn,
|
|
1915
1927
|
endRow: this._range.startRow
|
|
1916
1928
|
},
|
|
1917
|
-
value:
|
|
1929
|
+
value: t
|
|
1918
1930
|
}), this;
|
|
1919
1931
|
}
|
|
1920
1932
|
/**
|
|
@@ -1937,8 +1949,8 @@ let _ = class extends ge {
|
|
|
1937
1949
|
* console.log(fRange.getValue(true).toPlainText()); // Hello World
|
|
1938
1950
|
* ```
|
|
1939
1951
|
*/
|
|
1940
|
-
setRichTextValueForCell(
|
|
1941
|
-
const
|
|
1952
|
+
setRichTextValueForCell(e) {
|
|
1953
|
+
const t = e instanceof N ? e.getData() : e, n = {
|
|
1942
1954
|
unitId: this._workbook.getUnitId(),
|
|
1943
1955
|
subUnitId: this._worksheet.getSheetId(),
|
|
1944
1956
|
range: {
|
|
@@ -1947,9 +1959,9 @@ let _ = class extends ge {
|
|
|
1947
1959
|
endColumn: this._range.startColumn,
|
|
1948
1960
|
endRow: this._range.startRow
|
|
1949
1961
|
},
|
|
1950
|
-
value: { p:
|
|
1962
|
+
value: { p: t }
|
|
1951
1963
|
};
|
|
1952
|
-
return this._commandService.syncExecuteCommand(
|
|
1964
|
+
return this._commandService.syncExecuteCommand(V.id, n), this;
|
|
1953
1965
|
}
|
|
1954
1966
|
/**
|
|
1955
1967
|
* Set the rich text value for the cells in the range.
|
|
@@ -1974,14 +1986,14 @@ let _ = class extends ge {
|
|
|
1974
1986
|
* console.log(fRange.getValue(true).toPlainText()); // Hello World
|
|
1975
1987
|
* ```
|
|
1976
1988
|
*/
|
|
1977
|
-
setRichTextValues(
|
|
1978
|
-
const
|
|
1989
|
+
setRichTextValues(e) {
|
|
1990
|
+
const t = e.map((s) => s.map((o) => o && { p: o instanceof N ? o.getData() : o })), n = ve(t, this._range), r = {
|
|
1979
1991
|
unitId: this._workbook.getUnitId(),
|
|
1980
1992
|
subUnitId: this._worksheet.getSheetId(),
|
|
1981
1993
|
range: this._range,
|
|
1982
|
-
value:
|
|
1994
|
+
value: n
|
|
1983
1995
|
};
|
|
1984
|
-
return this._commandService.syncExecuteCommand(
|
|
1996
|
+
return this._commandService.syncExecuteCommand(V.id, r), this;
|
|
1985
1997
|
}
|
|
1986
1998
|
/**
|
|
1987
1999
|
* Set the cell wrap of the given range.
|
|
@@ -1997,12 +2009,12 @@ let _ = class extends ge {
|
|
|
1997
2009
|
* console.log(fRange.getWrap());
|
|
1998
2010
|
* ```
|
|
1999
2011
|
*/
|
|
2000
|
-
setWrap(
|
|
2001
|
-
return this._commandService.syncExecuteCommand(
|
|
2012
|
+
setWrap(e) {
|
|
2013
|
+
return this._commandService.syncExecuteCommand(he.id, {
|
|
2002
2014
|
unitId: this._workbook.getUnitId(),
|
|
2003
2015
|
subUnitId: this._worksheet.getSheetId(),
|
|
2004
2016
|
range: this._range,
|
|
2005
|
-
value:
|
|
2017
|
+
value: e ? G.WRAP : G.UNSPECIFIED
|
|
2006
2018
|
}), this;
|
|
2007
2019
|
}
|
|
2008
2020
|
/**
|
|
@@ -2018,12 +2030,12 @@ let _ = class extends ge {
|
|
|
2018
2030
|
* console.log(fRange.getWrapStrategy());
|
|
2019
2031
|
* ```
|
|
2020
2032
|
*/
|
|
2021
|
-
setWrapStrategy(
|
|
2022
|
-
return this._commandService.syncExecuteCommand(
|
|
2033
|
+
setWrapStrategy(e) {
|
|
2034
|
+
return this._commandService.syncExecuteCommand(he.id, {
|
|
2023
2035
|
unitId: this._workbook.getUnitId(),
|
|
2024
2036
|
subUnitId: this._worksheet.getSheetId(),
|
|
2025
2037
|
range: this._range,
|
|
2026
|
-
value:
|
|
2038
|
+
value: e
|
|
2027
2039
|
}), this;
|
|
2028
2040
|
}
|
|
2029
2041
|
/**
|
|
@@ -2038,12 +2050,12 @@ let _ = class extends ge {
|
|
|
2038
2050
|
* fRange.setVerticalAlignment('top');
|
|
2039
2051
|
* ```
|
|
2040
2052
|
*/
|
|
2041
|
-
setVerticalAlignment(
|
|
2042
|
-
return this._commandService.syncExecuteCommand(
|
|
2053
|
+
setVerticalAlignment(e) {
|
|
2054
|
+
return this._commandService.syncExecuteCommand(pt.id, {
|
|
2043
2055
|
unitId: this._workbook.getUnitId(),
|
|
2044
2056
|
subUnitId: this._worksheet.getSheetId(),
|
|
2045
2057
|
range: this._range,
|
|
2046
|
-
value:
|
|
2058
|
+
value: Sn(e)
|
|
2047
2059
|
}), this;
|
|
2048
2060
|
}
|
|
2049
2061
|
/**
|
|
@@ -2058,12 +2070,12 @@ let _ = class extends ge {
|
|
|
2058
2070
|
* fRange.setHorizontalAlignment('left');
|
|
2059
2071
|
* ```
|
|
2060
2072
|
*/
|
|
2061
|
-
setHorizontalAlignment(
|
|
2062
|
-
return this._commandService.syncExecuteCommand(
|
|
2073
|
+
setHorizontalAlignment(e) {
|
|
2074
|
+
return this._commandService.syncExecuteCommand(Et.id, {
|
|
2063
2075
|
unitId: this._workbook.getUnitId(),
|
|
2064
2076
|
subUnitId: this._worksheet.getSheetId(),
|
|
2065
2077
|
range: this._range,
|
|
2066
|
-
value:
|
|
2078
|
+
value: wn(e)
|
|
2067
2079
|
}), this;
|
|
2068
2080
|
}
|
|
2069
2081
|
/**
|
|
@@ -2081,13 +2093,13 @@ let _ = class extends ge {
|
|
|
2081
2093
|
* ]);
|
|
2082
2094
|
* ```
|
|
2083
2095
|
*/
|
|
2084
|
-
setValues(
|
|
2085
|
-
const
|
|
2086
|
-
return this._commandService.syncExecuteCommand(
|
|
2096
|
+
setValues(e) {
|
|
2097
|
+
const t = ve(e, this._range);
|
|
2098
|
+
return this._commandService.syncExecuteCommand(V.id, {
|
|
2087
2099
|
unitId: this._workbook.getUnitId(),
|
|
2088
2100
|
subUnitId: this._worksheet.getSheetId(),
|
|
2089
2101
|
range: this._range,
|
|
2090
|
-
value:
|
|
2102
|
+
value: t
|
|
2091
2103
|
}), this;
|
|
2092
2104
|
}
|
|
2093
2105
|
/**
|
|
@@ -2102,26 +2114,26 @@ let _ = class extends ge {
|
|
|
2102
2114
|
* fRange.setFontWeight('bold');
|
|
2103
2115
|
* ```
|
|
2104
2116
|
*/
|
|
2105
|
-
setFontWeight(
|
|
2106
|
-
let
|
|
2107
|
-
if (
|
|
2108
|
-
|
|
2109
|
-
else if (
|
|
2110
|
-
|
|
2111
|
-
else if (
|
|
2112
|
-
|
|
2117
|
+
setFontWeight(e) {
|
|
2118
|
+
let t;
|
|
2119
|
+
if (e === "bold")
|
|
2120
|
+
t = m.TRUE;
|
|
2121
|
+
else if (e === "normal")
|
|
2122
|
+
t = m.FALSE;
|
|
2123
|
+
else if (e === null)
|
|
2124
|
+
t = null;
|
|
2113
2125
|
else
|
|
2114
2126
|
throw new Error("Invalid fontWeight");
|
|
2115
|
-
const
|
|
2127
|
+
const n = {
|
|
2116
2128
|
type: "bl",
|
|
2117
|
-
value:
|
|
2118
|
-
},
|
|
2129
|
+
value: t
|
|
2130
|
+
}, r = {
|
|
2119
2131
|
unitId: this._workbook.getUnitId(),
|
|
2120
2132
|
subUnitId: this._worksheet.getSheetId(),
|
|
2121
2133
|
range: this._range,
|
|
2122
|
-
style:
|
|
2134
|
+
style: n
|
|
2123
2135
|
};
|
|
2124
|
-
return this._commandService.syncExecuteCommand(
|
|
2136
|
+
return this._commandService.syncExecuteCommand(p.id, r), this;
|
|
2125
2137
|
}
|
|
2126
2138
|
/**
|
|
2127
2139
|
* Sets the font style for the given range ('italic' or 'normal').
|
|
@@ -2135,26 +2147,26 @@ let _ = class extends ge {
|
|
|
2135
2147
|
* fRange.setFontStyle('italic');
|
|
2136
2148
|
* ```
|
|
2137
2149
|
*/
|
|
2138
|
-
setFontStyle(
|
|
2139
|
-
let
|
|
2140
|
-
if (
|
|
2141
|
-
|
|
2142
|
-
else if (
|
|
2143
|
-
|
|
2144
|
-
else if (
|
|
2145
|
-
|
|
2150
|
+
setFontStyle(e) {
|
|
2151
|
+
let t;
|
|
2152
|
+
if (e === "italic")
|
|
2153
|
+
t = m.TRUE;
|
|
2154
|
+
else if (e === "normal")
|
|
2155
|
+
t = m.FALSE;
|
|
2156
|
+
else if (e === null)
|
|
2157
|
+
t = null;
|
|
2146
2158
|
else
|
|
2147
2159
|
throw new Error("Invalid fontStyle");
|
|
2148
|
-
const
|
|
2160
|
+
const n = {
|
|
2149
2161
|
type: "it",
|
|
2150
|
-
value:
|
|
2151
|
-
},
|
|
2162
|
+
value: t
|
|
2163
|
+
}, r = {
|
|
2152
2164
|
unitId: this._workbook.getUnitId(),
|
|
2153
2165
|
subUnitId: this._worksheet.getSheetId(),
|
|
2154
2166
|
range: this._range,
|
|
2155
|
-
style:
|
|
2167
|
+
style: n
|
|
2156
2168
|
};
|
|
2157
|
-
return this._commandService.syncExecuteCommand(
|
|
2169
|
+
return this._commandService.syncExecuteCommand(p.id, r), this;
|
|
2158
2170
|
}
|
|
2159
2171
|
/**
|
|
2160
2172
|
* Sets the font line style of the given range ('underline', 'line-through', or 'none').
|
|
@@ -2168,22 +2180,22 @@ let _ = class extends ge {
|
|
|
2168
2180
|
* fRange.setFontLine('underline');
|
|
2169
2181
|
* ```
|
|
2170
2182
|
*/
|
|
2171
|
-
setFontLine(
|
|
2172
|
-
if (
|
|
2183
|
+
setFontLine(e) {
|
|
2184
|
+
if (e === "underline")
|
|
2173
2185
|
this._setFontUnderline({
|
|
2174
|
-
s:
|
|
2186
|
+
s: m.TRUE
|
|
2175
2187
|
});
|
|
2176
|
-
else if (
|
|
2188
|
+
else if (e === "line-through")
|
|
2177
2189
|
this._setFontStrikethrough({
|
|
2178
|
-
s:
|
|
2190
|
+
s: m.TRUE
|
|
2179
2191
|
});
|
|
2180
|
-
else if (
|
|
2192
|
+
else if (e === "none")
|
|
2181
2193
|
this._setFontUnderline({
|
|
2182
|
-
s:
|
|
2194
|
+
s: m.FALSE
|
|
2183
2195
|
}), this._setFontStrikethrough({
|
|
2184
|
-
s:
|
|
2196
|
+
s: m.FALSE
|
|
2185
2197
|
});
|
|
2186
|
-
else if (
|
|
2198
|
+
else if (e === null)
|
|
2187
2199
|
this._setFontUnderline(null), this._setFontStrikethrough(null);
|
|
2188
2200
|
else
|
|
2189
2201
|
throw new Error("Invalid fontLine");
|
|
@@ -2194,34 +2206,34 @@ let _ = class extends ge {
|
|
|
2194
2206
|
* @param {ITextDecoration|null} value The font underline style of the given ITextDecoration; a null value resets the font underline style
|
|
2195
2207
|
* @returns {void}
|
|
2196
2208
|
*/
|
|
2197
|
-
_setFontUnderline(
|
|
2198
|
-
const
|
|
2209
|
+
_setFontUnderline(e) {
|
|
2210
|
+
const t = {
|
|
2199
2211
|
type: "ul",
|
|
2200
|
-
value:
|
|
2201
|
-
},
|
|
2212
|
+
value: e
|
|
2213
|
+
}, n = {
|
|
2202
2214
|
unitId: this._workbook.getUnitId(),
|
|
2203
2215
|
subUnitId: this._worksheet.getSheetId(),
|
|
2204
2216
|
range: this._range,
|
|
2205
|
-
style:
|
|
2217
|
+
style: t
|
|
2206
2218
|
};
|
|
2207
|
-
this._commandService.syncExecuteCommand(
|
|
2219
|
+
this._commandService.syncExecuteCommand(p.id, n);
|
|
2208
2220
|
}
|
|
2209
2221
|
/**
|
|
2210
2222
|
* Sets the font strikethrough style of the given ITextDecoration
|
|
2211
2223
|
* @param {ITextDecoration|null} value The font strikethrough style of the given ITextDecoration; a null value resets the font strikethrough style
|
|
2212
2224
|
* @returns {void}
|
|
2213
2225
|
*/
|
|
2214
|
-
_setFontStrikethrough(
|
|
2215
|
-
const
|
|
2226
|
+
_setFontStrikethrough(e) {
|
|
2227
|
+
const t = {
|
|
2216
2228
|
type: "st",
|
|
2217
|
-
value:
|
|
2218
|
-
},
|
|
2229
|
+
value: e
|
|
2230
|
+
}, n = {
|
|
2219
2231
|
unitId: this._workbook.getUnitId(),
|
|
2220
2232
|
subUnitId: this._worksheet.getSheetId(),
|
|
2221
2233
|
range: this._range,
|
|
2222
|
-
style:
|
|
2234
|
+
style: t
|
|
2223
2235
|
};
|
|
2224
|
-
this._commandService.syncExecuteCommand(
|
|
2236
|
+
this._commandService.syncExecuteCommand(p.id, n);
|
|
2225
2237
|
}
|
|
2226
2238
|
/**
|
|
2227
2239
|
* Sets the font family, such as "Arial" or "Helvetica".
|
|
@@ -2235,17 +2247,17 @@ let _ = class extends ge {
|
|
|
2235
2247
|
* fRange.setFontFamily('Arial');
|
|
2236
2248
|
* ```
|
|
2237
2249
|
*/
|
|
2238
|
-
setFontFamily(
|
|
2239
|
-
const
|
|
2250
|
+
setFontFamily(e) {
|
|
2251
|
+
const t = {
|
|
2240
2252
|
type: "ff",
|
|
2241
|
-
value:
|
|
2242
|
-
},
|
|
2253
|
+
value: e
|
|
2254
|
+
}, n = {
|
|
2243
2255
|
unitId: this._workbook.getUnitId(),
|
|
2244
2256
|
subUnitId: this._worksheet.getSheetId(),
|
|
2245
2257
|
range: this._range,
|
|
2246
|
-
style:
|
|
2258
|
+
style: t
|
|
2247
2259
|
};
|
|
2248
|
-
return this._commandService.syncExecuteCommand(
|
|
2260
|
+
return this._commandService.syncExecuteCommand(p.id, n), this;
|
|
2249
2261
|
}
|
|
2250
2262
|
/**
|
|
2251
2263
|
* Sets the font size, with the size being the point size to use.
|
|
@@ -2259,17 +2271,17 @@ let _ = class extends ge {
|
|
|
2259
2271
|
* fRange.setFontSize(24);
|
|
2260
2272
|
* ```
|
|
2261
2273
|
*/
|
|
2262
|
-
setFontSize(
|
|
2263
|
-
const
|
|
2274
|
+
setFontSize(e) {
|
|
2275
|
+
const t = {
|
|
2264
2276
|
type: "fs",
|
|
2265
|
-
value:
|
|
2266
|
-
},
|
|
2277
|
+
value: e
|
|
2278
|
+
}, n = {
|
|
2267
2279
|
unitId: this._workbook.getUnitId(),
|
|
2268
2280
|
subUnitId: this._worksheet.getSheetId(),
|
|
2269
2281
|
range: this._range,
|
|
2270
|
-
style:
|
|
2282
|
+
style: t
|
|
2271
2283
|
};
|
|
2272
|
-
return this._commandService.syncExecuteCommand(
|
|
2284
|
+
return this._commandService.syncExecuteCommand(p.id, n), this;
|
|
2273
2285
|
}
|
|
2274
2286
|
/**
|
|
2275
2287
|
* Sets the font color in CSS notation (such as '#ffffff' or 'white').
|
|
@@ -2283,17 +2295,17 @@ let _ = class extends ge {
|
|
|
2283
2295
|
* fRange.setFontColor('#ff0000');
|
|
2284
2296
|
* ```
|
|
2285
2297
|
*/
|
|
2286
|
-
setFontColor(
|
|
2287
|
-
const
|
|
2298
|
+
setFontColor(e) {
|
|
2299
|
+
const n = {
|
|
2288
2300
|
type: "cl",
|
|
2289
|
-
value:
|
|
2290
|
-
},
|
|
2301
|
+
value: e === null ? null : { rgb: e }
|
|
2302
|
+
}, r = {
|
|
2291
2303
|
unitId: this._workbook.getUnitId(),
|
|
2292
2304
|
subUnitId: this._worksheet.getSheetId(),
|
|
2293
2305
|
range: this._range,
|
|
2294
|
-
style:
|
|
2306
|
+
style: n
|
|
2295
2307
|
};
|
|
2296
|
-
return this._commandService.syncExecuteCommand(
|
|
2308
|
+
return this._commandService.syncExecuteCommand(p.id, r), this;
|
|
2297
2309
|
}
|
|
2298
2310
|
// #endregion editing
|
|
2299
2311
|
//#region Merge cell
|
|
@@ -2310,9 +2322,9 @@ let _ = class extends ge {
|
|
|
2310
2322
|
* console.log(fRange.isMerged());
|
|
2311
2323
|
* ```
|
|
2312
2324
|
*/
|
|
2313
|
-
merge(
|
|
2314
|
-
const
|
|
2315
|
-
return
|
|
2325
|
+
merge(e = !0) {
|
|
2326
|
+
const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId();
|
|
2327
|
+
return Z(this._injector, t, n, [this._range], e), this;
|
|
2316
2328
|
}
|
|
2317
2329
|
/**
|
|
2318
2330
|
* Merges cells in a range horizontally.
|
|
@@ -2332,9 +2344,9 @@ let _ = class extends ge {
|
|
|
2332
2344
|
* });
|
|
2333
2345
|
* ```
|
|
2334
2346
|
*/
|
|
2335
|
-
mergeAcross(
|
|
2336
|
-
const
|
|
2337
|
-
return
|
|
2347
|
+
mergeAcross(e = !0) {
|
|
2348
|
+
const t = be([this._range], T.ROWS), n = this._workbook.getUnitId(), r = this._worksheet.getSheetId();
|
|
2349
|
+
return Z(this._injector, n, r, t, e), this;
|
|
2338
2350
|
}
|
|
2339
2351
|
/**
|
|
2340
2352
|
* Merges cells in a range vertically.
|
|
@@ -2354,9 +2366,9 @@ let _ = class extends ge {
|
|
|
2354
2366
|
* });
|
|
2355
2367
|
* ```
|
|
2356
2368
|
*/
|
|
2357
|
-
mergeVertically(
|
|
2358
|
-
const
|
|
2359
|
-
return
|
|
2369
|
+
mergeVertically(e = !0) {
|
|
2370
|
+
const t = be([this._range], T.COLUMNS), n = this._workbook.getUnitId(), r = this._worksheet.getSheetId();
|
|
2371
|
+
return Z(this._injector, n, r, t, e), this;
|
|
2360
2372
|
}
|
|
2361
2373
|
/**
|
|
2362
2374
|
* Returns true if cells in the current range overlap a merged cell.
|
|
@@ -2372,8 +2384,8 @@ let _ = class extends ge {
|
|
|
2372
2384
|
* ```
|
|
2373
2385
|
*/
|
|
2374
2386
|
isPartOfMerge() {
|
|
2375
|
-
const { startRow:
|
|
2376
|
-
return this._worksheet.getMergedCellRange(
|
|
2387
|
+
const { startRow: e, startColumn: t, endRow: n, endColumn: r } = this._range;
|
|
2388
|
+
return this._worksheet.getMergedCellRange(e, t, n, r).length > 0;
|
|
2377
2389
|
}
|
|
2378
2390
|
/**
|
|
2379
2391
|
* Break all horizontally- or vertically-merged cells contained within the range list into individual cells again.
|
|
@@ -2391,7 +2403,7 @@ let _ = class extends ge {
|
|
|
2391
2403
|
* ```
|
|
2392
2404
|
*/
|
|
2393
2405
|
breakApart() {
|
|
2394
|
-
return this._commandService.syncExecuteCommand(
|
|
2406
|
+
return this._commandService.syncExecuteCommand(yt.id, { ranges: [this._range] }), this;
|
|
2395
2407
|
}
|
|
2396
2408
|
//#endregion
|
|
2397
2409
|
/**
|
|
@@ -2409,10 +2421,10 @@ let _ = class extends ge {
|
|
|
2409
2421
|
* });
|
|
2410
2422
|
* ```
|
|
2411
2423
|
*/
|
|
2412
|
-
forEach(
|
|
2413
|
-
const { startColumn:
|
|
2414
|
-
this._worksheet.getMatrixWithMergedCells(
|
|
2415
|
-
|
|
2424
|
+
forEach(e) {
|
|
2425
|
+
const { startColumn: t, startRow: n, endColumn: r, endRow: s } = this._range;
|
|
2426
|
+
this._worksheet.getMatrixWithMergedCells(n, t, s, r).forValue((o, i, h) => {
|
|
2427
|
+
e(o, i, h);
|
|
2416
2428
|
});
|
|
2417
2429
|
}
|
|
2418
2430
|
/**
|
|
@@ -2447,13 +2459,13 @@ let _ = class extends ge {
|
|
|
2447
2459
|
* console.log(fRange.getA1Notation(true, univerAPI.Enum.AbsoluteRefType.ALL, univerAPI.Enum.AbsoluteRefType.ALL)); // Sheet1!$A$1:$B$2
|
|
2448
2460
|
* ```
|
|
2449
2461
|
*/
|
|
2450
|
-
getA1Notation(
|
|
2451
|
-
const
|
|
2462
|
+
getA1Notation(e, t, n) {
|
|
2463
|
+
const r = {
|
|
2452
2464
|
...this._range,
|
|
2453
|
-
startAbsoluteRefType:
|
|
2454
|
-
endAbsoluteRefType:
|
|
2465
|
+
startAbsoluteRefType: t,
|
|
2466
|
+
endAbsoluteRefType: n
|
|
2455
2467
|
};
|
|
2456
|
-
return
|
|
2468
|
+
return e ? dn(this._worksheet.getName(), r) : we(r);
|
|
2457
2469
|
}
|
|
2458
2470
|
/**
|
|
2459
2471
|
* Sets the specified range as the active range, with the top left cell in the range as the current cell.
|
|
@@ -2502,24 +2514,24 @@ let _ = class extends ge {
|
|
|
2502
2514
|
* ```
|
|
2503
2515
|
*/
|
|
2504
2516
|
activateAsCurrentCell() {
|
|
2505
|
-
const
|
|
2506
|
-
if (
|
|
2507
|
-
const
|
|
2508
|
-
if (!
|
|
2517
|
+
const e = this._worksheet.getMergedCell(this._range.startRow, this._range.startColumn);
|
|
2518
|
+
if (e && x.equals(e, this._range) || !e && this._range.startRow === this._range.endRow && this._range.startColumn === this._range.endColumn) {
|
|
2519
|
+
const r = this._injector.createInstance(C, this._workbook).getActiveRange();
|
|
2520
|
+
if (!r || r.getUnitId() !== this.getUnitId() || r.getSheetId() !== this.getSheetId())
|
|
2509
2521
|
return this.activate();
|
|
2510
|
-
if (
|
|
2522
|
+
if (x.contains(r.getRange(), this._range)) {
|
|
2511
2523
|
const s = {
|
|
2512
2524
|
unitId: this.getUnitId(),
|
|
2513
2525
|
subUnitId: this.getSheetId(),
|
|
2514
2526
|
selections: [
|
|
2515
2527
|
{
|
|
2516
|
-
range:
|
|
2517
|
-
primary:
|
|
2528
|
+
range: r.getRange(),
|
|
2529
|
+
primary: $(this.getRange(), this._worksheet),
|
|
2518
2530
|
style: null
|
|
2519
2531
|
}
|
|
2520
2532
|
]
|
|
2521
2533
|
};
|
|
2522
|
-
return this._commandService.syncExecuteCommand(
|
|
2534
|
+
return this._commandService.syncExecuteCommand(ke.id, s), this;
|
|
2523
2535
|
}
|
|
2524
2536
|
return this.activate();
|
|
2525
2537
|
} else
|
|
@@ -2559,14 +2571,14 @@ let _ = class extends ge {
|
|
|
2559
2571
|
* fRange.splitTextToColumns(true, univerAPI.Enum.SplitDelimiterType.Custom, '#');
|
|
2560
2572
|
* ```
|
|
2561
2573
|
*/
|
|
2562
|
-
splitTextToColumns(
|
|
2563
|
-
this._commandService.syncExecuteCommand(
|
|
2574
|
+
splitTextToColumns(e, t, n) {
|
|
2575
|
+
this._commandService.syncExecuteCommand(Ut.id, {
|
|
2564
2576
|
unitId: this._workbook.getUnitId(),
|
|
2565
2577
|
subUnitId: this._worksheet.getSheetId(),
|
|
2566
2578
|
range: this._range,
|
|
2567
|
-
delimiter:
|
|
2568
|
-
customDelimiter:
|
|
2569
|
-
treatMultipleDelimitersAsOne:
|
|
2579
|
+
delimiter: t,
|
|
2580
|
+
customDelimiter: n,
|
|
2581
|
+
treatMultipleDelimitersAsOne: e
|
|
2570
2582
|
});
|
|
2571
2583
|
}
|
|
2572
2584
|
/**
|
|
@@ -2580,16 +2592,16 @@ let _ = class extends ge {
|
|
|
2580
2592
|
* fRange.useThemeStyle('default');
|
|
2581
2593
|
* ```
|
|
2582
2594
|
*/
|
|
2583
|
-
useThemeStyle(
|
|
2584
|
-
if (
|
|
2585
|
-
const
|
|
2586
|
-
|
|
2595
|
+
useThemeStyle(e) {
|
|
2596
|
+
if (e == null) {
|
|
2597
|
+
const t = this.getUsedThemeStyle();
|
|
2598
|
+
t && this.removeThemeStyle(t);
|
|
2587
2599
|
} else
|
|
2588
|
-
this._commandService.syncExecuteCommand(
|
|
2600
|
+
this._commandService.syncExecuteCommand(Pt.id, {
|
|
2589
2601
|
unitId: this._workbook.getUnitId(),
|
|
2590
2602
|
subUnitId: this._worksheet.getSheetId(),
|
|
2591
2603
|
range: this._range,
|
|
2592
|
-
themeName:
|
|
2604
|
+
themeName: e
|
|
2593
2605
|
});
|
|
2594
2606
|
}
|
|
2595
2607
|
/**
|
|
@@ -2603,12 +2615,12 @@ let _ = class extends ge {
|
|
|
2603
2615
|
* fRange.removeThemeStyle('default');
|
|
2604
2616
|
* ```
|
|
2605
2617
|
*/
|
|
2606
|
-
removeThemeStyle(
|
|
2607
|
-
this._commandService.syncExecuteCommand(
|
|
2618
|
+
removeThemeStyle(e) {
|
|
2619
|
+
this._commandService.syncExecuteCommand(xt.id, {
|
|
2608
2620
|
unitId: this._workbook.getUnitId(),
|
|
2609
2621
|
subUnitId: this._worksheet.getSheetId(),
|
|
2610
2622
|
range: this._range,
|
|
2611
|
-
themeName:
|
|
2623
|
+
themeName: e
|
|
2612
2624
|
});
|
|
2613
2625
|
}
|
|
2614
2626
|
/**
|
|
@@ -2625,7 +2637,7 @@ let _ = class extends ge {
|
|
|
2625
2637
|
* ```
|
|
2626
2638
|
*/
|
|
2627
2639
|
getUsedThemeStyle() {
|
|
2628
|
-
return this._injector.get(
|
|
2640
|
+
return this._injector.get(Qe).getAppliedRangeThemeStyle({
|
|
2629
2641
|
unitId: this._workbook.getUnitId(),
|
|
2630
2642
|
subUnitId: this._worksheet.getSheetId(),
|
|
2631
2643
|
range: this._range
|
|
@@ -2650,12 +2662,12 @@ let _ = class extends ge {
|
|
|
2650
2662
|
* fRange.clear({ contentsOnly: true });
|
|
2651
2663
|
* ```
|
|
2652
2664
|
*/
|
|
2653
|
-
clear(
|
|
2654
|
-
return
|
|
2665
|
+
clear(e) {
|
|
2666
|
+
return e && e.contentsOnly && !e.formatOnly ? this.clearContent() : e && e.formatOnly && !e.contentsOnly ? this.clearFormat() : (this._commandService.syncExecuteCommand(Xe.id, {
|
|
2655
2667
|
unitId: this._workbook.getUnitId(),
|
|
2656
2668
|
subUnitId: this._worksheet.getSheetId(),
|
|
2657
2669
|
ranges: [this._range],
|
|
2658
|
-
options:
|
|
2670
|
+
options: e
|
|
2659
2671
|
}), this);
|
|
2660
2672
|
}
|
|
2661
2673
|
/**
|
|
@@ -2672,7 +2684,7 @@ let _ = class extends ge {
|
|
|
2672
2684
|
* ```
|
|
2673
2685
|
*/
|
|
2674
2686
|
clearContent() {
|
|
2675
|
-
return this._commandService.syncExecuteCommand(
|
|
2687
|
+
return this._commandService.syncExecuteCommand(Ze.id, {
|
|
2676
2688
|
unitId: this._workbook.getUnitId(),
|
|
2677
2689
|
subUnitId: this._worksheet.getSheetId(),
|
|
2678
2690
|
ranges: [this._range]
|
|
@@ -2691,7 +2703,7 @@ let _ = class extends ge {
|
|
|
2691
2703
|
* ```
|
|
2692
2704
|
*/
|
|
2693
2705
|
clearFormat() {
|
|
2694
|
-
return this._commandService.syncExecuteCommand(
|
|
2706
|
+
return this._commandService.syncExecuteCommand(et.id, {
|
|
2695
2707
|
unitId: this._workbook.getUnitId(),
|
|
2696
2708
|
subUnitId: this._worksheet.getSheetId(),
|
|
2697
2709
|
ranges: [this._range]
|
|
@@ -2752,10 +2764,10 @@ let _ = class extends ge {
|
|
|
2752
2764
|
* console.log(fWorksheet.getRange('A1:D5').getValues()); // [[null, null, 3, 4], [null, null, 4, 5], [1, 2, 5, 6], [2, 3, 6, 7], [3, 4, 7, 8]]
|
|
2753
2765
|
* ```
|
|
2754
2766
|
*/
|
|
2755
|
-
insertCells(
|
|
2756
|
-
|
|
2767
|
+
insertCells(e) {
|
|
2768
|
+
e === T.ROWS ? this._commandService.executeCommand(Mt.id, {
|
|
2757
2769
|
range: this._range
|
|
2758
|
-
}) : this._commandService.executeCommand(
|
|
2770
|
+
}) : this._commandService.executeCommand(Nt.id, {
|
|
2759
2771
|
range: this._range
|
|
2760
2772
|
});
|
|
2761
2773
|
}
|
|
@@ -2814,10 +2826,10 @@ let _ = class extends ge {
|
|
|
2814
2826
|
* console.log(fWorksheet.getRange('A1:D5').getValues()); // [[3, 4, 3, 4], [4, 5, 4, 5], [5, 6, 5, 6], [null, null, 6, 7], [null, null, 7, 8]]
|
|
2815
2827
|
* ```
|
|
2816
2828
|
*/
|
|
2817
|
-
deleteCells(
|
|
2818
|
-
|
|
2829
|
+
deleteCells(e) {
|
|
2830
|
+
e === T.ROWS ? this._commandService.executeCommand(Tt.id, {
|
|
2819
2831
|
range: this._range
|
|
2820
|
-
}) : this._commandService.executeCommand(
|
|
2832
|
+
}) : this._commandService.executeCommand(At.id, {
|
|
2821
2833
|
range: this._range
|
|
2822
2834
|
});
|
|
2823
2835
|
}
|
|
@@ -2858,25 +2870,25 @@ let _ = class extends ge {
|
|
|
2858
2870
|
* ```
|
|
2859
2871
|
*/
|
|
2860
2872
|
// eslint-disable-next-line complexity
|
|
2861
|
-
getDataRegion(
|
|
2862
|
-
const { startRow:
|
|
2863
|
-
let
|
|
2864
|
-
if (
|
|
2865
|
-
let
|
|
2866
|
-
for (let v =
|
|
2873
|
+
getDataRegion(e) {
|
|
2874
|
+
const { startRow: t, startColumn: n, endRow: r, endColumn: s } = this._range, o = this._worksheet.getMaxRows(), i = this._worksheet.getMaxColumns(), h = this._worksheet.getCellMatrix();
|
|
2875
|
+
let d = t, c = n, l = r, u = s;
|
|
2876
|
+
if (e !== T.COLUMNS) {
|
|
2877
|
+
let y = !1, U = !1;
|
|
2878
|
+
for (let v = n; v <= s && (t > 0 && !B(h.getValue(t - 1, v)) && (y = !0), r < o - 1 && !B(h.getValue(r + 1, v)) && (U = !0), !(y && U)); v++)
|
|
2867
2879
|
;
|
|
2868
|
-
|
|
2880
|
+
y && (d = t - 1), U && (l = r + 1);
|
|
2869
2881
|
}
|
|
2870
|
-
if (
|
|
2871
|
-
let
|
|
2872
|
-
for (let v =
|
|
2882
|
+
if (e !== T.ROWS) {
|
|
2883
|
+
let y = !1, U = !1;
|
|
2884
|
+
for (let v = t; v <= r && (n > 0 && !B(h.getValue(v, n - 1)) && (y = !0), s < i - 1 && !B(h.getValue(v, s + 1)) && (U = !0), !(y && U)); v++)
|
|
2873
2885
|
;
|
|
2874
|
-
|
|
2886
|
+
y && (c = n - 1), U && (u = s + 1);
|
|
2875
2887
|
}
|
|
2876
|
-
return this._injector.createInstance(
|
|
2877
|
-
startRow:
|
|
2878
|
-
startColumn:
|
|
2879
|
-
endRow:
|
|
2888
|
+
return this._injector.createInstance(k, this._workbook, this._worksheet, {
|
|
2889
|
+
startRow: d,
|
|
2890
|
+
startColumn: c,
|
|
2891
|
+
endRow: l,
|
|
2880
2892
|
endColumn: u
|
|
2881
2893
|
});
|
|
2882
2894
|
}
|
|
@@ -2897,11 +2909,11 @@ let _ = class extends ge {
|
|
|
2897
2909
|
* ```
|
|
2898
2910
|
*/
|
|
2899
2911
|
isBlank() {
|
|
2900
|
-
const
|
|
2912
|
+
const e = this._worksheet.getCellMatrix(), { startRow: t, startColumn: n, endRow: r, endColumn: s } = this._range;
|
|
2901
2913
|
let o = !0;
|
|
2902
|
-
for (let i =
|
|
2903
|
-
for (let
|
|
2904
|
-
if (!
|
|
2914
|
+
for (let i = t; i <= r; i++) {
|
|
2915
|
+
for (let h = n; h <= s; h++)
|
|
2916
|
+
if (!B(e.getValue(i, h))) {
|
|
2905
2917
|
o = !1;
|
|
2906
2918
|
break;
|
|
2907
2919
|
}
|
|
@@ -2929,14 +2941,14 @@ let _ = class extends ge {
|
|
|
2929
2941
|
* console.log(newRange.getA1Notation()); // B2:D4
|
|
2930
2942
|
* ```
|
|
2931
2943
|
*/
|
|
2932
|
-
offset(
|
|
2933
|
-
const { startRow: s, startColumn: o, endRow: i, endColumn:
|
|
2934
|
-
if (
|
|
2944
|
+
offset(e, t, n, r) {
|
|
2945
|
+
const { startRow: s, startColumn: o, endRow: i, endColumn: h } = this._range, d = s + e, c = o + t, l = n ? d + n - 1 : i + e, u = r ? c + r - 1 : h + t;
|
|
2946
|
+
if (d < 0 || c < 0 || l < 0 || u < 0)
|
|
2935
2947
|
throw new Error("The row or column index is out of range");
|
|
2936
|
-
return this._injector.createInstance(
|
|
2937
|
-
startRow:
|
|
2938
|
-
startColumn:
|
|
2939
|
-
endRow:
|
|
2948
|
+
return this._injector.createInstance(k, this._workbook, this._worksheet, {
|
|
2949
|
+
startRow: d,
|
|
2950
|
+
startColumn: c,
|
|
2951
|
+
endRow: l,
|
|
2940
2952
|
endColumn: u
|
|
2941
2953
|
});
|
|
2942
2954
|
}
|
|
@@ -2953,9 +2965,9 @@ let _ = class extends ge {
|
|
|
2953
2965
|
* console.log(fRange.getFormula()); // '=SUM(A2:A5)'
|
|
2954
2966
|
* ```
|
|
2955
2967
|
*/
|
|
2956
|
-
setFormula(
|
|
2968
|
+
setFormula(e) {
|
|
2957
2969
|
return this.setValue({
|
|
2958
|
-
f:
|
|
2970
|
+
f: e
|
|
2959
2971
|
});
|
|
2960
2972
|
}
|
|
2961
2973
|
/**
|
|
@@ -2974,23 +2986,23 @@ let _ = class extends ge {
|
|
|
2974
2986
|
* console.log(fRange.getFormulas()); // [['=SUM(A2:A5)', '=SUM(B2:B5)'], ['=SUM(A6:A9)', '=SUM(B6:B9)']]
|
|
2975
2987
|
* ```
|
|
2976
2988
|
*/
|
|
2977
|
-
setFormulas(
|
|
2978
|
-
return this.setValues(
|
|
2989
|
+
setFormulas(e) {
|
|
2990
|
+
return this.setValues(e.map((t) => t.map((n) => ({ f: n }))));
|
|
2979
2991
|
}
|
|
2980
|
-
};
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
],
|
|
2986
|
-
var
|
|
2987
|
-
for (var
|
|
2988
|
-
(
|
|
2989
|
-
return
|
|
2990
|
-
},
|
|
2991
|
-
let
|
|
2992
|
-
constructor(
|
|
2993
|
-
this._workbook =
|
|
2992
|
+
}, W._enableManualInit(), W);
|
|
2993
|
+
k = vn([
|
|
2994
|
+
se(3, g(M)),
|
|
2995
|
+
se(4, _),
|
|
2996
|
+
se(5, g(cn))
|
|
2997
|
+
], k);
|
|
2998
|
+
var fn = Object.getOwnPropertyDescriptor, In = (a, e, t, n) => {
|
|
2999
|
+
for (var r = n > 1 ? void 0 : n ? fn(e, t) : e, s = a.length - 1, o; s >= 0; s--)
|
|
3000
|
+
(o = a[s]) && (r = o(r) || r);
|
|
3001
|
+
return r;
|
|
3002
|
+
}, Rn = (a, e) => (t, n) => e(t, n, a);
|
|
3003
|
+
let J = class {
|
|
3004
|
+
constructor(a, e, t, n) {
|
|
3005
|
+
this._workbook = a, this._worksheet = e, this._selections = t, this._injector = n;
|
|
2994
3006
|
}
|
|
2995
3007
|
/**
|
|
2996
3008
|
* Represents the active selection in the sheet. Which means the selection contains the active cell.
|
|
@@ -3006,8 +3018,8 @@ let K = class {
|
|
|
3006
3018
|
* ```
|
|
3007
3019
|
*/
|
|
3008
3020
|
getActiveRange() {
|
|
3009
|
-
const
|
|
3010
|
-
return
|
|
3021
|
+
const a = this._selections.find((e) => !!e.primary);
|
|
3022
|
+
return a ? this._injector.createInstance(k, this._workbook, this._worksheet, a.range) : null;
|
|
3011
3023
|
}
|
|
3012
3024
|
/**
|
|
3013
3025
|
* Represents the active selection list in the sheet.
|
|
@@ -3024,7 +3036,7 @@ let K = class {
|
|
|
3024
3036
|
* ```
|
|
3025
3037
|
*/
|
|
3026
3038
|
getActiveRangeList() {
|
|
3027
|
-
return this._selections.map((
|
|
3039
|
+
return this._selections.map((a) => this._injector.createInstance(k, this._workbook, this._worksheet, a.range));
|
|
3028
3040
|
}
|
|
3029
3041
|
/**
|
|
3030
3042
|
* Represents the current select cell in the sheet.
|
|
@@ -3043,8 +3055,8 @@ let K = class {
|
|
|
3043
3055
|
* ```
|
|
3044
3056
|
*/
|
|
3045
3057
|
getCurrentCell() {
|
|
3046
|
-
const
|
|
3047
|
-
return
|
|
3058
|
+
const a = this._selections.find((e) => !!e.primary);
|
|
3059
|
+
return a ? a.primary : null;
|
|
3048
3060
|
}
|
|
3049
3061
|
/**
|
|
3050
3062
|
* Returns the active sheet in the spreadsheet.
|
|
@@ -3059,8 +3071,8 @@ let K = class {
|
|
|
3059
3071
|
* ```
|
|
3060
3072
|
*/
|
|
3061
3073
|
getActiveSheet() {
|
|
3062
|
-
const
|
|
3063
|
-
return this._injector.createInstance(S,
|
|
3074
|
+
const a = this._injector.createInstance(C, this._workbook);
|
|
3075
|
+
return this._injector.createInstance(S, a, this._workbook, this._worksheet);
|
|
3064
3076
|
}
|
|
3065
3077
|
/**
|
|
3066
3078
|
* Update the primary cell in the selection. if the primary cell not exists in selections, add it to the selections and clear the old selections.
|
|
@@ -3083,31 +3095,31 @@ let K = class {
|
|
|
3083
3095
|
* console.log(`actualRow: ${actualRow}, actualColumn: ${actualColumn}`); // actualRow: 10, actualColumn: 1
|
|
3084
3096
|
* ```
|
|
3085
3097
|
*/
|
|
3086
|
-
updatePrimaryCell(
|
|
3087
|
-
const e = this._injector.get(
|
|
3098
|
+
updatePrimaryCell(a) {
|
|
3099
|
+
const e = this._injector.get(_);
|
|
3088
3100
|
let t = [], n = !1;
|
|
3089
|
-
for (const { range:
|
|
3090
|
-
|
|
3091
|
-
range:
|
|
3092
|
-
primary:
|
|
3093
|
-
style:
|
|
3101
|
+
for (const { range: s, style: o } of this._selections)
|
|
3102
|
+
x.contains(s, a.getRange()) ? (t.push({
|
|
3103
|
+
range: s,
|
|
3104
|
+
primary: $(a.getRange(), this._worksheet),
|
|
3105
|
+
style: o
|
|
3094
3106
|
}), n = !0) : t.push({
|
|
3095
|
-
range:
|
|
3107
|
+
range: s,
|
|
3096
3108
|
primary: null,
|
|
3097
|
-
style:
|
|
3109
|
+
style: o
|
|
3098
3110
|
});
|
|
3099
3111
|
n || (t = [
|
|
3100
3112
|
{
|
|
3101
|
-
range:
|
|
3102
|
-
primary:
|
|
3113
|
+
range: a.getRange(),
|
|
3114
|
+
primary: $(a.getRange(), this._worksheet)
|
|
3103
3115
|
}
|
|
3104
3116
|
]);
|
|
3105
|
-
const
|
|
3117
|
+
const r = {
|
|
3106
3118
|
unitId: this._workbook.getUnitId(),
|
|
3107
3119
|
subUnitId: this._worksheet.getSheetId(),
|
|
3108
3120
|
selections: t
|
|
3109
3121
|
};
|
|
3110
|
-
return e.syncExecuteCommand(
|
|
3122
|
+
return e.syncExecuteCommand(ke.id, r), new J(this._workbook, this._worksheet, t, this._injector);
|
|
3111
3123
|
}
|
|
3112
3124
|
/**
|
|
3113
3125
|
* Get the next primary cell in the specified direction. If the primary cell not exists in selections, return null.
|
|
@@ -3134,22 +3146,22 @@ let K = class {
|
|
|
3134
3146
|
* console.log(nextCell2?.getA1Notation()); // A2
|
|
3135
3147
|
* ```
|
|
3136
3148
|
*/
|
|
3137
|
-
getNextDataRange(
|
|
3149
|
+
getNextDataRange(a) {
|
|
3138
3150
|
if (!this._selections.find((n) => !!n.primary))
|
|
3139
3151
|
return null;
|
|
3140
|
-
const t =
|
|
3141
|
-
return t ? this._injector.createInstance(
|
|
3152
|
+
const t = Dt(this._selections.concat(), a, this._worksheet);
|
|
3153
|
+
return t ? this._injector.createInstance(k, this._workbook, this._worksheet, t) : null;
|
|
3142
3154
|
}
|
|
3143
3155
|
};
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
],
|
|
3147
|
-
var
|
|
3148
|
-
for (var
|
|
3149
|
-
(
|
|
3150
|
-
return
|
|
3151
|
-
},
|
|
3152
|
-
let S = class extends
|
|
3156
|
+
J = In([
|
|
3157
|
+
Rn(3, g(M))
|
|
3158
|
+
], J);
|
|
3159
|
+
var bn = Object.getOwnPropertyDescriptor, pn = (a, e, t, n) => {
|
|
3160
|
+
for (var r = n > 1 ? void 0 : n ? bn(e, t) : e, s = a.length - 1, o; s >= 0; s--)
|
|
3161
|
+
(o = a[s]) && (r = o(r) || r);
|
|
3162
|
+
return r;
|
|
3163
|
+
}, z = (a, e) => (t, n) => e(t, n, a);
|
|
3164
|
+
let S = class extends _e {
|
|
3153
3165
|
/**
|
|
3154
3166
|
* Creates a new worksheet facade instance
|
|
3155
3167
|
* @param {FWorkbook} _fWorkbook - The facade workbook instance
|
|
@@ -3160,8 +3172,8 @@ let S = class extends ge {
|
|
|
3160
3172
|
* @param {ILogService} _logService - The log service
|
|
3161
3173
|
* @param {ICommandService} _commandService - The command service
|
|
3162
3174
|
*/
|
|
3163
|
-
constructor(e, t, n, s, o, i
|
|
3164
|
-
super(
|
|
3175
|
+
constructor(e, t, n, r, s, o, i) {
|
|
3176
|
+
super(r);
|
|
3165
3177
|
/**
|
|
3166
3178
|
* Sets the active selection region for this sheet.
|
|
3167
3179
|
* @param range - The range to set as the active selection
|
|
@@ -3172,8 +3184,8 @@ let S = class extends ge {
|
|
|
3172
3184
|
* fWorkSheet.setActiveSelection(fWorkSheet.getRange('A10:B10'));
|
|
3173
3185
|
* ```
|
|
3174
3186
|
*/
|
|
3175
|
-
|
|
3176
|
-
this._fWorkbook = e, this._workbook = t, this._worksheet = n, this._injector =
|
|
3187
|
+
b(this, "setActiveSelection", this.setActiveRange);
|
|
3188
|
+
this._fWorkbook = e, this._workbook = t, this._worksheet = n, this._injector = r, this._selectionManagerService = s, this._logService = o, this._commandService = i;
|
|
3177
3189
|
}
|
|
3178
3190
|
dispose() {
|
|
3179
3191
|
super.dispose(), delete this._fWorkbook, delete this._workbook, delete this._worksheet;
|
|
@@ -3255,7 +3267,7 @@ let S = class extends ge {
|
|
|
3255
3267
|
*/
|
|
3256
3268
|
getSelection() {
|
|
3257
3269
|
const e = this._selectionManagerService.getCurrentSelections();
|
|
3258
|
-
return e ? this._injector.createInstance(
|
|
3270
|
+
return e ? this._injector.createInstance(J, this._workbook, this._worksheet, e) : null;
|
|
3259
3271
|
}
|
|
3260
3272
|
// #region rows
|
|
3261
3273
|
// #region default style
|
|
@@ -3324,7 +3336,7 @@ let S = class extends ge {
|
|
|
3324
3336
|
*/
|
|
3325
3337
|
setDefaultStyle(e) {
|
|
3326
3338
|
const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId();
|
|
3327
|
-
return this._commandService.syncExecuteCommand(
|
|
3339
|
+
return this._commandService.syncExecuteCommand(Wt.id, {
|
|
3328
3340
|
unitId: t,
|
|
3329
3341
|
subUnitId: n,
|
|
3330
3342
|
defaultStyle: e
|
|
@@ -3345,16 +3357,16 @@ let S = class extends ge {
|
|
|
3345
3357
|
* ```
|
|
3346
3358
|
*/
|
|
3347
3359
|
setColumnDefaultStyle(e, t) {
|
|
3348
|
-
const n = this._workbook.getUnitId(),
|
|
3360
|
+
const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), s = {
|
|
3349
3361
|
unitId: n,
|
|
3350
|
-
subUnitId:
|
|
3362
|
+
subUnitId: r,
|
|
3351
3363
|
columnData: {
|
|
3352
3364
|
[e]: {
|
|
3353
3365
|
s: t
|
|
3354
3366
|
}
|
|
3355
3367
|
}
|
|
3356
3368
|
};
|
|
3357
|
-
return this._commandService.syncExecuteCommand(
|
|
3369
|
+
return this._commandService.syncExecuteCommand(pe.id, s), this;
|
|
3358
3370
|
}
|
|
3359
3371
|
/**
|
|
3360
3372
|
* Set the default style of the worksheet column
|
|
@@ -3371,49 +3383,49 @@ let S = class extends ge {
|
|
|
3371
3383
|
* ```
|
|
3372
3384
|
*/
|
|
3373
3385
|
setRowDefaultStyle(e, t) {
|
|
3374
|
-
const n = this._workbook.getUnitId(),
|
|
3386
|
+
const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), s = {
|
|
3375
3387
|
unitId: n,
|
|
3376
|
-
subUnitId:
|
|
3388
|
+
subUnitId: r,
|
|
3377
3389
|
rowData: {
|
|
3378
3390
|
[e]: {
|
|
3379
3391
|
s: t
|
|
3380
3392
|
}
|
|
3381
3393
|
}
|
|
3382
3394
|
};
|
|
3383
|
-
return this._commandService.syncExecuteCommand(
|
|
3395
|
+
return this._commandService.syncExecuteCommand(Ee.id, s), this;
|
|
3384
3396
|
}
|
|
3385
|
-
getRange(e, t, n,
|
|
3386
|
-
let
|
|
3397
|
+
getRange(e, t, n, r) {
|
|
3398
|
+
let s, o;
|
|
3387
3399
|
if (typeof e == "object")
|
|
3388
|
-
|
|
3400
|
+
s = e, o = this._worksheet;
|
|
3389
3401
|
else if (typeof e == "string") {
|
|
3390
|
-
const { range:
|
|
3402
|
+
const { range: i, sheetName: h } = un(e), d = h ? this._workbook.getSheetBySheetName(h) : this._worksheet;
|
|
3391
3403
|
if (!d)
|
|
3392
3404
|
throw new Error("Range not found");
|
|
3393
|
-
|
|
3394
|
-
...
|
|
3405
|
+
o = d, s = {
|
|
3406
|
+
...i,
|
|
3395
3407
|
unitId: this._workbook.getUnitId(),
|
|
3396
|
-
sheetId:
|
|
3408
|
+
sheetId: o.getSheetId(),
|
|
3397
3409
|
// Use the current range instead of the future actual range to match Apps Script behavior.
|
|
3398
3410
|
// Users can create the latest range in real time when needed.
|
|
3399
|
-
rangeType:
|
|
3400
|
-
startRow:
|
|
3401
|
-
endRow:
|
|
3402
|
-
startColumn:
|
|
3403
|
-
endColumn:
|
|
3411
|
+
rangeType: w.NORMAL,
|
|
3412
|
+
startRow: i.rangeType === w.COLUMN ? 0 : i.startRow,
|
|
3413
|
+
endRow: i.rangeType === w.COLUMN ? o.getMaxRows() - 1 : i.endRow,
|
|
3414
|
+
startColumn: i.rangeType === w.ROW ? 0 : i.startColumn,
|
|
3415
|
+
endColumn: i.rangeType === w.ROW ? o.getMaxColumns() - 1 : i.endColumn
|
|
3404
3416
|
};
|
|
3405
3417
|
} else if (typeof e == "number" && t !== void 0)
|
|
3406
|
-
|
|
3418
|
+
o = this._worksheet, s = {
|
|
3407
3419
|
startRow: e,
|
|
3408
3420
|
endRow: e + (n != null ? n : 1) - 1,
|
|
3409
3421
|
startColumn: t,
|
|
3410
|
-
endColumn: t + (
|
|
3422
|
+
endColumn: t + (r != null ? r : 1) - 1,
|
|
3411
3423
|
unitId: this._workbook.getUnitId(),
|
|
3412
3424
|
sheetId: this._worksheet.getSheetId()
|
|
3413
3425
|
};
|
|
3414
3426
|
else
|
|
3415
3427
|
throw new Error("Invalid range specification");
|
|
3416
|
-
return this._injector.createInstance(
|
|
3428
|
+
return this._injector.createInstance(k, this._workbook, o, s);
|
|
3417
3429
|
}
|
|
3418
3430
|
/**
|
|
3419
3431
|
* Returns the current number of columns in the sheet, regardless of content.
|
|
@@ -3505,14 +3517,14 @@ let S = class extends ge {
|
|
|
3505
3517
|
* ```
|
|
3506
3518
|
*/
|
|
3507
3519
|
insertRowsAfter(e, t) {
|
|
3508
|
-
const n = this._workbook.getUnitId(),
|
|
3509
|
-
return this._commandService.syncExecuteCommand(
|
|
3520
|
+
const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), s = j.DOWN, o = e + 1, i = e + t, h = 0, d = this._worksheet.getColumnCount() - 1, c = L(this._worksheet, o, i, h, d, !0, e);
|
|
3521
|
+
return this._commandService.syncExecuteCommand(ye.id, {
|
|
3510
3522
|
unitId: n,
|
|
3511
|
-
subUnitId:
|
|
3512
|
-
direction:
|
|
3523
|
+
subUnitId: r,
|
|
3524
|
+
direction: s,
|
|
3513
3525
|
range: {
|
|
3514
|
-
startRow:
|
|
3515
|
-
endRow:
|
|
3526
|
+
startRow: o,
|
|
3527
|
+
endRow: i,
|
|
3516
3528
|
startColumn: h,
|
|
3517
3529
|
endColumn: d
|
|
3518
3530
|
},
|
|
@@ -3534,14 +3546,14 @@ let S = class extends ge {
|
|
|
3534
3546
|
* ```
|
|
3535
3547
|
*/
|
|
3536
3548
|
insertRowsBefore(e, t) {
|
|
3537
|
-
const n = this._workbook.getUnitId(),
|
|
3538
|
-
return this._commandService.syncExecuteCommand(
|
|
3549
|
+
const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), s = j.UP, o = e, i = e + t - 1, h = 0, d = this._worksheet.getColumnCount() - 1, c = L(this._worksheet, o, i, h, d, !0, e - 1);
|
|
3550
|
+
return this._commandService.syncExecuteCommand(ye.id, {
|
|
3539
3551
|
unitId: n,
|
|
3540
|
-
subUnitId:
|
|
3541
|
-
direction:
|
|
3552
|
+
subUnitId: r,
|
|
3553
|
+
direction: s,
|
|
3542
3554
|
range: {
|
|
3543
|
-
startRow:
|
|
3544
|
-
endRow:
|
|
3555
|
+
startRow: o,
|
|
3556
|
+
endRow: i,
|
|
3545
3557
|
startColumn: h,
|
|
3546
3558
|
endColumn: d
|
|
3547
3559
|
},
|
|
@@ -3585,7 +3597,7 @@ let S = class extends ge {
|
|
|
3585
3597
|
startColumn: 0,
|
|
3586
3598
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
3587
3599
|
};
|
|
3588
|
-
return this._commandService.syncExecuteCommand(
|
|
3600
|
+
return this._commandService.syncExecuteCommand(Bt.id, {
|
|
3589
3601
|
range: n,
|
|
3590
3602
|
unitId: this._workbook.getUnitId(),
|
|
3591
3603
|
subUnitId: this._worksheet.getSheetId()
|
|
@@ -3608,18 +3620,18 @@ let S = class extends ge {
|
|
|
3608
3620
|
* ```
|
|
3609
3621
|
*/
|
|
3610
3622
|
moveRows(e, t) {
|
|
3611
|
-
const n = this._workbook.getUnitId(),
|
|
3623
|
+
const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), s = ne(e.getRange(), this._worksheet), o = s, i = {
|
|
3612
3624
|
startRow: t,
|
|
3613
3625
|
endRow: t,
|
|
3614
|
-
startColumn:
|
|
3615
|
-
endColumn:
|
|
3626
|
+
startColumn: s.startColumn,
|
|
3627
|
+
endColumn: s.endColumn
|
|
3616
3628
|
};
|
|
3617
|
-
return this._commandService.syncExecuteCommand(
|
|
3629
|
+
return this._commandService.syncExecuteCommand(Ft.id, {
|
|
3618
3630
|
unitId: n,
|
|
3619
|
-
subUnitId:
|
|
3620
|
-
range:
|
|
3621
|
-
fromRange:
|
|
3622
|
-
toRange:
|
|
3631
|
+
subUnitId: r,
|
|
3632
|
+
range: s,
|
|
3633
|
+
fromRange: o,
|
|
3634
|
+
toRange: i
|
|
3623
3635
|
}), this;
|
|
3624
3636
|
}
|
|
3625
3637
|
/**
|
|
@@ -3638,11 +3650,11 @@ let S = class extends ge {
|
|
|
3638
3650
|
* ```
|
|
3639
3651
|
*/
|
|
3640
3652
|
hideRow(e) {
|
|
3641
|
-
const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(),
|
|
3642
|
-
return this._commandService.syncExecuteCommand(
|
|
3653
|
+
const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), r = ne(e.getRange(), this._worksheet);
|
|
3654
|
+
return this._commandService.syncExecuteCommand(Ue.id, {
|
|
3643
3655
|
unitId: t,
|
|
3644
3656
|
subUnitId: n,
|
|
3645
|
-
ranges: [
|
|
3657
|
+
ranges: [r]
|
|
3646
3658
|
}), this;
|
|
3647
3659
|
}
|
|
3648
3660
|
/**
|
|
@@ -3660,17 +3672,17 @@ let S = class extends ge {
|
|
|
3660
3672
|
* ```
|
|
3661
3673
|
*/
|
|
3662
3674
|
hideRows(e, t = 1) {
|
|
3663
|
-
const n = this._workbook.getUnitId(),
|
|
3675
|
+
const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), s = {
|
|
3664
3676
|
startRow: e,
|
|
3665
3677
|
endRow: e + t - 1,
|
|
3666
3678
|
startColumn: 0,
|
|
3667
3679
|
endColumn: this._worksheet.getColumnCount() - 1,
|
|
3668
|
-
rangeType:
|
|
3680
|
+
rangeType: w.ROW
|
|
3669
3681
|
};
|
|
3670
|
-
return this._commandService.syncExecuteCommand(
|
|
3682
|
+
return this._commandService.syncExecuteCommand(Ue.id, {
|
|
3671
3683
|
unitId: n,
|
|
3672
|
-
subUnitId:
|
|
3673
|
-
ranges: [
|
|
3684
|
+
subUnitId: r,
|
|
3685
|
+
ranges: [s]
|
|
3674
3686
|
}), this;
|
|
3675
3687
|
}
|
|
3676
3688
|
/**
|
|
@@ -3689,11 +3701,11 @@ let S = class extends ge {
|
|
|
3689
3701
|
* ```
|
|
3690
3702
|
*/
|
|
3691
3703
|
unhideRow(e) {
|
|
3692
|
-
const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(),
|
|
3693
|
-
return this._commandService.syncExecuteCommand(
|
|
3704
|
+
const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), r = ne(e.getRange(), this._worksheet);
|
|
3705
|
+
return this._commandService.syncExecuteCommand(Pe.id, {
|
|
3694
3706
|
unitId: t,
|
|
3695
3707
|
subUnitId: n,
|
|
3696
|
-
ranges: [
|
|
3708
|
+
ranges: [r]
|
|
3697
3709
|
}), this;
|
|
3698
3710
|
}
|
|
3699
3711
|
/**
|
|
@@ -3711,17 +3723,17 @@ let S = class extends ge {
|
|
|
3711
3723
|
* ```
|
|
3712
3724
|
*/
|
|
3713
3725
|
showRows(e, t = 1) {
|
|
3714
|
-
const n = this._workbook.getUnitId(),
|
|
3726
|
+
const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), s = {
|
|
3715
3727
|
startRow: e,
|
|
3716
3728
|
endRow: e + t - 1,
|
|
3717
3729
|
startColumn: 0,
|
|
3718
3730
|
endColumn: this._worksheet.getColumnCount() - 1,
|
|
3719
|
-
rangeType:
|
|
3731
|
+
rangeType: w.ROW
|
|
3720
3732
|
};
|
|
3721
|
-
return this._commandService.syncExecuteCommand(
|
|
3733
|
+
return this._commandService.syncExecuteCommand(Pe.id, {
|
|
3722
3734
|
unitId: n,
|
|
3723
|
-
subUnitId:
|
|
3724
|
-
ranges: [
|
|
3735
|
+
subUnitId: r,
|
|
3736
|
+
ranges: [s]
|
|
3725
3737
|
}), this;
|
|
3726
3738
|
}
|
|
3727
3739
|
/**
|
|
@@ -3752,22 +3764,22 @@ let S = class extends ge {
|
|
|
3752
3764
|
* fWorkSheet.autoFitRow(24);
|
|
3753
3765
|
* ```
|
|
3754
3766
|
*/
|
|
3755
|
-
autoFitRow(e, t =
|
|
3756
|
-
const n = this._workbook.getUnitId(),
|
|
3767
|
+
autoFitRow(e, t = m.TRUE) {
|
|
3768
|
+
const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), s = [{
|
|
3757
3769
|
startRow: e,
|
|
3758
3770
|
endRow: e,
|
|
3759
3771
|
startColumn: 0,
|
|
3760
3772
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
3761
3773
|
}];
|
|
3762
|
-
return this._commandService.syncExecuteCommand(
|
|
3774
|
+
return this._commandService.syncExecuteCommand(he.id, {
|
|
3763
3775
|
unitId: this._workbook.getUnitId(),
|
|
3764
3776
|
subUnitId: this._worksheet.getSheetId(),
|
|
3765
|
-
range:
|
|
3766
|
-
value:
|
|
3767
|
-
}), this._commandService.syncExecuteCommand(
|
|
3777
|
+
range: s[0],
|
|
3778
|
+
value: G.WRAP
|
|
3779
|
+
}), this._commandService.syncExecuteCommand(Vt.id, {
|
|
3768
3780
|
unitId: n,
|
|
3769
|
-
subUnitId:
|
|
3770
|
-
ranges:
|
|
3781
|
+
subUnitId: r,
|
|
3782
|
+
ranges: s,
|
|
3771
3783
|
autoHeightInfo: t
|
|
3772
3784
|
}), this;
|
|
3773
3785
|
}
|
|
@@ -3786,25 +3798,25 @@ let S = class extends ge {
|
|
|
3786
3798
|
*/
|
|
3787
3799
|
setRowHeights(e, t, n) {
|
|
3788
3800
|
var d;
|
|
3789
|
-
const
|
|
3801
|
+
const r = this._workbook.getUnitId(), s = this._worksheet.getSheetId(), o = this._worksheet.getRowManager(), i = [], h = [];
|
|
3790
3802
|
for (let c = e; c < e + t; c++) {
|
|
3791
|
-
const
|
|
3803
|
+
const l = ((d = o.getRow(c)) == null ? void 0 : d.ah) || this._worksheet.getConfig().defaultRowHeight, u = {
|
|
3792
3804
|
startRow: c,
|
|
3793
3805
|
endRow: c,
|
|
3794
3806
|
startColumn: 0,
|
|
3795
3807
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
3796
3808
|
};
|
|
3797
|
-
n <=
|
|
3809
|
+
n <= l ? i.push(u) : h.push(u);
|
|
3798
3810
|
}
|
|
3799
|
-
return h.length > 0 && this._commandService.syncExecuteCommand(
|
|
3800
|
-
unitId:
|
|
3801
|
-
subUnitId:
|
|
3811
|
+
return h.length > 0 && this._commandService.syncExecuteCommand(xe.id, {
|
|
3812
|
+
unitId: r,
|
|
3813
|
+
subUnitId: s,
|
|
3802
3814
|
ranges: h,
|
|
3803
3815
|
value: n
|
|
3804
|
-
}),
|
|
3805
|
-
unitId:
|
|
3806
|
-
subUnitId:
|
|
3807
|
-
ranges:
|
|
3816
|
+
}), i.length > 0 && this._commandService.syncExecuteCommand(ee.id, {
|
|
3817
|
+
unitId: r,
|
|
3818
|
+
subUnitId: s,
|
|
3819
|
+
ranges: i
|
|
3808
3820
|
}), this;
|
|
3809
3821
|
}
|
|
3810
3822
|
/**
|
|
@@ -3839,7 +3851,7 @@ let S = class extends ge {
|
|
|
3839
3851
|
* ```
|
|
3840
3852
|
*/
|
|
3841
3853
|
setRowAutoHeight(e, t) {
|
|
3842
|
-
const n = this._workbook.getUnitId(),
|
|
3854
|
+
const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), s = [
|
|
3843
3855
|
{
|
|
3844
3856
|
startRow: e,
|
|
3845
3857
|
endRow: e + t - 1,
|
|
@@ -3847,10 +3859,10 @@ let S = class extends ge {
|
|
|
3847
3859
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
3848
3860
|
}
|
|
3849
3861
|
];
|
|
3850
|
-
return this._commandService.syncExecuteCommand(
|
|
3862
|
+
return this._commandService.syncExecuteCommand(ee.id, {
|
|
3851
3863
|
unitId: n,
|
|
3852
|
-
subUnitId:
|
|
3853
|
-
ranges:
|
|
3864
|
+
subUnitId: r,
|
|
3865
|
+
ranges: s
|
|
3854
3866
|
}), this;
|
|
3855
3867
|
}
|
|
3856
3868
|
/**
|
|
@@ -3869,7 +3881,7 @@ let S = class extends ge {
|
|
|
3869
3881
|
*/
|
|
3870
3882
|
setRangesAutoHeight(e) {
|
|
3871
3883
|
const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId();
|
|
3872
|
-
return this._commandService.syncExecuteCommand(
|
|
3884
|
+
return this._commandService.syncExecuteCommand(ee.id, {
|
|
3873
3885
|
unitId: t,
|
|
3874
3886
|
subUnitId: n,
|
|
3875
3887
|
ranges: e
|
|
@@ -3888,7 +3900,7 @@ let S = class extends ge {
|
|
|
3888
3900
|
* ```
|
|
3889
3901
|
*/
|
|
3890
3902
|
setRowHeightsForced(e, t, n) {
|
|
3891
|
-
const
|
|
3903
|
+
const r = this._workbook.getUnitId(), s = this._worksheet.getSheetId(), o = [
|
|
3892
3904
|
{
|
|
3893
3905
|
startRow: e,
|
|
3894
3906
|
endRow: e + t - 1,
|
|
@@ -3896,10 +3908,10 @@ let S = class extends ge {
|
|
|
3896
3908
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
3897
3909
|
}
|
|
3898
3910
|
];
|
|
3899
|
-
return this._commandService.syncExecuteCommand(
|
|
3900
|
-
unitId:
|
|
3901
|
-
subUnitId:
|
|
3902
|
-
ranges:
|
|
3911
|
+
return this._commandService.syncExecuteCommand(xe.id, {
|
|
3912
|
+
unitId: r,
|
|
3913
|
+
subUnitId: s,
|
|
3914
|
+
ranges: o,
|
|
3903
3915
|
value: n
|
|
3904
3916
|
}), this;
|
|
3905
3917
|
}
|
|
@@ -3915,17 +3927,17 @@ let S = class extends ge {
|
|
|
3915
3927
|
* ```
|
|
3916
3928
|
*/
|
|
3917
3929
|
setRowCustom(e) {
|
|
3918
|
-
const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(),
|
|
3919
|
-
for (const [
|
|
3920
|
-
|
|
3921
|
-
custom:
|
|
3930
|
+
const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), r = {};
|
|
3931
|
+
for (const [o, i] of Object.entries(e))
|
|
3932
|
+
r[Number(o)] = {
|
|
3933
|
+
custom: i
|
|
3922
3934
|
};
|
|
3923
|
-
const
|
|
3935
|
+
const s = {
|
|
3924
3936
|
unitId: t,
|
|
3925
3937
|
subUnitId: n,
|
|
3926
|
-
rowData:
|
|
3938
|
+
rowData: r
|
|
3927
3939
|
};
|
|
3928
|
-
return this._commandService.syncExecuteCommand(
|
|
3940
|
+
return this._commandService.syncExecuteCommand(Ee.id, s), this;
|
|
3929
3941
|
}
|
|
3930
3942
|
// #region Column
|
|
3931
3943
|
/**
|
|
@@ -3992,14 +4004,14 @@ let S = class extends ge {
|
|
|
3992
4004
|
* ```
|
|
3993
4005
|
*/
|
|
3994
4006
|
insertColumnsAfter(e, t) {
|
|
3995
|
-
const n = this._workbook.getUnitId(),
|
|
3996
|
-
return this._commandService.syncExecuteCommand(
|
|
4007
|
+
const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), s = j.RIGHT, o = 0, i = this._worksheet.getRowCount() - 1, h = e + 1, d = e + t, c = L(this._worksheet, o, i, h, d, !1, e);
|
|
4008
|
+
return this._commandService.syncExecuteCommand(Me.id, {
|
|
3997
4009
|
unitId: n,
|
|
3998
|
-
subUnitId:
|
|
3999
|
-
direction:
|
|
4010
|
+
subUnitId: r,
|
|
4011
|
+
direction: s,
|
|
4000
4012
|
range: {
|
|
4001
|
-
startRow:
|
|
4002
|
-
endRow:
|
|
4013
|
+
startRow: o,
|
|
4014
|
+
endRow: i,
|
|
4003
4015
|
startColumn: h,
|
|
4004
4016
|
endColumn: d
|
|
4005
4017
|
},
|
|
@@ -4021,14 +4033,14 @@ let S = class extends ge {
|
|
|
4021
4033
|
* ```
|
|
4022
4034
|
*/
|
|
4023
4035
|
insertColumnsBefore(e, t) {
|
|
4024
|
-
const n = this._workbook.getUnitId(),
|
|
4025
|
-
return this._commandService.syncExecuteCommand(
|
|
4036
|
+
const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), s = j.LEFT, o = 0, i = this._worksheet.getRowCount() - 1, h = e, d = e + t - 1, c = L(this._worksheet, o, i, h, d, !1, e - 1);
|
|
4037
|
+
return this._commandService.syncExecuteCommand(Me.id, {
|
|
4026
4038
|
unitId: n,
|
|
4027
|
-
subUnitId:
|
|
4028
|
-
direction:
|
|
4039
|
+
subUnitId: r,
|
|
4040
|
+
direction: s,
|
|
4029
4041
|
range: {
|
|
4030
|
-
startRow:
|
|
4031
|
-
endRow:
|
|
4042
|
+
startRow: o,
|
|
4043
|
+
endRow: i,
|
|
4032
4044
|
startColumn: h,
|
|
4033
4045
|
endColumn: d
|
|
4034
4046
|
},
|
|
@@ -4072,7 +4084,7 @@ let S = class extends ge {
|
|
|
4072
4084
|
startColumn: e,
|
|
4073
4085
|
endColumn: e + t - 1
|
|
4074
4086
|
};
|
|
4075
|
-
return this._commandService.syncExecuteCommand(
|
|
4087
|
+
return this._commandService.syncExecuteCommand(Ht.id, {
|
|
4076
4088
|
range: n,
|
|
4077
4089
|
unitId: this._workbook.getUnitId(),
|
|
4078
4090
|
subUnitId: this._worksheet.getSheetId()
|
|
@@ -4095,18 +4107,18 @@ let S = class extends ge {
|
|
|
4095
4107
|
* ```
|
|
4096
4108
|
*/
|
|
4097
4109
|
moveColumns(e, t) {
|
|
4098
|
-
const n = this._workbook.getUnitId(),
|
|
4110
|
+
const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), s = re(e.getRange(), this._worksheet), o = s, i = {
|
|
4099
4111
|
startRow: 0,
|
|
4100
4112
|
endRow: this._worksheet.getRowCount() - 1,
|
|
4101
4113
|
startColumn: t,
|
|
4102
4114
|
endColumn: t
|
|
4103
4115
|
};
|
|
4104
|
-
return this._commandService.syncExecuteCommand(
|
|
4116
|
+
return this._commandService.syncExecuteCommand(Ot.id, {
|
|
4105
4117
|
unitId: n,
|
|
4106
|
-
subUnitId:
|
|
4107
|
-
range:
|
|
4108
|
-
fromRange:
|
|
4109
|
-
toRange:
|
|
4118
|
+
subUnitId: r,
|
|
4119
|
+
range: s,
|
|
4120
|
+
fromRange: o,
|
|
4121
|
+
toRange: i
|
|
4110
4122
|
}), this;
|
|
4111
4123
|
}
|
|
4112
4124
|
/**
|
|
@@ -4125,11 +4137,11 @@ let S = class extends ge {
|
|
|
4125
4137
|
* ```
|
|
4126
4138
|
*/
|
|
4127
4139
|
hideColumn(e) {
|
|
4128
|
-
const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(),
|
|
4129
|
-
return this._commandService.syncExecuteCommand(
|
|
4140
|
+
const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), r = re(e.getRange(), this._worksheet);
|
|
4141
|
+
return this._commandService.syncExecuteCommand(Ne.id, {
|
|
4130
4142
|
unitId: t,
|
|
4131
4143
|
subUnitId: n,
|
|
4132
|
-
ranges: [
|
|
4144
|
+
ranges: [r]
|
|
4133
4145
|
}), this;
|
|
4134
4146
|
}
|
|
4135
4147
|
/**
|
|
@@ -4147,17 +4159,17 @@ let S = class extends ge {
|
|
|
4147
4159
|
* ```
|
|
4148
4160
|
*/
|
|
4149
4161
|
hideColumns(e, t = 1) {
|
|
4150
|
-
const n = this._workbook.getUnitId(),
|
|
4162
|
+
const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), s = {
|
|
4151
4163
|
startRow: 0,
|
|
4152
4164
|
endRow: this._worksheet.getRowCount() - 1,
|
|
4153
4165
|
startColumn: e,
|
|
4154
4166
|
endColumn: e + t - 1,
|
|
4155
|
-
rangeType:
|
|
4167
|
+
rangeType: w.COLUMN
|
|
4156
4168
|
};
|
|
4157
|
-
return this._commandService.syncExecuteCommand(
|
|
4169
|
+
return this._commandService.syncExecuteCommand(Ne.id, {
|
|
4158
4170
|
unitId: n,
|
|
4159
|
-
subUnitId:
|
|
4160
|
-
ranges: [
|
|
4171
|
+
subUnitId: r,
|
|
4172
|
+
ranges: [s]
|
|
4161
4173
|
}), this;
|
|
4162
4174
|
}
|
|
4163
4175
|
/**
|
|
@@ -4176,11 +4188,11 @@ let S = class extends ge {
|
|
|
4176
4188
|
* ```
|
|
4177
4189
|
*/
|
|
4178
4190
|
unhideColumn(e) {
|
|
4179
|
-
const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(),
|
|
4180
|
-
return this._commandService.syncExecuteCommand(
|
|
4191
|
+
const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), r = re(e.getRange(), this._worksheet);
|
|
4192
|
+
return this._commandService.syncExecuteCommand(Te.id, {
|
|
4181
4193
|
unitId: t,
|
|
4182
4194
|
subUnitId: n,
|
|
4183
|
-
ranges: [
|
|
4195
|
+
ranges: [r]
|
|
4184
4196
|
}), this;
|
|
4185
4197
|
}
|
|
4186
4198
|
/**
|
|
@@ -4198,17 +4210,17 @@ let S = class extends ge {
|
|
|
4198
4210
|
* ```
|
|
4199
4211
|
*/
|
|
4200
4212
|
showColumns(e, t = 1) {
|
|
4201
|
-
const n = this._workbook.getUnitId(),
|
|
4213
|
+
const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), s = {
|
|
4202
4214
|
startRow: 0,
|
|
4203
4215
|
endRow: this._worksheet.getRowCount() - 1,
|
|
4204
4216
|
startColumn: e,
|
|
4205
4217
|
endColumn: e + t - 1,
|
|
4206
|
-
rangeType:
|
|
4218
|
+
rangeType: w.COLUMN
|
|
4207
4219
|
};
|
|
4208
|
-
return this._commandService.syncExecuteCommand(
|
|
4220
|
+
return this._commandService.syncExecuteCommand(Te.id, {
|
|
4209
4221
|
unitId: n,
|
|
4210
|
-
subUnitId:
|
|
4211
|
-
ranges: [
|
|
4222
|
+
subUnitId: r,
|
|
4223
|
+
ranges: [s]
|
|
4212
4224
|
}), this;
|
|
4213
4225
|
}
|
|
4214
4226
|
/**
|
|
@@ -4240,7 +4252,7 @@ let S = class extends ge {
|
|
|
4240
4252
|
* ```
|
|
4241
4253
|
*/
|
|
4242
4254
|
setColumnWidths(e, t, n) {
|
|
4243
|
-
const
|
|
4255
|
+
const r = this._workbook.getUnitId(), s = this._worksheet.getSheetId(), o = [
|
|
4244
4256
|
{
|
|
4245
4257
|
startColumn: e,
|
|
4246
4258
|
endColumn: e + t - 1,
|
|
@@ -4248,10 +4260,10 @@ let S = class extends ge {
|
|
|
4248
4260
|
endRow: this._worksheet.getRowCount() - 1
|
|
4249
4261
|
}
|
|
4250
4262
|
];
|
|
4251
|
-
return this._commandService.syncExecuteCommand(
|
|
4252
|
-
unitId:
|
|
4253
|
-
subUnitId:
|
|
4254
|
-
ranges:
|
|
4263
|
+
return this._commandService.syncExecuteCommand(jt.id, {
|
|
4264
|
+
unitId: r,
|
|
4265
|
+
subUnitId: s,
|
|
4266
|
+
ranges: o,
|
|
4255
4267
|
value: n
|
|
4256
4268
|
}), this;
|
|
4257
4269
|
}
|
|
@@ -4290,17 +4302,17 @@ let S = class extends ge {
|
|
|
4290
4302
|
* ```
|
|
4291
4303
|
*/
|
|
4292
4304
|
setColumnCustom(e) {
|
|
4293
|
-
const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(),
|
|
4294
|
-
for (const [
|
|
4295
|
-
|
|
4296
|
-
custom:
|
|
4305
|
+
const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), r = {};
|
|
4306
|
+
for (const [o, i] of Object.entries(e))
|
|
4307
|
+
r[Number(o)] = {
|
|
4308
|
+
custom: i
|
|
4297
4309
|
};
|
|
4298
|
-
const
|
|
4310
|
+
const s = {
|
|
4299
4311
|
unitId: t,
|
|
4300
4312
|
subUnitId: n,
|
|
4301
|
-
columnData:
|
|
4313
|
+
columnData: r
|
|
4302
4314
|
};
|
|
4303
|
-
return this._commandService.syncExecuteCommand(
|
|
4315
|
+
return this._commandService.syncExecuteCommand(pe.id, s), this;
|
|
4304
4316
|
}
|
|
4305
4317
|
// #region merge cells
|
|
4306
4318
|
/**
|
|
@@ -4318,7 +4330,7 @@ let S = class extends ge {
|
|
|
4318
4330
|
* ```
|
|
4319
4331
|
*/
|
|
4320
4332
|
getMergeData() {
|
|
4321
|
-
return this._worksheet.getMergeData().map((e) => this._injector.createInstance(
|
|
4333
|
+
return this._worksheet.getMergeData().map((e) => this._injector.createInstance(k, this._workbook, this._worksheet, e));
|
|
4322
4334
|
}
|
|
4323
4335
|
/**
|
|
4324
4336
|
* Get all merged cells in the current sheet
|
|
@@ -4335,7 +4347,7 @@ let S = class extends ge {
|
|
|
4335
4347
|
* ```
|
|
4336
4348
|
*/
|
|
4337
4349
|
getMergedRanges() {
|
|
4338
|
-
return this._worksheet.getSnapshot().mergeData.map((t) => this._injector.createInstance(
|
|
4350
|
+
return this._worksheet.getSnapshot().mergeData.map((t) => this._injector.createInstance(k, this._workbook, this._worksheet, t));
|
|
4339
4351
|
}
|
|
4340
4352
|
/**
|
|
4341
4353
|
* Get the merged cell data of the specified row and column.
|
|
@@ -4352,9 +4364,9 @@ let S = class extends ge {
|
|
|
4352
4364
|
* ```
|
|
4353
4365
|
*/
|
|
4354
4366
|
getCellMergeData(e, t) {
|
|
4355
|
-
const
|
|
4356
|
-
if (
|
|
4357
|
-
return this._injector.createInstance(
|
|
4367
|
+
const r = this._worksheet.getMergedCell(e, t);
|
|
4368
|
+
if (r)
|
|
4369
|
+
return this._injector.createInstance(k, this._workbook, this._worksheet, r);
|
|
4358
4370
|
}
|
|
4359
4371
|
// #endregion
|
|
4360
4372
|
/**
|
|
@@ -4420,7 +4432,7 @@ let S = class extends ge {
|
|
|
4420
4432
|
* ```
|
|
4421
4433
|
*/
|
|
4422
4434
|
setFreeze(e) {
|
|
4423
|
-
return this._logService.warn("setFreeze is deprecated, use setFrozenRows and setFrozenColumns instead"), this._commandService.syncExecuteCommand(
|
|
4435
|
+
return this._logService.warn("setFreeze is deprecated, use setFrozenRows and setFrozenColumns instead"), this._commandService.syncExecuteCommand(te.id, {
|
|
4424
4436
|
...e,
|
|
4425
4437
|
unitId: this._workbook.getUnitId(),
|
|
4426
4438
|
subUnitId: this.getSheetId()
|
|
@@ -4437,7 +4449,7 @@ let S = class extends ge {
|
|
|
4437
4449
|
* ```
|
|
4438
4450
|
*/
|
|
4439
4451
|
cancelFreeze() {
|
|
4440
|
-
return this._commandService.syncExecuteCommand(
|
|
4452
|
+
return this._commandService.syncExecuteCommand(Lt.id, {
|
|
4441
4453
|
unitId: this._workbook.getUnitId(),
|
|
4442
4454
|
subUnitId: this.getSheetId()
|
|
4443
4455
|
}), this;
|
|
@@ -4466,10 +4478,10 @@ let S = class extends ge {
|
|
|
4466
4478
|
xSplit: n
|
|
4467
4479
|
});
|
|
4468
4480
|
} else if (arguments.length === 2) {
|
|
4469
|
-
let [n = 0,
|
|
4470
|
-
n >
|
|
4471
|
-
startColumn:
|
|
4472
|
-
xSplit:
|
|
4481
|
+
let [n = 0, r = 0] = e;
|
|
4482
|
+
n > r && ([n, r] = [r, n]), this._commandService.syncExecuteCommand(te.id, {
|
|
4483
|
+
startColumn: r + 1,
|
|
4484
|
+
xSplit: r - n + 1,
|
|
4473
4485
|
startRow: t.startRow,
|
|
4474
4486
|
ySplit: t.ySplit,
|
|
4475
4487
|
unitId: this._workbook.getUnitId(),
|
|
@@ -4488,10 +4500,10 @@ let S = class extends ge {
|
|
|
4488
4500
|
ySplit: n
|
|
4489
4501
|
});
|
|
4490
4502
|
} else if (arguments.length === 2) {
|
|
4491
|
-
let [n = 0,
|
|
4492
|
-
n >
|
|
4493
|
-
startRow:
|
|
4494
|
-
ySplit:
|
|
4503
|
+
let [n = 0, r = 0] = e;
|
|
4504
|
+
n > r && ([n, r] = [r, n]), this._commandService.syncExecuteCommand(te.id, {
|
|
4505
|
+
startRow: r + 1,
|
|
4506
|
+
ySplit: r - n + 1,
|
|
4495
4507
|
startColumn: t.startColumn,
|
|
4496
4508
|
xSplit: t.xSplit,
|
|
4497
4509
|
unitId: this._workbook.getUnitId(),
|
|
@@ -4579,7 +4591,7 @@ let S = class extends ge {
|
|
|
4579
4591
|
* ```
|
|
4580
4592
|
*/
|
|
4581
4593
|
hasHiddenGridLines() {
|
|
4582
|
-
return this._worksheet.getConfig().showGridlines ===
|
|
4594
|
+
return this._worksheet.getConfig().showGridlines === m.FALSE;
|
|
4583
4595
|
}
|
|
4584
4596
|
/**
|
|
4585
4597
|
* Hides or reveals the sheet gridlines.
|
|
@@ -4593,10 +4605,10 @@ let S = class extends ge {
|
|
|
4593
4605
|
* ```
|
|
4594
4606
|
*/
|
|
4595
4607
|
setHiddenGridlines(e) {
|
|
4596
|
-
return this._commandService.syncExecuteCommand(
|
|
4608
|
+
return this._commandService.syncExecuteCommand(de.id, {
|
|
4597
4609
|
unitId: this._workbook.getUnitId(),
|
|
4598
4610
|
subUnitId: this._worksheet.getSheetId(),
|
|
4599
|
-
showGridlines: e ?
|
|
4611
|
+
showGridlines: e ? m.FALSE : m.TRUE
|
|
4600
4612
|
}), this;
|
|
4601
4613
|
}
|
|
4602
4614
|
/**
|
|
@@ -4611,7 +4623,7 @@ let S = class extends ge {
|
|
|
4611
4623
|
* ```
|
|
4612
4624
|
*/
|
|
4613
4625
|
setGridLinesColor(e) {
|
|
4614
|
-
return this._commandService.syncExecuteCommand(
|
|
4626
|
+
return this._commandService.syncExecuteCommand(ce.id, {
|
|
4615
4627
|
unitId: this._workbook.getUnitId(),
|
|
4616
4628
|
subUnitId: this._worksheet.getSheetId(),
|
|
4617
4629
|
color: e
|
|
@@ -4644,7 +4656,7 @@ let S = class extends ge {
|
|
|
4644
4656
|
* ```
|
|
4645
4657
|
*/
|
|
4646
4658
|
setTabColor(e) {
|
|
4647
|
-
return this._commandService.syncExecuteCommand(
|
|
4659
|
+
return this._commandService.syncExecuteCommand(zt.id, {
|
|
4648
4660
|
unitId: this._workbook.getUnitId(),
|
|
4649
4661
|
subUnitId: this._worksheet.getSheetId(),
|
|
4650
4662
|
value: e
|
|
@@ -4669,10 +4681,10 @@ let S = class extends ge {
|
|
|
4669
4681
|
* @deprecated use `univerAPI.addEvent(univerAPI.Event.SheetValueChanged, (params) => {})` instead
|
|
4670
4682
|
*/
|
|
4671
4683
|
onCellDataChange(e) {
|
|
4672
|
-
return this._injector.get(
|
|
4673
|
-
if (n.id ===
|
|
4674
|
-
const
|
|
4675
|
-
|
|
4684
|
+
return this._injector.get(_).onCommandExecuted((n) => {
|
|
4685
|
+
if (n.id === Ae.id) {
|
|
4686
|
+
const r = n.params;
|
|
4687
|
+
r.unitId === this._workbook.getUnitId() && r.subUnitId === this._worksheet.getSheetId() && r.cellValue && e(new X(r.cellValue));
|
|
4676
4688
|
}
|
|
4677
4689
|
});
|
|
4678
4690
|
}
|
|
@@ -4680,10 +4692,10 @@ let S = class extends ge {
|
|
|
4680
4692
|
* @deprecated use `univerAPI.addEvent(univerAPI.Event.BeforeSheetEditEnd, (params) => {})` instead
|
|
4681
4693
|
*/
|
|
4682
4694
|
onBeforeCellDataChange(e) {
|
|
4683
|
-
return this._injector.get(
|
|
4684
|
-
if (n.id ===
|
|
4685
|
-
const
|
|
4686
|
-
|
|
4695
|
+
return this._injector.get(_).beforeCommandExecuted((n) => {
|
|
4696
|
+
if (n.id === Ae.id) {
|
|
4697
|
+
const r = n.params;
|
|
4698
|
+
r.unitId === this._workbook.getUnitId() && r.subUnitId === this._worksheet.getSheetId() && r.cellValue && e(new X(r.cellValue));
|
|
4687
4699
|
}
|
|
4688
4700
|
});
|
|
4689
4701
|
}
|
|
@@ -4699,10 +4711,10 @@ let S = class extends ge {
|
|
|
4699
4711
|
* ```
|
|
4700
4712
|
*/
|
|
4701
4713
|
hideSheet() {
|
|
4702
|
-
const e = this._injector.get(
|
|
4703
|
-
if (this._workbook.getSheets().filter((
|
|
4714
|
+
const e = this._injector.get(_);
|
|
4715
|
+
if (this._workbook.getSheets().filter((s) => s.isSheetHidden() !== m.TRUE).length <= 1)
|
|
4704
4716
|
throw new Error("Cannot hide the only visible sheet");
|
|
4705
|
-
return e.syncExecuteCommand(
|
|
4717
|
+
return e.syncExecuteCommand(Gt.id, {
|
|
4706
4718
|
unitId: this._workbook.getUnitId(),
|
|
4707
4719
|
subUnitId: this._worksheet.getSheetId()
|
|
4708
4720
|
}), this;
|
|
@@ -4719,7 +4731,7 @@ let S = class extends ge {
|
|
|
4719
4731
|
* ```
|
|
4720
4732
|
*/
|
|
4721
4733
|
showSheet() {
|
|
4722
|
-
return this._injector.get(
|
|
4734
|
+
return this._injector.get(_).syncExecuteCommand($t.id, {
|
|
4723
4735
|
unitId: this._workbook.getUnitId(),
|
|
4724
4736
|
subUnitId: this._worksheet.getSheetId()
|
|
4725
4737
|
}), this;
|
|
@@ -4736,7 +4748,7 @@ let S = class extends ge {
|
|
|
4736
4748
|
* ```
|
|
4737
4749
|
*/
|
|
4738
4750
|
isSheetHidden() {
|
|
4739
|
-
return this._worksheet.isSheetHidden() ===
|
|
4751
|
+
return this._worksheet.isSheetHidden() === m.TRUE;
|
|
4740
4752
|
}
|
|
4741
4753
|
/**
|
|
4742
4754
|
* Sets the sheet name.
|
|
@@ -4751,7 +4763,7 @@ let S = class extends ge {
|
|
|
4751
4763
|
* ```
|
|
4752
4764
|
*/
|
|
4753
4765
|
setName(e) {
|
|
4754
|
-
return this._commandService.syncExecuteCommand(
|
|
4766
|
+
return this._commandService.syncExecuteCommand(ue.id, {
|
|
4755
4767
|
unitId: this._workbook.getUnitId(),
|
|
4756
4768
|
subUnitId: this._worksheet.getSheetId(),
|
|
4757
4769
|
name: e
|
|
@@ -4807,16 +4819,16 @@ let S = class extends ge {
|
|
|
4807
4819
|
return this.clearContents();
|
|
4808
4820
|
if (e && e.formatOnly && !e.contentsOnly)
|
|
4809
4821
|
return this.clearFormats();
|
|
4810
|
-
const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(),
|
|
4822
|
+
const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), r = this._injector.get(_), s = {
|
|
4811
4823
|
startRow: 0,
|
|
4812
4824
|
endRow: this._worksheet.getRowCount() - 1,
|
|
4813
4825
|
startColumn: 0,
|
|
4814
4826
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
4815
4827
|
};
|
|
4816
|
-
return
|
|
4828
|
+
return r.syncExecuteCommand(Xe.id, {
|
|
4817
4829
|
unitId: t,
|
|
4818
4830
|
subUnitId: n,
|
|
4819
|
-
ranges: [
|
|
4831
|
+
ranges: [s],
|
|
4820
4832
|
options: e
|
|
4821
4833
|
}), this;
|
|
4822
4834
|
}
|
|
@@ -4832,16 +4844,16 @@ let S = class extends ge {
|
|
|
4832
4844
|
* ```
|
|
4833
4845
|
*/
|
|
4834
4846
|
clearContents() {
|
|
4835
|
-
const e = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), n = this._injector.get(
|
|
4847
|
+
const e = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), n = this._injector.get(_), r = {
|
|
4836
4848
|
startRow: 0,
|
|
4837
4849
|
endRow: this._worksheet.getRowCount() - 1,
|
|
4838
4850
|
startColumn: 0,
|
|
4839
4851
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
4840
4852
|
};
|
|
4841
|
-
return n.syncExecuteCommand(
|
|
4853
|
+
return n.syncExecuteCommand(Ze.id, {
|
|
4842
4854
|
unitId: e,
|
|
4843
4855
|
subUnitId: t,
|
|
4844
|
-
ranges: [
|
|
4856
|
+
ranges: [r]
|
|
4845
4857
|
}), this;
|
|
4846
4858
|
}
|
|
4847
4859
|
/**
|
|
@@ -4856,16 +4868,16 @@ let S = class extends ge {
|
|
|
4856
4868
|
* ```
|
|
4857
4869
|
*/
|
|
4858
4870
|
clearFormats() {
|
|
4859
|
-
const e = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), n = this._injector.get(
|
|
4871
|
+
const e = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), n = this._injector.get(_), r = {
|
|
4860
4872
|
startRow: 0,
|
|
4861
4873
|
endRow: this._worksheet.getRowCount() - 1,
|
|
4862
4874
|
startColumn: 0,
|
|
4863
4875
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
4864
4876
|
};
|
|
4865
|
-
return n.syncExecuteCommand(
|
|
4877
|
+
return n.syncExecuteCommand(et.id, {
|
|
4866
4878
|
unitId: e,
|
|
4867
4879
|
subUnitId: t,
|
|
4868
|
-
ranges: [
|
|
4880
|
+
ranges: [r]
|
|
4869
4881
|
}), this;
|
|
4870
4882
|
}
|
|
4871
4883
|
/**
|
|
@@ -4961,8 +4973,8 @@ let S = class extends ge {
|
|
|
4961
4973
|
* ```
|
|
4962
4974
|
*/
|
|
4963
4975
|
insertDefinedName(e, t) {
|
|
4964
|
-
const
|
|
4965
|
-
|
|
4976
|
+
const r = this._injector.createInstance(Q).setName(e).setRef(t).build();
|
|
4977
|
+
r.localSheetId = this.getSheetId(), this._fWorkbook.insertDefinedNameBuilder(r);
|
|
4966
4978
|
}
|
|
4967
4979
|
/**
|
|
4968
4980
|
* Get all the defined names in the worksheet.
|
|
@@ -5080,17 +5092,17 @@ let S = class extends ge {
|
|
|
5080
5092
|
* ```
|
|
5081
5093
|
*/
|
|
5082
5094
|
appendRow(e) {
|
|
5083
|
-
const t = this._worksheet.getCellMatrix().hasValue(), n = this._worksheet.getLastRowWithContent(),
|
|
5095
|
+
const t = this._worksheet.getCellMatrix().hasValue(), n = this._worksheet.getLastRowWithContent(), r = this._worksheet.getRowCount(), s = this._worksheet.getColumnCount(), o = t ? n + 1 : n, i = new X();
|
|
5084
5096
|
for (let h = 0; h < e.length; h++)
|
|
5085
|
-
|
|
5086
|
-
return this._commandService.syncExecuteCommand(
|
|
5097
|
+
i.setValue(o, h, oe(e[h]));
|
|
5098
|
+
return this._commandService.syncExecuteCommand(qt.id, {
|
|
5087
5099
|
unitId: this._workbook.getUnitId(),
|
|
5088
5100
|
subUnitId: this._worksheet.getSheetId(),
|
|
5089
|
-
cellValue:
|
|
5090
|
-
insertRowNums:
|
|
5091
|
-
insertColumnNums: e.length >
|
|
5092
|
-
maxRows:
|
|
5093
|
-
maxColumns:
|
|
5101
|
+
cellValue: i.getMatrix(),
|
|
5102
|
+
insertRowNums: o > r - 1 ? 1 : 0,
|
|
5103
|
+
insertColumnNums: e.length > s ? e.length - s : 0,
|
|
5104
|
+
maxRows: r,
|
|
5105
|
+
maxColumns: s
|
|
5094
5106
|
}), this;
|
|
5095
5107
|
}
|
|
5096
5108
|
/**
|
|
@@ -5107,7 +5119,7 @@ let S = class extends ge {
|
|
|
5107
5119
|
* ```
|
|
5108
5120
|
*/
|
|
5109
5121
|
setRowCount(e) {
|
|
5110
|
-
return this._commandService.syncExecuteCommand(
|
|
5122
|
+
return this._commandService.syncExecuteCommand(Kt.id, {
|
|
5111
5123
|
unitId: this._workbook.getUnitId(),
|
|
5112
5124
|
subUnitId: this._worksheet.getSheetId(),
|
|
5113
5125
|
rowCount: e
|
|
@@ -5127,29 +5139,29 @@ let S = class extends ge {
|
|
|
5127
5139
|
* ```
|
|
5128
5140
|
*/
|
|
5129
5141
|
setColumnCount(e) {
|
|
5130
|
-
return this._commandService.syncExecuteCommand(
|
|
5142
|
+
return this._commandService.syncExecuteCommand(Yt.id, {
|
|
5131
5143
|
unitId: this._workbook.getUnitId(),
|
|
5132
5144
|
subUnitId: this._worksheet.getSheetId(),
|
|
5133
5145
|
columnCount: e
|
|
5134
5146
|
}), this;
|
|
5135
5147
|
}
|
|
5136
5148
|
};
|
|
5137
|
-
S =
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5149
|
+
S = pn([
|
|
5150
|
+
z(3, g(M)),
|
|
5151
|
+
z(4, g(tt)),
|
|
5152
|
+
z(5, g(ze)),
|
|
5153
|
+
z(6, _)
|
|
5142
5154
|
], S);
|
|
5143
|
-
var
|
|
5144
|
-
for (var
|
|
5145
|
-
(
|
|
5146
|
-
return
|
|
5147
|
-
}, R = (
|
|
5148
|
-
let C = class extends
|
|
5149
|
-
constructor(e, t, n, s, o, i,
|
|
5155
|
+
var En = Object.getOwnPropertyDescriptor, yn = (a, e, t, n) => {
|
|
5156
|
+
for (var r = n > 1 ? void 0 : n ? En(e, t) : e, s = a.length - 1, o; s >= 0; s--)
|
|
5157
|
+
(o = a[s]) && (r = o(r) || r);
|
|
5158
|
+
return r;
|
|
5159
|
+
}, R = (a, e) => (t, n) => e(t, n, a);
|
|
5160
|
+
let C = class extends _e {
|
|
5161
|
+
constructor(e, t, n, r, s, o, i, h, d, c) {
|
|
5150
5162
|
super(t);
|
|
5151
|
-
|
|
5152
|
-
this._workbook = e, this._injector = t, this._resourceLoaderService = n, this._selectionManagerService =
|
|
5163
|
+
b(this, "id");
|
|
5164
|
+
this._workbook = e, this._injector = t, this._resourceLoaderService = n, this._selectionManagerService = r, this._univerInstanceService = s, this._commandService = o, this._permissionService = i, this._logService = h, this._localeService = d, this._definedNamesService = c, this.id = this._workbook.getUnitId();
|
|
5153
5165
|
}
|
|
5154
5166
|
/**
|
|
5155
5167
|
* Get the Workbook instance.
|
|
@@ -5207,7 +5219,7 @@ let C = class extends ge {
|
|
|
5207
5219
|
* ```
|
|
5208
5220
|
*/
|
|
5209
5221
|
setName(e) {
|
|
5210
|
-
return this._commandService.syncExecuteCommand(
|
|
5222
|
+
return this._commandService.syncExecuteCommand(Jt.id, {
|
|
5211
5223
|
unitId: this._workbook.getUnitId(),
|
|
5212
5224
|
name: e
|
|
5213
5225
|
}), this;
|
|
@@ -5305,23 +5317,23 @@ let C = class extends ge {
|
|
|
5305
5317
|
* console.log(newSheetWithData);
|
|
5306
5318
|
* ```
|
|
5307
5319
|
*/
|
|
5308
|
-
create(e, t, n,
|
|
5320
|
+
create(e, t, n, r) {
|
|
5309
5321
|
var h, d, c;
|
|
5310
|
-
const
|
|
5311
|
-
|
|
5312
|
-
const
|
|
5313
|
-
this._commandService.syncExecuteCommand(
|
|
5322
|
+
const s = fe(Ie.deepClone((h = r == null ? void 0 : r.sheet) != null ? h : {}));
|
|
5323
|
+
s.name = e, s.rowCount = t, s.columnCount = n, s.id = (d = r == null ? void 0 : r.sheet) == null ? void 0 : d.id;
|
|
5324
|
+
const o = (c = r == null ? void 0 : r.index) != null ? c : this._workbook.getSheets().length;
|
|
5325
|
+
this._commandService.syncExecuteCommand(q.id, {
|
|
5314
5326
|
unitId: this.id,
|
|
5315
|
-
index:
|
|
5316
|
-
sheet:
|
|
5317
|
-
}), this._commandService.syncExecuteCommand(
|
|
5327
|
+
index: o,
|
|
5328
|
+
sheet: s
|
|
5329
|
+
}), this._commandService.syncExecuteCommand(H.id, {
|
|
5318
5330
|
unitId: this.id,
|
|
5319
|
-
subUnitId: this._workbook.getSheets()[
|
|
5331
|
+
subUnitId: this._workbook.getSheets()[o].getSheetId()
|
|
5320
5332
|
});
|
|
5321
|
-
const
|
|
5322
|
-
if (!
|
|
5333
|
+
const i = this._workbook.getActiveSheet();
|
|
5334
|
+
if (!i)
|
|
5323
5335
|
throw new Error("No active sheet found");
|
|
5324
|
-
return this._injector.createInstance(S, this, this._workbook,
|
|
5336
|
+
return this._injector.createInstance(S, this, this._workbook, i);
|
|
5325
5337
|
}
|
|
5326
5338
|
/**
|
|
5327
5339
|
* Get a worksheet by sheet id.
|
|
@@ -5368,7 +5380,7 @@ let C = class extends ge {
|
|
|
5368
5380
|
* ```
|
|
5369
5381
|
*/
|
|
5370
5382
|
setActiveSheet(e) {
|
|
5371
|
-
return this._commandService.syncExecuteCommand(
|
|
5383
|
+
return this._commandService.syncExecuteCommand(H.id, {
|
|
5372
5384
|
unitId: this.id,
|
|
5373
5385
|
subUnitId: typeof e == "string" ? e : e.getSheetId()
|
|
5374
5386
|
}), typeof e == "string" ? this.getSheetBySheetId(e) : e;
|
|
@@ -5413,22 +5425,22 @@ let C = class extends ge {
|
|
|
5413
5425
|
* ```
|
|
5414
5426
|
*/
|
|
5415
5427
|
insertSheet(e, t) {
|
|
5416
|
-
var
|
|
5417
|
-
const n =
|
|
5418
|
-
n.name = e, n.id = (
|
|
5419
|
-
const
|
|
5420
|
-
this._commandService.syncExecuteCommand(
|
|
5428
|
+
var o, i, h;
|
|
5429
|
+
const n = fe(Ie.deepClone((o = t == null ? void 0 : t.sheet) != null ? o : {}));
|
|
5430
|
+
n.name = e, n.id = (i = t == null ? void 0 : t.sheet) == null ? void 0 : i.id;
|
|
5431
|
+
const r = (h = t == null ? void 0 : t.index) != null ? h : this._workbook.getSheets().length;
|
|
5432
|
+
this._commandService.syncExecuteCommand(q.id, {
|
|
5421
5433
|
unitId: this.id,
|
|
5422
|
-
index:
|
|
5434
|
+
index: r,
|
|
5423
5435
|
sheet: n
|
|
5424
|
-
}), this._commandService.syncExecuteCommand(
|
|
5436
|
+
}), this._commandService.syncExecuteCommand(H.id, {
|
|
5425
5437
|
unitId: this.id,
|
|
5426
|
-
subUnitId: this._workbook.getSheets()[
|
|
5438
|
+
subUnitId: this._workbook.getSheets()[r].getSheetId()
|
|
5427
5439
|
});
|
|
5428
|
-
const
|
|
5429
|
-
if (!
|
|
5440
|
+
const s = this._workbook.getActiveSheet();
|
|
5441
|
+
if (!s)
|
|
5430
5442
|
throw new Error("No active sheet found");
|
|
5431
|
-
return this._injector.createInstance(S, this, this._workbook,
|
|
5443
|
+
return this._injector.createInstance(S, this, this._workbook, s);
|
|
5432
5444
|
}
|
|
5433
5445
|
/**
|
|
5434
5446
|
* Deletes the specified worksheet.
|
|
@@ -5447,7 +5459,7 @@ let C = class extends ge {
|
|
|
5447
5459
|
*/
|
|
5448
5460
|
deleteSheet(e) {
|
|
5449
5461
|
const t = this.id, n = typeof e == "string" ? e : e.getSheetId();
|
|
5450
|
-
return this._commandService.syncExecuteCommand(
|
|
5462
|
+
return this._commandService.syncExecuteCommand(le.id, {
|
|
5451
5463
|
unitId: t,
|
|
5452
5464
|
subUnitId: n
|
|
5453
5465
|
});
|
|
@@ -5464,7 +5476,7 @@ let C = class extends ge {
|
|
|
5464
5476
|
* ```
|
|
5465
5477
|
*/
|
|
5466
5478
|
undo() {
|
|
5467
|
-
return this._univerInstanceService.focusUnit(this.id), this._commandService.syncExecuteCommand(
|
|
5479
|
+
return this._univerInstanceService.focusUnit(this.id), this._commandService.syncExecuteCommand(it.id), this;
|
|
5468
5480
|
}
|
|
5469
5481
|
/**
|
|
5470
5482
|
* Redo the last undone action.
|
|
@@ -5477,7 +5489,7 @@ let C = class extends ge {
|
|
|
5477
5489
|
* ```
|
|
5478
5490
|
*/
|
|
5479
5491
|
redo() {
|
|
5480
|
-
return this._univerInstanceService.focusUnit(this.id), this._commandService.syncExecuteCommand(
|
|
5492
|
+
return this._univerInstanceService.focusUnit(this.id), this._commandService.syncExecuteCommand(at.id), this;
|
|
5481
5493
|
}
|
|
5482
5494
|
/**
|
|
5483
5495
|
* Callback for command execution.
|
|
@@ -5546,9 +5558,9 @@ let C = class extends ge {
|
|
|
5546
5558
|
* ```
|
|
5547
5559
|
*/
|
|
5548
5560
|
onSelectionChange(e) {
|
|
5549
|
-
return
|
|
5561
|
+
return Ge(
|
|
5550
5562
|
this._selectionManagerService.selectionMoveEnd$.subscribe((t) => {
|
|
5551
|
-
this._univerInstanceService.getCurrentUnitForType(
|
|
5563
|
+
this._univerInstanceService.getCurrentUnitForType(P.UNIVER_SHEET).getUnitId() === this.id && (t != null && t.length ? e(t.map((n) => n.range)) : e([]));
|
|
5552
5564
|
})
|
|
5553
5565
|
);
|
|
5554
5566
|
}
|
|
@@ -5564,7 +5576,7 @@ let C = class extends ge {
|
|
|
5564
5576
|
* ```
|
|
5565
5577
|
*/
|
|
5566
5578
|
setEditable(e) {
|
|
5567
|
-
const t = new
|
|
5579
|
+
const t = new Je(this._workbook.getUnitId());
|
|
5568
5580
|
return this._permissionService.getPermissionPoint(t.id) || this._permissionService.addPermissionPoint(t), this._permissionService.updatePermissionPoint(t.id, e), this;
|
|
5569
5581
|
}
|
|
5570
5582
|
/**
|
|
@@ -5579,16 +5591,16 @@ let C = class extends ge {
|
|
|
5579
5591
|
* ```
|
|
5580
5592
|
*/
|
|
5581
5593
|
setActiveRange(e) {
|
|
5582
|
-
const t = this.getActiveSheet(), n = e.getRange().sheetId || t.getSheetId(),
|
|
5583
|
-
if (!
|
|
5594
|
+
const t = this.getActiveSheet(), n = e.getRange().sheetId || t.getSheetId(), r = n ? this._workbook.getSheetBySheetId(n) : this._workbook.getActiveSheet(!0);
|
|
5595
|
+
if (!r)
|
|
5584
5596
|
throw new Error("No active sheet found");
|
|
5585
|
-
|
|
5586
|
-
const
|
|
5597
|
+
r.getSheetId() !== t.getSheetId() && this.setActiveSheet(this._injector.createInstance(S, this, this._workbook, r));
|
|
5598
|
+
const s = {
|
|
5587
5599
|
unitId: this.getId(),
|
|
5588
5600
|
subUnitId: n,
|
|
5589
|
-
selections: [e].map((
|
|
5601
|
+
selections: [e].map((o) => ({ range: o.getRange(), primary: $(o.getRange(), r), style: null }))
|
|
5590
5602
|
};
|
|
5591
|
-
return this._commandService.syncExecuteCommand(
|
|
5603
|
+
return this._commandService.syncExecuteCommand(ke.id, s), this;
|
|
5592
5604
|
}
|
|
5593
5605
|
/**
|
|
5594
5606
|
* Returns the selected range in the active sheet, or null if there is no active range.
|
|
@@ -5602,8 +5614,8 @@ let C = class extends ge {
|
|
|
5602
5614
|
*/
|
|
5603
5615
|
// could sheet have no active range ?
|
|
5604
5616
|
getActiveRange() {
|
|
5605
|
-
const e = this._workbook.getActiveSheet(), n = this._selectionManagerService.getCurrentSelections().find((
|
|
5606
|
-
return n ? this._injector.createInstance(
|
|
5617
|
+
const e = this._workbook.getActiveSheet(), n = this._selectionManagerService.getCurrentSelections().find((r) => !!r.primary);
|
|
5618
|
+
return n ? this._injector.createInstance(k, this._workbook, e, n.range) : null;
|
|
5607
5619
|
}
|
|
5608
5620
|
/**
|
|
5609
5621
|
* Returns the active cell in this spreadsheet.
|
|
@@ -5615,14 +5627,14 @@ let C = class extends ge {
|
|
|
5615
5627
|
* ```
|
|
5616
5628
|
*/
|
|
5617
5629
|
getActiveCell() {
|
|
5618
|
-
const e = this._workbook.getActiveSheet(), n = this._selectionManagerService.getCurrentSelections().find((
|
|
5630
|
+
const e = this._workbook.getActiveSheet(), n = this._selectionManagerService.getCurrentSelections().find((s) => !!s.primary);
|
|
5619
5631
|
if (!n)
|
|
5620
5632
|
return null;
|
|
5621
|
-
const
|
|
5633
|
+
const r = {
|
|
5622
5634
|
...n.primary,
|
|
5623
|
-
rangeType:
|
|
5635
|
+
rangeType: w.NORMAL
|
|
5624
5636
|
};
|
|
5625
|
-
return this._injector.createInstance(
|
|
5637
|
+
return this._injector.createInstance(k, this._workbook, e, r);
|
|
5626
5638
|
}
|
|
5627
5639
|
/**
|
|
5628
5640
|
* Deletes the currently active sheet.
|
|
@@ -5651,7 +5663,7 @@ let C = class extends ge {
|
|
|
5651
5663
|
* ```
|
|
5652
5664
|
*/
|
|
5653
5665
|
duplicateSheet(e) {
|
|
5654
|
-
return this._commandService.syncExecuteCommand(
|
|
5666
|
+
return this._commandService.syncExecuteCommand(Qt.id, {
|
|
5655
5667
|
unitId: e.getWorkbook().getUnitId(),
|
|
5656
5668
|
subUnitId: e.getSheetId()
|
|
5657
5669
|
}), this._injector.createInstance(S, this, this._workbook, this._workbook.getActiveSheet());
|
|
@@ -5747,7 +5759,7 @@ let C = class extends ge {
|
|
|
5747
5759
|
*/
|
|
5748
5760
|
moveSheet(e, t) {
|
|
5749
5761
|
let n = t;
|
|
5750
|
-
return n < 0 ? n = 0 : n > this._workbook.getSheets().length - 1 && (n = this._workbook.getSheets().length - 1), this._commandService.syncExecuteCommand(
|
|
5762
|
+
return n < 0 ? n = 0 : n > this._workbook.getSheets().length - 1 && (n = this._workbook.getSheets().length - 1), this._commandService.syncExecuteCommand(Xt.id, {
|
|
5751
5763
|
unitId: e.getWorkbook().getUnitId(),
|
|
5752
5764
|
order: n,
|
|
5753
5765
|
subUnitId: e.getSheetId()
|
|
@@ -5779,7 +5791,7 @@ let C = class extends ge {
|
|
|
5779
5791
|
* ```
|
|
5780
5792
|
*/
|
|
5781
5793
|
getPermission() {
|
|
5782
|
-
return this._injector.createInstance(
|
|
5794
|
+
return this._injector.createInstance(Y);
|
|
5783
5795
|
}
|
|
5784
5796
|
/**
|
|
5785
5797
|
* Get the defined name by name.
|
|
@@ -5799,7 +5811,7 @@ let C = class extends ge {
|
|
|
5799
5811
|
*/
|
|
5800
5812
|
getDefinedName(e) {
|
|
5801
5813
|
const t = this._definedNamesService.getValueByName(this.id, e);
|
|
5802
|
-
return t ? this._injector.createInstance(
|
|
5814
|
+
return t ? this._injector.createInstance(K, { ...t, unitId: this.id }) : null;
|
|
5803
5815
|
}
|
|
5804
5816
|
/**
|
|
5805
5817
|
* Get all the defined names in the workbook.
|
|
@@ -5814,7 +5826,7 @@ let C = class extends ge {
|
|
|
5814
5826
|
*/
|
|
5815
5827
|
getDefinedNames() {
|
|
5816
5828
|
const e = this._definedNamesService.getDefinedNameMap(this.id);
|
|
5817
|
-
return e ? Object.values(e).map((t) => this._injector.createInstance(
|
|
5829
|
+
return e ? Object.values(e).map((t) => this._injector.createInstance(K, { ...t, unitId: this.id })) : [];
|
|
5818
5830
|
}
|
|
5819
5831
|
/**
|
|
5820
5832
|
* Insert a defined name.
|
|
@@ -5829,8 +5841,8 @@ let C = class extends ge {
|
|
|
5829
5841
|
* ```
|
|
5830
5842
|
*/
|
|
5831
5843
|
insertDefinedName(e, t) {
|
|
5832
|
-
const
|
|
5833
|
-
return
|
|
5844
|
+
const r = this._injector.createInstance(Q).setName(e).setRef(t).build();
|
|
5845
|
+
return r.localSheetId = O, this.insertDefinedNameBuilder(r), this;
|
|
5834
5846
|
}
|
|
5835
5847
|
/**
|
|
5836
5848
|
* Delete the defined name with the given name.
|
|
@@ -5864,7 +5876,7 @@ let C = class extends ge {
|
|
|
5864
5876
|
* ```
|
|
5865
5877
|
*/
|
|
5866
5878
|
insertDefinedNameBuilder(e) {
|
|
5867
|
-
e.unitId = this.getId(), this._commandService.syncExecuteCommand(
|
|
5879
|
+
e.unitId = this.getId(), this._commandService.syncExecuteCommand(ae.id, e);
|
|
5868
5880
|
}
|
|
5869
5881
|
/**
|
|
5870
5882
|
* Update the defined name with the given name.
|
|
@@ -5888,7 +5900,7 @@ let C = class extends ge {
|
|
|
5888
5900
|
* ```
|
|
5889
5901
|
*/
|
|
5890
5902
|
updateDefinedNameBuilder(e) {
|
|
5891
|
-
this._commandService.syncExecuteCommand(
|
|
5903
|
+
this._commandService.syncExecuteCommand(ae.id, e);
|
|
5892
5904
|
}
|
|
5893
5905
|
/**
|
|
5894
5906
|
* Gets the registered range themes.
|
|
@@ -5902,7 +5914,7 @@ let C = class extends ge {
|
|
|
5902
5914
|
* ```
|
|
5903
5915
|
*/
|
|
5904
5916
|
getRegisteredRangeThemes() {
|
|
5905
|
-
return this._injector.get(
|
|
5917
|
+
return this._injector.get(Qe).getRegisteredRangeThemes();
|
|
5906
5918
|
}
|
|
5907
5919
|
/**
|
|
5908
5920
|
* Register a custom range theme style.
|
|
@@ -5922,7 +5934,7 @@ let C = class extends ge {
|
|
|
5922
5934
|
* ```
|
|
5923
5935
|
*/
|
|
5924
5936
|
registerRangeTheme(e) {
|
|
5925
|
-
this._commandService.syncExecuteCommand(
|
|
5937
|
+
this._commandService.syncExecuteCommand(Zt.id, {
|
|
5926
5938
|
unitId: this.getId(),
|
|
5927
5939
|
rangeThemeStyle: e
|
|
5928
5940
|
});
|
|
@@ -5938,7 +5950,7 @@ let C = class extends ge {
|
|
|
5938
5950
|
* ```
|
|
5939
5951
|
*/
|
|
5940
5952
|
unregisterRangeTheme(e) {
|
|
5941
|
-
this._commandService.syncExecuteCommand(
|
|
5953
|
+
this._commandService.syncExecuteCommand(en.id, {
|
|
5942
5954
|
unitId: this.getId(),
|
|
5943
5955
|
themeName: e
|
|
5944
5956
|
});
|
|
@@ -5962,7 +5974,7 @@ let C = class extends ge {
|
|
|
5962
5974
|
* ```
|
|
5963
5975
|
*/
|
|
5964
5976
|
createRangeThemeStyle(e, t) {
|
|
5965
|
-
return new
|
|
5977
|
+
return new tn(e, t);
|
|
5966
5978
|
}
|
|
5967
5979
|
/**
|
|
5968
5980
|
* Set custom metadata of workbook
|
|
@@ -6067,43 +6079,43 @@ let C = class extends ge {
|
|
|
6067
6079
|
this._workbook.removeStyles(e);
|
|
6068
6080
|
}
|
|
6069
6081
|
};
|
|
6070
|
-
C =
|
|
6071
|
-
R(1,
|
|
6072
|
-
R(2,
|
|
6073
|
-
R(3,
|
|
6074
|
-
R(4,
|
|
6075
|
-
R(5,
|
|
6076
|
-
R(6,
|
|
6077
|
-
R(7,
|
|
6078
|
-
R(8,
|
|
6079
|
-
R(9,
|
|
6082
|
+
C = yn([
|
|
6083
|
+
R(1, g(M)),
|
|
6084
|
+
R(2, g(ht)),
|
|
6085
|
+
R(3, g(tt)),
|
|
6086
|
+
R(4, ie),
|
|
6087
|
+
R(5, _),
|
|
6088
|
+
R(6, ge),
|
|
6089
|
+
R(7, ze),
|
|
6090
|
+
R(8, g(je)),
|
|
6091
|
+
R(9, nt)
|
|
6080
6092
|
], C);
|
|
6081
|
-
class
|
|
6093
|
+
class Un extends $e {
|
|
6082
6094
|
getCommandSheetTarget(e) {
|
|
6083
|
-
var
|
|
6095
|
+
var s;
|
|
6084
6096
|
const t = e.params;
|
|
6085
6097
|
if (!t) return this.getActiveSheet();
|
|
6086
|
-
const n = t.unitId ? this.getUniverSheet(t.unitId) : (
|
|
6098
|
+
const n = t.unitId ? this.getUniverSheet(t.unitId) : (s = this.getActiveWorkbook) == null ? void 0 : s.call(this);
|
|
6087
6099
|
if (!n)
|
|
6088
6100
|
return;
|
|
6089
|
-
const
|
|
6090
|
-
if (
|
|
6091
|
-
return { workbook: n, worksheet:
|
|
6101
|
+
const r = n.getSheetBySheetId(t.subUnitId || t.sheetId) || n.getActiveSheet();
|
|
6102
|
+
if (r)
|
|
6103
|
+
return { workbook: n, worksheet: r };
|
|
6092
6104
|
}
|
|
6093
6105
|
getSheetTarget(e, t) {
|
|
6094
6106
|
const n = this.getUniverSheet(e);
|
|
6095
6107
|
if (!n)
|
|
6096
6108
|
return;
|
|
6097
|
-
const
|
|
6098
|
-
if (
|
|
6099
|
-
return { workbook: n, worksheet:
|
|
6109
|
+
const r = n.getSheetBySheetId(t);
|
|
6110
|
+
if (r)
|
|
6111
|
+
return { workbook: n, worksheet: r };
|
|
6100
6112
|
}
|
|
6101
6113
|
_initWorkbookEvent(e) {
|
|
6102
|
-
const t = e.get(
|
|
6114
|
+
const t = e.get(ie);
|
|
6103
6115
|
this.registerEventHandler(
|
|
6104
6116
|
this.Event.WorkbookDisposed,
|
|
6105
6117
|
() => t.unitDisposed$.subscribe((n) => {
|
|
6106
|
-
n.type ===
|
|
6118
|
+
n.type === P.UNIVER_SHEET && this.fireEvent(this.Event.WorkbookDisposed, {
|
|
6107
6119
|
unitId: n.getUnitId(),
|
|
6108
6120
|
unitType: n.type,
|
|
6109
6121
|
snapshot: n.getSnapshot()
|
|
@@ -6112,13 +6124,13 @@ class pn extends ze {
|
|
|
6112
6124
|
), this.registerEventHandler(
|
|
6113
6125
|
this.Event.WorkbookCreated,
|
|
6114
6126
|
() => t.unitAdded$.subscribe((n) => {
|
|
6115
|
-
if (n.type ===
|
|
6116
|
-
const
|
|
6127
|
+
if (n.type === P.UNIVER_SHEET) {
|
|
6128
|
+
const r = n, s = e.createInstance(C, r);
|
|
6117
6129
|
this.fireEvent(this.Event.WorkbookCreated, {
|
|
6118
6130
|
unitId: n.getUnitId(),
|
|
6119
6131
|
type: n.type,
|
|
6120
|
-
workbook:
|
|
6121
|
-
unit:
|
|
6132
|
+
workbook: s,
|
|
6133
|
+
unit: s
|
|
6122
6134
|
});
|
|
6123
6135
|
}
|
|
6124
6136
|
})
|
|
@@ -6129,18 +6141,18 @@ class pn extends ze {
|
|
|
6129
6141
|
*/
|
|
6130
6142
|
// eslint-disable-next-line max-lines-per-function
|
|
6131
6143
|
_initialize(e) {
|
|
6132
|
-
const t = e.get(
|
|
6144
|
+
const t = e.get(_);
|
|
6133
6145
|
this.registerEventHandler(
|
|
6134
6146
|
this.Event.BeforeSheetCreate,
|
|
6135
6147
|
() => t.beforeCommandExecuted((n) => {
|
|
6136
|
-
var
|
|
6137
|
-
if (n.id ===
|
|
6138
|
-
const
|
|
6148
|
+
var r;
|
|
6149
|
+
if (n.id === q.id) {
|
|
6150
|
+
const s = n.params, { unitId: o, index: i, sheet: h } = s || {}, d = o ? this.getUniverSheet(o) : (r = this.getActiveWorkbook) == null ? void 0 : r.call(this);
|
|
6139
6151
|
if (!d)
|
|
6140
6152
|
return;
|
|
6141
6153
|
const c = {
|
|
6142
6154
|
workbook: d,
|
|
6143
|
-
index:
|
|
6155
|
+
index: i,
|
|
6144
6156
|
sheet: h
|
|
6145
6157
|
};
|
|
6146
6158
|
if (this.fireEvent(this.Event.BeforeSheetCreate, c), c.cancel)
|
|
@@ -6150,14 +6162,14 @@ class pn extends ze {
|
|
|
6150
6162
|
), this.registerEventHandler(
|
|
6151
6163
|
this.Event.BeforeActiveSheetChange,
|
|
6152
6164
|
() => t.beforeCommandExecuted((n) => {
|
|
6153
|
-
var
|
|
6154
|
-
if (n.id ===
|
|
6155
|
-
const { subUnitId:
|
|
6156
|
-
if (!
|
|
6157
|
-
const h =
|
|
6165
|
+
var r;
|
|
6166
|
+
if (n.id === H.id) {
|
|
6167
|
+
const { subUnitId: s, unitId: o } = n.params, i = o ? this.getUniverSheet(o) : (r = this.getActiveWorkbook) == null ? void 0 : r.call(this);
|
|
6168
|
+
if (!i || !s) return;
|
|
6169
|
+
const h = i.getSheetBySheetId(s), d = i.getActiveSheet();
|
|
6158
6170
|
if (!h || !d) return;
|
|
6159
6171
|
const c = {
|
|
6160
|
-
workbook:
|
|
6172
|
+
workbook: i,
|
|
6161
6173
|
activeSheet: h,
|
|
6162
6174
|
oldActiveSheet: d
|
|
6163
6175
|
};
|
|
@@ -6168,141 +6180,141 @@ class pn extends ze {
|
|
|
6168
6180
|
), this.registerEventHandler(
|
|
6169
6181
|
this.Event.BeforeSheetDelete,
|
|
6170
6182
|
() => t.beforeCommandExecuted((n) => {
|
|
6171
|
-
if (n.id ===
|
|
6172
|
-
const
|
|
6173
|
-
if (!
|
|
6174
|
-
const { workbook:
|
|
6175
|
-
workbook:
|
|
6176
|
-
worksheet:
|
|
6183
|
+
if (n.id === le.id) {
|
|
6184
|
+
const r = this.getCommandSheetTarget(n);
|
|
6185
|
+
if (!r) return;
|
|
6186
|
+
const { workbook: s, worksheet: o } = r, i = {
|
|
6187
|
+
workbook: s,
|
|
6188
|
+
worksheet: o
|
|
6177
6189
|
};
|
|
6178
|
-
if (this.fireEvent(this.Event.BeforeSheetDelete,
|
|
6190
|
+
if (this.fireEvent(this.Event.BeforeSheetDelete, i), i.cancel)
|
|
6179
6191
|
throw new f();
|
|
6180
6192
|
}
|
|
6181
6193
|
})
|
|
6182
6194
|
), this.registerEventHandler(
|
|
6183
6195
|
this.Event.BeforeSheetMove,
|
|
6184
6196
|
() => t.beforeCommandExecuted((n) => {
|
|
6185
|
-
if (n.id ===
|
|
6186
|
-
const { fromOrder:
|
|
6187
|
-
if (!
|
|
6188
|
-
const
|
|
6189
|
-
workbook:
|
|
6190
|
-
worksheet:
|
|
6191
|
-
newIndex:
|
|
6192
|
-
oldIndex:
|
|
6197
|
+
if (n.id === De.id) {
|
|
6198
|
+
const { fromOrder: r, toOrder: s } = n.params, o = this.getCommandSheetTarget(n);
|
|
6199
|
+
if (!o) return;
|
|
6200
|
+
const i = {
|
|
6201
|
+
workbook: o.workbook,
|
|
6202
|
+
worksheet: o.worksheet,
|
|
6203
|
+
newIndex: s,
|
|
6204
|
+
oldIndex: r
|
|
6193
6205
|
};
|
|
6194
|
-
if (this.fireEvent(this.Event.BeforeSheetMove,
|
|
6206
|
+
if (this.fireEvent(this.Event.BeforeSheetMove, i), i.cancel)
|
|
6195
6207
|
throw new f();
|
|
6196
6208
|
}
|
|
6197
6209
|
})
|
|
6198
6210
|
), this.registerEventHandler(
|
|
6199
6211
|
this.Event.BeforeSheetNameChange,
|
|
6200
6212
|
() => t.beforeCommandExecuted((n) => {
|
|
6201
|
-
if (n.id ===
|
|
6202
|
-
const { name:
|
|
6203
|
-
if (!
|
|
6204
|
-
const
|
|
6205
|
-
workbook:
|
|
6206
|
-
worksheet:
|
|
6207
|
-
newName:
|
|
6208
|
-
oldName:
|
|
6213
|
+
if (n.id === ue.id) {
|
|
6214
|
+
const { name: r } = n.params, s = this.getCommandSheetTarget(n);
|
|
6215
|
+
if (!s) return;
|
|
6216
|
+
const o = {
|
|
6217
|
+
workbook: s.workbook,
|
|
6218
|
+
worksheet: s.worksheet,
|
|
6219
|
+
newName: r,
|
|
6220
|
+
oldName: s.worksheet.getSheetName()
|
|
6209
6221
|
};
|
|
6210
|
-
if (this.fireEvent(this.Event.BeforeSheetNameChange,
|
|
6222
|
+
if (this.fireEvent(this.Event.BeforeSheetNameChange, o), o.cancel)
|
|
6211
6223
|
throw new f();
|
|
6212
6224
|
}
|
|
6213
6225
|
})
|
|
6214
6226
|
), this.registerEventHandler(
|
|
6215
6227
|
this.Event.BeforeSheetTabColorChange,
|
|
6216
6228
|
() => t.beforeCommandExecuted((n) => {
|
|
6217
|
-
if (n.id ===
|
|
6218
|
-
const { color:
|
|
6219
|
-
if (!
|
|
6220
|
-
const
|
|
6221
|
-
workbook:
|
|
6222
|
-
worksheet:
|
|
6223
|
-
newColor:
|
|
6224
|
-
oldColor:
|
|
6229
|
+
if (n.id === We.id) {
|
|
6230
|
+
const { color: r } = n.params, s = this.getCommandSheetTarget(n);
|
|
6231
|
+
if (!s) return;
|
|
6232
|
+
const o = {
|
|
6233
|
+
workbook: s.workbook,
|
|
6234
|
+
worksheet: s.worksheet,
|
|
6235
|
+
newColor: r,
|
|
6236
|
+
oldColor: s.worksheet.getTabColor()
|
|
6225
6237
|
};
|
|
6226
|
-
if (this.fireEvent(this.Event.BeforeSheetTabColorChange,
|
|
6238
|
+
if (this.fireEvent(this.Event.BeforeSheetTabColorChange, o), o.cancel)
|
|
6227
6239
|
throw new f();
|
|
6228
6240
|
}
|
|
6229
6241
|
})
|
|
6230
6242
|
), this.registerEventHandler(
|
|
6231
6243
|
this.Event.BeforeSheetHideChange,
|
|
6232
6244
|
() => t.beforeCommandExecuted((n) => {
|
|
6233
|
-
if (n.id ===
|
|
6234
|
-
const { hidden:
|
|
6235
|
-
if (!
|
|
6236
|
-
const
|
|
6237
|
-
workbook:
|
|
6238
|
-
worksheet:
|
|
6239
|
-
hidden: !!
|
|
6245
|
+
if (n.id === Be.id) {
|
|
6246
|
+
const { hidden: r } = n.params, s = this.getCommandSheetTarget(n);
|
|
6247
|
+
if (!s) return;
|
|
6248
|
+
const o = {
|
|
6249
|
+
workbook: s.workbook,
|
|
6250
|
+
worksheet: s.worksheet,
|
|
6251
|
+
hidden: !!r
|
|
6240
6252
|
};
|
|
6241
|
-
if (this.fireEvent(this.Event.BeforeSheetHideChange,
|
|
6253
|
+
if (this.fireEvent(this.Event.BeforeSheetHideChange, o), o.cancel)
|
|
6242
6254
|
throw new f();
|
|
6243
6255
|
}
|
|
6244
6256
|
})
|
|
6245
6257
|
), this.registerEventHandler(
|
|
6246
6258
|
this.Event.BeforeGridlineColorChange,
|
|
6247
6259
|
() => t.beforeCommandExecuted((n) => {
|
|
6248
|
-
var
|
|
6249
|
-
if (n.id ===
|
|
6250
|
-
const
|
|
6251
|
-
if (!
|
|
6252
|
-
const
|
|
6253
|
-
...
|
|
6254
|
-
color: (
|
|
6260
|
+
var r;
|
|
6261
|
+
if (n.id === ce.id) {
|
|
6262
|
+
const s = this.getCommandSheetTarget(n);
|
|
6263
|
+
if (!s) return;
|
|
6264
|
+
const o = {
|
|
6265
|
+
...s,
|
|
6266
|
+
color: (r = n.params) == null ? void 0 : r.color
|
|
6255
6267
|
};
|
|
6256
|
-
if (this.fireEvent(this.Event.BeforeGridlineColorChange,
|
|
6268
|
+
if (this.fireEvent(this.Event.BeforeGridlineColorChange, o), o.cancel)
|
|
6257
6269
|
throw new f();
|
|
6258
6270
|
}
|
|
6259
6271
|
})
|
|
6260
6272
|
), this.registerEventHandler(
|
|
6261
6273
|
this.Event.BeforeGridlineEnableChange,
|
|
6262
6274
|
() => t.beforeCommandExecuted((n) => {
|
|
6263
|
-
var
|
|
6264
|
-
if (n.id ===
|
|
6265
|
-
const
|
|
6266
|
-
if (!
|
|
6267
|
-
const
|
|
6268
|
-
...
|
|
6269
|
-
enabled: !!((
|
|
6275
|
+
var r;
|
|
6276
|
+
if (n.id === de.id) {
|
|
6277
|
+
const s = this.getCommandSheetTarget(n);
|
|
6278
|
+
if (!s) return;
|
|
6279
|
+
const o = {
|
|
6280
|
+
...s,
|
|
6281
|
+
enabled: !!((r = n.params) != null && r.showGridlines)
|
|
6270
6282
|
};
|
|
6271
|
-
if (this.fireEvent(this.Event.BeforeGridlineEnableChange,
|
|
6283
|
+
if (this.fireEvent(this.Event.BeforeGridlineEnableChange, o), o.cancel)
|
|
6272
6284
|
throw new f();
|
|
6273
6285
|
}
|
|
6274
6286
|
})
|
|
6275
6287
|
), this.registerEventHandler(
|
|
6276
6288
|
this.Event.SheetValueChanged,
|
|
6277
6289
|
() => t.onCommandExecuted((n) => {
|
|
6278
|
-
if (
|
|
6290
|
+
if (nn.indexOf(n.id) > -1) {
|
|
6279
6291
|
if (!this.getActiveSheet()) return;
|
|
6280
|
-
const
|
|
6281
|
-
(
|
|
6282
|
-
var
|
|
6283
|
-
return (h = (
|
|
6292
|
+
const s = rn(n).map(
|
|
6293
|
+
(o) => {
|
|
6294
|
+
var i, h;
|
|
6295
|
+
return (h = (i = this.getWorkbook(o.unitId)) == null ? void 0 : i.getSheetBySheetId(o.subUnitId)) == null ? void 0 : h.getRange(o.range);
|
|
6284
6296
|
}
|
|
6285
6297
|
).filter(Boolean);
|
|
6286
|
-
if (!
|
|
6298
|
+
if (!s.length) return;
|
|
6287
6299
|
this.fireEvent(this.Event.SheetValueChanged, {
|
|
6288
6300
|
payload: n,
|
|
6289
|
-
effectedRanges:
|
|
6301
|
+
effectedRanges: s
|
|
6290
6302
|
});
|
|
6291
6303
|
}
|
|
6292
6304
|
})
|
|
6293
6305
|
), this.registerEventHandler(
|
|
6294
6306
|
this.Event.SheetCreated,
|
|
6295
6307
|
() => t.onCommandExecuted((n) => {
|
|
6296
|
-
var
|
|
6297
|
-
if (n.id ===
|
|
6298
|
-
const
|
|
6299
|
-
if (!
|
|
6308
|
+
var r;
|
|
6309
|
+
if (n.id === q.id) {
|
|
6310
|
+
const s = n.params, { unitId: o } = s || {}, i = o ? this.getUniverSheet(o) : (r = this.getActiveWorkbook) == null ? void 0 : r.call(this);
|
|
6311
|
+
if (!i)
|
|
6300
6312
|
return;
|
|
6301
|
-
const h =
|
|
6313
|
+
const h = i.getActiveSheet();
|
|
6302
6314
|
if (!h)
|
|
6303
6315
|
return;
|
|
6304
6316
|
const d = {
|
|
6305
|
-
workbook:
|
|
6317
|
+
workbook: i,
|
|
6306
6318
|
worksheet: h
|
|
6307
6319
|
};
|
|
6308
6320
|
this.fireEvent(
|
|
@@ -6314,107 +6326,107 @@ class pn extends ze {
|
|
|
6314
6326
|
), this.registerEventHandler(
|
|
6315
6327
|
this.Event.ActiveSheetChanged,
|
|
6316
6328
|
() => t.onCommandExecuted((n) => {
|
|
6317
|
-
if (n.id ===
|
|
6318
|
-
const
|
|
6319
|
-
if (!
|
|
6320
|
-
const { workbook:
|
|
6321
|
-
this._fireActiveSheetChanged(
|
|
6329
|
+
if (n.id === H.id) {
|
|
6330
|
+
const r = this.getActiveSheet();
|
|
6331
|
+
if (!r) return;
|
|
6332
|
+
const { workbook: s, worksheet: o } = r;
|
|
6333
|
+
this._fireActiveSheetChanged(s, o);
|
|
6322
6334
|
}
|
|
6323
6335
|
})
|
|
6324
6336
|
), this.registerEventHandler(
|
|
6325
6337
|
this.Event.SheetDeleted,
|
|
6326
6338
|
() => t.onCommandExecuted((n) => {
|
|
6327
|
-
var
|
|
6328
|
-
if (n.id ===
|
|
6329
|
-
const { subUnitId:
|
|
6330
|
-
if (!
|
|
6331
|
-
this._fireSheetDeleted(
|
|
6339
|
+
var r;
|
|
6340
|
+
if (n.id === le.id) {
|
|
6341
|
+
const { subUnitId: s, unitId: o } = n.params, i = o ? this.getUniverSheet(o) : (r = this.getActiveWorkbook) == null ? void 0 : r.call(this);
|
|
6342
|
+
if (!i || !s) return;
|
|
6343
|
+
this._fireSheetDeleted(i, s);
|
|
6332
6344
|
}
|
|
6333
6345
|
})
|
|
6334
6346
|
), this.registerEventHandler(
|
|
6335
6347
|
this.Event.SheetMoved,
|
|
6336
6348
|
() => t.onCommandExecuted((n) => {
|
|
6337
|
-
if (n.id ===
|
|
6338
|
-
const { toOrder:
|
|
6339
|
-
if (!
|
|
6340
|
-
this._fireSheetMoved(
|
|
6349
|
+
if (n.id === De.id) {
|
|
6350
|
+
const { toOrder: r } = n.params, s = this.getCommandSheetTarget(n);
|
|
6351
|
+
if (!s) return;
|
|
6352
|
+
this._fireSheetMoved(s.workbook, s.worksheet, r);
|
|
6341
6353
|
}
|
|
6342
6354
|
})
|
|
6343
6355
|
), this.registerEventHandler(
|
|
6344
6356
|
this.Event.SheetNameChanged,
|
|
6345
6357
|
() => t.onCommandExecuted((n) => {
|
|
6346
|
-
if (n.id ===
|
|
6347
|
-
const { name:
|
|
6348
|
-
if (!
|
|
6349
|
-
this._fireSheetNameChanged(
|
|
6358
|
+
if (n.id === ue.id) {
|
|
6359
|
+
const { name: r } = n.params, s = this.getCommandSheetTarget(n);
|
|
6360
|
+
if (!s) return;
|
|
6361
|
+
this._fireSheetNameChanged(s.workbook, s.worksheet, r);
|
|
6350
6362
|
}
|
|
6351
6363
|
})
|
|
6352
6364
|
), this.registerEventHandler(
|
|
6353
6365
|
this.Event.SheetTabColorChanged,
|
|
6354
6366
|
() => t.onCommandExecuted((n) => {
|
|
6355
|
-
if (n.id ===
|
|
6356
|
-
const { color:
|
|
6357
|
-
if (!
|
|
6358
|
-
this._fireSheetTabColorChanged(
|
|
6367
|
+
if (n.id === We.id) {
|
|
6368
|
+
const { color: r } = n.params, s = this.getCommandSheetTarget(n);
|
|
6369
|
+
if (!s) return;
|
|
6370
|
+
this._fireSheetTabColorChanged(s.workbook, s.worksheet, r);
|
|
6359
6371
|
}
|
|
6360
6372
|
})
|
|
6361
6373
|
), this.registerEventHandler(
|
|
6362
6374
|
this.Event.SheetHideChanged,
|
|
6363
6375
|
() => t.onCommandExecuted((n) => {
|
|
6364
|
-
if (n.id ===
|
|
6365
|
-
const { hidden:
|
|
6366
|
-
if (!
|
|
6367
|
-
this._fireSheetHideChanged(
|
|
6376
|
+
if (n.id === Be.id) {
|
|
6377
|
+
const { hidden: r } = n.params, s = this.getCommandSheetTarget(n);
|
|
6378
|
+
if (!s) return;
|
|
6379
|
+
this._fireSheetHideChanged(s.workbook, s.worksheet, !!r);
|
|
6368
6380
|
}
|
|
6369
6381
|
})
|
|
6370
6382
|
), this.registerEventHandler(
|
|
6371
6383
|
this.Event.GridlineChanged,
|
|
6372
6384
|
() => t.onCommandExecuted((n) => {
|
|
6373
|
-
if (n.id ===
|
|
6374
|
-
const
|
|
6375
|
-
if (!
|
|
6385
|
+
if (n.id === ce.id || n.id === de.id) {
|
|
6386
|
+
const r = this.getCommandSheetTarget(n);
|
|
6387
|
+
if (!r) return;
|
|
6376
6388
|
this.fireEvent(this.Event.GridlineChanged, {
|
|
6377
|
-
...
|
|
6378
|
-
enabled: !
|
|
6379
|
-
color:
|
|
6389
|
+
...r,
|
|
6390
|
+
enabled: !r.worksheet.hasHiddenGridLines(),
|
|
6391
|
+
color: r.worksheet.getGridLinesColor()
|
|
6380
6392
|
});
|
|
6381
6393
|
}
|
|
6382
6394
|
})
|
|
6383
6395
|
), this._initWorkbookEvent(e);
|
|
6384
6396
|
}
|
|
6385
6397
|
createUniverSheet(e, t) {
|
|
6386
|
-
const
|
|
6387
|
-
return this._injector.createInstance(C,
|
|
6398
|
+
const r = this._injector.get(ie).createUnit(P.UNIVER_SHEET, e, t);
|
|
6399
|
+
return this._injector.createInstance(C, r);
|
|
6388
6400
|
}
|
|
6389
6401
|
createWorkbook(e, t) {
|
|
6390
6402
|
return this.createUniverSheet(e, t);
|
|
6391
6403
|
}
|
|
6392
6404
|
getActiveWorkbook() {
|
|
6393
|
-
const e = this._univerInstanceService.getCurrentUnitForType(
|
|
6405
|
+
const e = this._univerInstanceService.getCurrentUnitForType(P.UNIVER_SHEET);
|
|
6394
6406
|
return e ? this._injector.createInstance(C, e) : null;
|
|
6395
6407
|
}
|
|
6396
6408
|
getActiveUniverSheet() {
|
|
6397
6409
|
return this.getActiveWorkbook();
|
|
6398
6410
|
}
|
|
6399
6411
|
getUniverSheet(e) {
|
|
6400
|
-
const t = this._univerInstanceService.getUnit(e,
|
|
6412
|
+
const t = this._univerInstanceService.getUnit(e, P.UNIVER_SHEET);
|
|
6401
6413
|
return t ? this._injector.createInstance(C, t) : null;
|
|
6402
6414
|
}
|
|
6403
6415
|
getWorkbook(e) {
|
|
6404
6416
|
return this.getUniverSheet(e);
|
|
6405
6417
|
}
|
|
6406
6418
|
getPermission() {
|
|
6407
|
-
return this._injector.createInstance(
|
|
6419
|
+
return this._injector.createInstance(Y);
|
|
6408
6420
|
}
|
|
6409
6421
|
onUniverSheetCreated(e) {
|
|
6410
|
-
const t = this._univerInstanceService.getTypeOfUnitAdded$(
|
|
6411
|
-
const
|
|
6412
|
-
e(
|
|
6422
|
+
const t = this._univerInstanceService.getTypeOfUnitAdded$(P.UNIVER_SHEET).subscribe((n) => {
|
|
6423
|
+
const r = this._injector.createInstance(C, n);
|
|
6424
|
+
e(r);
|
|
6413
6425
|
});
|
|
6414
|
-
return
|
|
6426
|
+
return Ge(t);
|
|
6415
6427
|
}
|
|
6416
6428
|
newDefinedName() {
|
|
6417
|
-
return this._injector.createInstance(
|
|
6429
|
+
return this._injector.createInstance(Q);
|
|
6418
6430
|
}
|
|
6419
6431
|
getActiveSheet() {
|
|
6420
6432
|
const e = this.getActiveWorkbook();
|
|
@@ -6424,7 +6436,7 @@ class pn extends ze {
|
|
|
6424
6436
|
return t ? { workbook: e, worksheet: t } : null;
|
|
6425
6437
|
}
|
|
6426
6438
|
setFreezeSync(e) {
|
|
6427
|
-
this._injector.get(
|
|
6439
|
+
this._injector.get(sn).setEnabled(e);
|
|
6428
6440
|
}
|
|
6429
6441
|
_fireActiveSheetChanged(e, t) {
|
|
6430
6442
|
this.fireEvent(this.Event.ActiveSheetChanged, {
|
|
@@ -6467,20 +6479,20 @@ class pn extends ze {
|
|
|
6467
6479
|
});
|
|
6468
6480
|
}
|
|
6469
6481
|
}
|
|
6470
|
-
|
|
6471
|
-
class
|
|
6482
|
+
$e.extend(Un);
|
|
6483
|
+
class Pn {
|
|
6472
6484
|
get SheetValueChangeType() {
|
|
6473
|
-
return
|
|
6485
|
+
return on;
|
|
6474
6486
|
}
|
|
6475
6487
|
get SheetSkeletonChangeType() {
|
|
6476
|
-
return
|
|
6488
|
+
return an;
|
|
6477
6489
|
}
|
|
6478
6490
|
get SplitDelimiterType() {
|
|
6479
|
-
return
|
|
6491
|
+
return hn;
|
|
6480
6492
|
}
|
|
6481
6493
|
}
|
|
6482
|
-
|
|
6483
|
-
class
|
|
6494
|
+
dt.extend(Pn);
|
|
6495
|
+
class xn {
|
|
6484
6496
|
get SheetCreated() {
|
|
6485
6497
|
return "SheetCreated";
|
|
6486
6498
|
}
|
|
@@ -6542,27 +6554,27 @@ class yn {
|
|
|
6542
6554
|
return "SheetValueChanged";
|
|
6543
6555
|
}
|
|
6544
6556
|
}
|
|
6545
|
-
|
|
6546
|
-
var
|
|
6547
|
-
for (var
|
|
6548
|
-
(
|
|
6549
|
-
return
|
|
6550
|
-
},
|
|
6551
|
-
let
|
|
6552
|
-
constructor(
|
|
6553
|
-
super(), this._injector =
|
|
6557
|
+
ct.extend(xn);
|
|
6558
|
+
var Mn = Object.getOwnPropertyDescriptor, Nn = (a, e, t, n) => {
|
|
6559
|
+
for (var r = n > 1 ? void 0 : n ? Mn(e, t) : e, s = a.length - 1, o; s >= 0; s--)
|
|
6560
|
+
(o = a[s]) && (r = o(r) || r);
|
|
6561
|
+
return r;
|
|
6562
|
+
}, Tn = (a, e) => (t, n) => e(t, n, a);
|
|
6563
|
+
let He = class extends me {
|
|
6564
|
+
constructor(a) {
|
|
6565
|
+
super(), this._injector = a;
|
|
6554
6566
|
}
|
|
6555
6567
|
};
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
],
|
|
6568
|
+
He = Nn([
|
|
6569
|
+
Tn(0, g(M))
|
|
6570
|
+
], He);
|
|
6559
6571
|
export {
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6572
|
+
Y as FPermission,
|
|
6573
|
+
k as FRange,
|
|
6574
|
+
J as FSelection,
|
|
6575
|
+
xn as FSheetEventName,
|
|
6576
|
+
He as FSheetHooks,
|
|
6577
|
+
Pn as FSheetsEnum,
|
|
6566
6578
|
C as FWorkbook,
|
|
6567
6579
|
S as FWorksheet
|
|
6568
6580
|
};
|