@univerjs/sheets 0.15.2 → 0.15.3-insiders.20260131-cbd5fac
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/cjs/index.js +3 -3
- package/lib/cjs/locale/sk-SK.js +1 -0
- package/lib/es/facade.js +603 -531
- package/lib/es/index.js +2869 -2776
- package/lib/es/locale/sk-SK.js +17 -0
- package/lib/facade.js +603 -531
- package/lib/index.js +2869 -2776
- package/lib/locale/sk-SK.js +17 -0
- package/lib/types/commands/commands/insert-range-move-down.command.d.ts +1 -1
- package/lib/types/commands/commands/insert-range-move-right.command.d.ts +1 -1
- package/lib/types/commands/commands/text-to-number.command.d.ts +9 -0
- package/lib/types/facade/f-worksheet.d.ts +24 -0
- package/lib/types/index.d.ts +3 -2
- package/lib/types/locale/sk-SK.d.ts +3 -0
- package/lib/types/services/ref-range/type.d.ts +4 -4
- package/lib/types/services/ref-range/util.d.ts +11 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +3 -3
- package/lib/umd/locale/sk-SK.js +1 -0
- package/package.json +8 -8
- package/LICENSE +0 -176
package/lib/facade.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var w = (r, e, t) =>
|
|
4
|
-
import { Inject as l, Injector as
|
|
5
|
-
import { FBase as Fe, FBaseInitialable as He, FUniver as
|
|
6
|
-
import { WorksheetProtectionRuleModel as $e, RangeProtectionRuleModel as ie, WorksheetProtectionPointModel as ze, SetDefinedNameCommand as
|
|
7
|
-
import {
|
|
8
|
-
import { BehaviorSubject as ge, Subject as
|
|
9
|
-
import { filter as
|
|
10
|
-
var
|
|
11
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1
|
+
var Ot = Object.defineProperty;
|
|
2
|
+
var Tt = (r, e, t) => e in r ? Ot(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var w = (r, e, t) => Tt(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { Inject as l, Injector as E, IAuthzIoService as re, LocaleService as bt, generateRandomId as It, ICommandService as C, IPermissionService as Y, Rectangle as $, cellToRange as Vt, HorizontalAlign as K, VerticalAlign as J, RANGE_TYPE as p, ILogService as ft, Direction as oe, generateIntervalsByPoints as qe, BooleanNumber as I, WrapStrategy as ue, ObjectMatrix as Ie, covertCellValue as xe, TextStyleValue as Ye, RichTextValue as L, DEFAULT_STYLES as Ze, covertCellValues as Qe, Dimension as G, isNullCell as Q, mergeWorksheetSnapshotWithDefault as Xe, Tools as et, UndoCommand as At, RedoCommand as Bt, toDisposable as vt, UniverInstanceType as F, IResourceLoaderService as Ft, IUniverInstanceService as Me, CanceledError as D } from "@univerjs/core";
|
|
5
|
+
import { FBase as Fe, FBaseInitialable as He, FUniver as Rt, FEnum as Ht, FEventName as $t } from "@univerjs/core/facade";
|
|
6
|
+
import { WorksheetProtectionRuleModel as $e, RangeProtectionRuleModel as ie, WorksheetProtectionPointModel as ze, SetDefinedNameCommand as De, SCOPE_WORKBOOK_VALUE_DEFINED_NAME as ne, RemoveDefinedNameCommand as zt, WorkbookPermissionService as Lt, PermissionPointsDefinitions as Gt, WorkbookEditablePermission as Le, UnitObject as A, AddWorksheetProtectionMutation as Kt, DeleteWorksheetProtectionMutation as Jt, getAllWorksheetPermissionPoint as qt, getAllWorksheetPermissionPointByPointPanel as tt, SetWorksheetPermissionPointsMutation as Yt, AddRangeProtectionMutation as pt, ViewStateEnum as U, EditStateEnum as x, DeleteRangeProtectionMutation as yt, SetRangeProtectionMutation as Pt, WorksheetEditPermission as Et, WorksheetViewPermission as Ut, getPrimaryForRange as le, SetSelectionsOperation as Ge, getNextPrimaryCell as Zt, WorkbookCopySheetPermission as Qt, WorkbookDeleteColumnPermission as Xt, WorkbookDeleteRowPermission as es, WorkbookInsertColumnPermission as ts, WorkbookInsertRowPermission as ss, WorkbookCreateProtectPermission as ns, WorkbookRecoverHistoryPermission as rs, WorkbookHistoryPermission as is, WorkbookViewHistoryPermission as os, WorkbookHideSheetPermission as as, WorkbookMoveSheetPermission as hs, WorkbookRenameSheetPermission as ds, WorkbookDeleteSheetPermission as cs, WorkbookCreateSheetPermission as us, WorkbookManageCollaboratorPermission as ls, WorkbookCommentPermission as ms, WorkbookDuplicatePermission as gs, WorkbookCopyPermission as _s, WorkbookSharePermission as ws, WorkbookExportPermission as Ss, WorkbookPrintPermission as ks, WorkbookViewPermission as Cs, WorksheetSelectUnProtectedCellsPermission as bs, WorksheetSelectProtectedCellsPermission as Is, WorksheetDeleteProtectionPermission as fs, WorksheetManageCollaboratorPermission as vs, WorksheetEditExtraObjectPermission as Rs, WorksheetInsertHyperlinkPermission as ps, WorksheetPivotTablePermission as ys, WorksheetFilterPermission as Ps, WorksheetSortPermission as Es, WorksheetDeleteColumnPermission as Us, WorksheetDeleteRowPermission as xs, WorksheetInsertColumnPermission as Ms, WorksheetInsertRowPermission as Ds, WorksheetSetColumnStylePermission as Ws, WorksheetSetRowStylePermission as js, WorksheetSetCellStylePermission as Ns, WorksheetSetCellValuePermission as Os, WorksheetCopyPermission as Ts, RangeProtectionPermissionDeleteProtectionPoint as Vs, RangeProtectionPermissionManageCollaPoint as As, RangeProtectionPermissionViewPoint as Bs, RangeProtectionPermissionEditPoint as Fs, SheetsSelectionsService as xt, SetWorksheetDefaultStyleMutation as Hs, SetColDataCommand as st, SetRowDataCommand as nt, copyRangeStyles as ae, InsertRowByRangeCommand as rt, RemoveRowByRangeCommand as $s, MoveRowsCommand as zs, SetRowHiddenCommand as it, SetSpecificRowsVisibleCommand as ot, SetTextWrapCommand as We, SetWorksheetRowIsAutoHeightMutation as Ls, SetRowHeightCommand as at, SetWorksheetRowIsAutoHeightCommand as fe, InsertColByRangeCommand as ht, RemoveColByRangeCommand as Gs, MoveColsCommand as Ks, SetColHiddenCommand as dt, SetSpecificColsVisibleCommand as ct, SetColWidthCommand as Js, SetFrozenCommand as ve, CancelFrozenCommand as qs, ToggleGridlinesCommand as je, SetGridlinesColorCommand as Ne, SetTabColorCommand as Ys, SetRangeValuesMutation as ut, SetWorksheetHideCommand as Zs, SetWorksheetShowCommand as Qs, SetWorksheetNameCommand as Oe, ClearSelectionAllCommand as Mt, ClearSelectionContentCommand as Dt, ClearSelectionFormatCommand as Wt, AppendRowCommand as Xs, SetWorksheetRowCountCommand as en, SetWorksheetColumnCountCommand as tn, SetRangeCustomMetadataCommand as lt, SetBorderBasicCommand as sn, SetStyleCommand as T, SetTextRotationCommand as nn, SetRangeValuesCommand as X, SetVerticalTextAlignCommand as rn, SetHorizontalTextAlignCommand as on, addMergeCellsUtil as Re, getAddMergeMutationRangeByType as mt, RemoveWorksheetMergeCommand as an, SplitTextToColumnsCommand as hn, SetWorksheetRangeThemeStyleCommand as dn, DeleteWorksheetRangeThemeStyleCommand as cn, SheetRangeThemeService as jt, InsertRangeMoveDownCommand as un, InsertRangeMoveRightCommand as ln, DeleteRangeMoveUpCommand as mn, DeleteRangeMoveLeftCommand as gn, SetWorkbookNameCommand as _n, InsertSheetCommand as me, SetWorksheetActiveOperation as te, RemoveSheetCommand as Te, CopySheetCommand as wn, SetWorksheetOrderCommand as Sn, RegisterWorksheetRangeThemeStyleCommand as kn, UnregisterWorksheetRangeThemeStyleCommand as Cn, RangeThemeStyle as bn, SetWorksheetOrderMutation as gt, SetTabColorMutation as _t, SetWorksheetHideMutation as wt, COMMAND_LISTENER_VALUE_CHANGE as In, getValueChangedEffectedRange as fn, SheetsFreezeSyncController as vn, SheetValueChangeType as Rn, SheetSkeletonChangeType as pn, SplitDelimiterEnum as yn } from "@univerjs/sheets";
|
|
7
|
+
import { serializeRange as Ke, IDefinedNamesService as Nt, deserializeRangeWithSheet as Pn, serializeRangeWithSheet as En, FormulaDataModel as Un } from "@univerjs/engine-formula";
|
|
8
|
+
import { BehaviorSubject as ge, Subject as xn } from "rxjs";
|
|
9
|
+
import { filter as M, distinctUntilChanged as _e, shareReplay as N, map as we } from "rxjs/operators";
|
|
10
|
+
var Mn = Object.getOwnPropertyDescriptor, Dn = (r, e, t, s) => {
|
|
11
|
+
for (var n = s > 1 ? void 0 : s ? Mn(e, t) : e, i = r.length - 1, o; i >= 0; i--)
|
|
12
12
|
(o = r[i]) && (n = o(n) || n);
|
|
13
13
|
return n;
|
|
14
14
|
}, W = (r, e) => (t, s) => e(t, s, r);
|
|
15
|
-
function
|
|
15
|
+
function Wn(r, e, t) {
|
|
16
16
|
const s = t.getDefinedNameMap(r);
|
|
17
17
|
if (s == null)
|
|
18
18
|
return e.t("definedName.defaultName") + 1;
|
|
@@ -31,7 +31,7 @@ class Ce {
|
|
|
31
31
|
constructor() {
|
|
32
32
|
w(this, "_definedNameParam");
|
|
33
33
|
this._definedNameParam = {
|
|
34
|
-
id:
|
|
34
|
+
id: It(10),
|
|
35
35
|
unitId: "",
|
|
36
36
|
name: "",
|
|
37
37
|
formulaOrRefString: "",
|
|
@@ -235,7 +235,7 @@ let Se = class extends Fe {
|
|
|
235
235
|
super(), this._definedNameParam = r, this._injector = e, this._commandService = t, this._permissionService = s, this._worksheetProtectionRuleModel = n, this._rangeProtectionRuleModel = i, this._worksheetProtectionPointRuleModel = o, this._authzIoService = a, this._localeService = h, this._definedNamesService = c;
|
|
236
236
|
}
|
|
237
237
|
_apply() {
|
|
238
|
-
this._definedNameParam.name === "" && (this._definedNameParam.name =
|
|
238
|
+
this._definedNameParam.name === "" && (this._definedNameParam.name = Wn(this._definedNameParam.unitId, this._localeService, this._definedNamesService)), this._commandService.syncExecuteCommand(De.id, this._definedNameParam);
|
|
239
239
|
}
|
|
240
240
|
/**
|
|
241
241
|
* Gets the name of the defined name.
|
|
@@ -400,7 +400,7 @@ let Se = class extends Fe {
|
|
|
400
400
|
* ```
|
|
401
401
|
*/
|
|
402
402
|
delete() {
|
|
403
|
-
this._commandService.syncExecuteCommand(
|
|
403
|
+
this._commandService.syncExecuteCommand(zt.id, this._definedNameParam);
|
|
404
404
|
}
|
|
405
405
|
/**
|
|
406
406
|
* Gets the local sheet id of the defined name.
|
|
@@ -450,18 +450,18 @@ let Se = class extends Fe {
|
|
|
450
450
|
}
|
|
451
451
|
};
|
|
452
452
|
Se = Dn([
|
|
453
|
-
W(1, l(
|
|
453
|
+
W(1, l(E)),
|
|
454
454
|
W(2, C),
|
|
455
455
|
W(3, Y),
|
|
456
456
|
W(4, l($e)),
|
|
457
457
|
W(5, l(ie)),
|
|
458
458
|
W(6, l(ze)),
|
|
459
459
|
W(7, l(re)),
|
|
460
|
-
W(8, l(
|
|
461
|
-
W(9,
|
|
460
|
+
W(8, l(bt)),
|
|
461
|
+
W(9, Nt)
|
|
462
462
|
], Se);
|
|
463
|
-
var H = /* @__PURE__ */ ((r) => (r[r.Reader = 0] = "Reader", r[r.Editor = 1] = "Editor", r[r.Owner = 2] = "Owner", r))(H || {}), u = /* @__PURE__ */ ((r) => (r.Edit = "WorkbookEdit", r.View = "WorkbookView", r.Print = "WorkbookPrint", r.Export = "WorkbookExport", r.Share = "WorkbookShare", r.CopyContent = "WorkbookCopy", r.DuplicateFile = "WorkbookDuplicate", r.Comment = "WorkbookComment", r.ManageCollaborator = "WorkbookManageCollaborator", r.CreateSheet = "WorkbookCreateSheet", r.DeleteSheet = "WorkbookDeleteSheet", r.RenameSheet = "WorkbookRenameSheet", r.MoveSheet = "WorkbookMoveSheet", r.HideSheet = "WorkbookHideSheet", r.ViewHistory = "WorkbookViewHistory", r.ManageHistory = "WorkbookHistory", r.RecoverHistory = "WorkbookRecoverHistory", r.CreateProtection = "WorkbookCreateProtect", r.InsertRow = "WorkbookInsertRow", r.InsertColumn = "WorkbookInsertColumn", r.DeleteRow = "WorkbookDeleteRow", r.DeleteColumn = "WorkbookDeleteColumn", r.CopySheet = "WorkbookCopySheet", r))(u || {}), _ = /* @__PURE__ */ ((r) => (r.Edit = "WorksheetEdit", r.View = "WorksheetView", r.Copy = "WorksheetCopy", r.SetCellValue = "WorksheetSetCellValue", r.SetCellStyle = "WorksheetSetCellStyle", r.SetRowStyle = "WorksheetSetRowStyle", r.SetColumnStyle = "WorksheetSetColumnStyle", r.InsertRow = "WorksheetInsertRow", r.InsertColumn = "WorksheetInsertColumn", r.DeleteRow = "WorksheetDeleteRow", r.DeleteColumn = "WorksheetDeleteColumn", r.Sort = "WorksheetSort", r.Filter = "WorksheetFilter", r.PivotTable = "WorksheetPivotTable", r.InsertHyperlink = "WorksheetInsertHyperlink", r.EditExtraObject = "WorksheetEditExtraObject", r.ManageCollaborator = "WorksheetManageCollaborator", r.DeleteProtection = "WorksheetDeleteProtection", r.SelectProtectedCells = "WorksheetSelectProtectedCells", r.SelectUnProtectedCells = "WorksheetSelectUnProtectedCells", r))(_ || {}), b = /* @__PURE__ */ ((r) => (r.Edit = "RangeEdit", r.View = "RangeView", r.ManageCollaborator = "RangeManageCollaborator", r.Delete = "RangeDeleteProtection", r))(b || {}),
|
|
464
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
463
|
+
var H = /* @__PURE__ */ ((r) => (r[r.Reader = 0] = "Reader", r[r.Editor = 1] = "Editor", r[r.Owner = 2] = "Owner", r))(H || {}), u = /* @__PURE__ */ ((r) => (r.Edit = "WorkbookEdit", r.View = "WorkbookView", r.Print = "WorkbookPrint", r.Export = "WorkbookExport", r.Share = "WorkbookShare", r.CopyContent = "WorkbookCopy", r.DuplicateFile = "WorkbookDuplicate", r.Comment = "WorkbookComment", r.ManageCollaborator = "WorkbookManageCollaborator", r.CreateSheet = "WorkbookCreateSheet", r.DeleteSheet = "WorkbookDeleteSheet", r.RenameSheet = "WorkbookRenameSheet", r.MoveSheet = "WorkbookMoveSheet", r.HideSheet = "WorkbookHideSheet", r.ViewHistory = "WorkbookViewHistory", r.ManageHistory = "WorkbookHistory", r.RecoverHistory = "WorkbookRecoverHistory", r.CreateProtection = "WorkbookCreateProtect", r.InsertRow = "WorkbookInsertRow", r.InsertColumn = "WorkbookInsertColumn", r.DeleteRow = "WorkbookDeleteRow", r.DeleteColumn = "WorkbookDeleteColumn", r.CopySheet = "WorkbookCopySheet", r))(u || {}), _ = /* @__PURE__ */ ((r) => (r.Edit = "WorksheetEdit", r.View = "WorksheetView", r.Copy = "WorksheetCopy", r.SetCellValue = "WorksheetSetCellValue", r.SetCellStyle = "WorksheetSetCellStyle", r.SetRowStyle = "WorksheetSetRowStyle", r.SetColumnStyle = "WorksheetSetColumnStyle", r.InsertRow = "WorksheetInsertRow", r.InsertColumn = "WorksheetInsertColumn", r.DeleteRow = "WorksheetDeleteRow", r.DeleteColumn = "WorksheetDeleteColumn", r.Sort = "WorksheetSort", r.Filter = "WorksheetFilter", r.PivotTable = "WorksheetPivotTable", r.InsertHyperlink = "WorksheetInsertHyperlink", r.EditExtraObject = "WorksheetEditExtraObject", r.ManageCollaborator = "WorksheetManageCollaborator", r.DeleteProtection = "WorksheetDeleteProtection", r.SelectProtectedCells = "WorksheetSelectProtectedCells", r.SelectUnProtectedCells = "WorksheetSelectUnProtectedCells", r))(_ || {}), b = /* @__PURE__ */ ((r) => (r.Edit = "RangeEdit", r.View = "RangeView", r.ManageCollaborator = "RangeManageCollaborator", r.Delete = "RangeDeleteProtection", r))(b || {}), jn = Object.getOwnPropertyDescriptor, Nn = (r, e, t, s) => {
|
|
464
|
+
for (var n = s > 1 ? void 0 : s ? jn(e, t) : e, i = r.length - 1, o; i >= 0; i--)
|
|
465
465
|
(o = r[i]) && (n = o(n) || n);
|
|
466
466
|
return n;
|
|
467
467
|
}, V = (r, e) => (t, s) => e(t, s, r);
|
|
@@ -471,7 +471,7 @@ let z = class extends Fe {
|
|
|
471
471
|
/**
|
|
472
472
|
* Permission point definition, can read the point constructor want to modify from here
|
|
473
473
|
*/
|
|
474
|
-
w(this, "permissionPointsDefinition",
|
|
474
|
+
w(this, "permissionPointsDefinition", Gt);
|
|
475
475
|
/**
|
|
476
476
|
* An observable object used to monitor permission change events within a range, thereby triggering corresponding subsequent processing.
|
|
477
477
|
*/
|
|
@@ -601,7 +601,7 @@ let z = class extends Fe {
|
|
|
601
601
|
scope: void 0
|
|
602
602
|
}
|
|
603
603
|
});
|
|
604
|
-
if (this._commandService.syncExecuteCommand(
|
|
604
|
+
if (this._commandService.syncExecuteCommand(Kt.id, {
|
|
605
605
|
unitId: e,
|
|
606
606
|
subUnitId: t,
|
|
607
607
|
rule: {
|
|
@@ -629,10 +629,10 @@ let z = class extends Fe {
|
|
|
629
629
|
* ```
|
|
630
630
|
*/
|
|
631
631
|
removeWorksheetPermission(e, t) {
|
|
632
|
-
this._commandService.syncExecuteCommand(
|
|
632
|
+
this._commandService.syncExecuteCommand(Jt.id, {
|
|
633
633
|
unitId: e,
|
|
634
634
|
subUnitId: t
|
|
635
|
-
}), [...
|
|
635
|
+
}), [...qt(), ...tt()].forEach((s) => {
|
|
636
636
|
const n = new s(e, t);
|
|
637
637
|
this._permissionService.updatePermissionPoint(n.id, !0);
|
|
638
638
|
}), this._worksheetProtectionPointRuleModel.deleteRule(e, t);
|
|
@@ -662,7 +662,7 @@ let z = class extends Fe {
|
|
|
662
662
|
async setWorksheetPermissionPoint(e, t, s, n) {
|
|
663
663
|
const i = this._worksheetProtectionRuleModel.getRule(e, t);
|
|
664
664
|
let o;
|
|
665
|
-
if (s === Et || s ===
|
|
665
|
+
if (s === Et || s === Ut)
|
|
666
666
|
i ? o = i.permissionId : o = await this.addWorksheetBasePermission(e, t);
|
|
667
667
|
else {
|
|
668
668
|
const d = this._worksheetProtectionPointRuleModel.getRule(e, t);
|
|
@@ -675,7 +675,7 @@ let z = class extends Fe {
|
|
|
675
675
|
name: "",
|
|
676
676
|
scope: void 0
|
|
677
677
|
}
|
|
678
|
-
}), this._commandService.syncExecuteCommand(
|
|
678
|
+
}), this._commandService.syncExecuteCommand(Yt.id, { unitId: e, subUnitId: t, rule: { unitId: e, subUnitId: t, permissionId: o } }));
|
|
679
679
|
}
|
|
680
680
|
const h = new s(e, t);
|
|
681
681
|
if (this._permissionService.getPermissionPoint(h.id) || this._permissionService.addPermissionPoint(h), o) {
|
|
@@ -791,7 +791,7 @@ let z = class extends Fe {
|
|
|
791
791
|
name: (n == null ? void 0 : n.name) || "",
|
|
792
792
|
scope: void 0
|
|
793
793
|
}
|
|
794
|
-
}), a = `ruleId_${
|
|
794
|
+
}), a = `ruleId_${It(6)}`;
|
|
795
795
|
if (this._rangeProtectionRuleModel.getSubunitRuleList(e, t).some((k) => k.ranges.some((f) => s.some((be) => $.intersects(be.getRange(), f)))))
|
|
796
796
|
throw new Error("range protection cannot intersect");
|
|
797
797
|
const d = this._determineRangeViewState(n), m = this._determineRangeEditState(n), g = {
|
|
@@ -809,7 +809,7 @@ let z = class extends Fe {
|
|
|
809
809
|
editState: m
|
|
810
810
|
}]
|
|
811
811
|
};
|
|
812
|
-
if (this._commandService.syncExecuteCommand(
|
|
812
|
+
if (this._commandService.syncExecuteCommand(pt.id, g))
|
|
813
813
|
return {
|
|
814
814
|
permissionId: o,
|
|
815
815
|
ruleId: a
|
|
@@ -859,11 +859,11 @@ let z = class extends Fe {
|
|
|
859
859
|
* ```
|
|
860
860
|
*/
|
|
861
861
|
removeRangeProtection(e, t, s) {
|
|
862
|
-
this._commandService.syncExecuteCommand(
|
|
862
|
+
this._commandService.syncExecuteCommand(yt.id, {
|
|
863
863
|
unitId: e,
|
|
864
864
|
subUnitId: t,
|
|
865
865
|
ruleIds: s
|
|
866
|
-
}) && this._rangeProtectionRuleModel.getSubunitRuleList(e, t).length === 0 && (this._worksheetProtectionPointRuleModel.deleteRule(e, t), [...
|
|
866
|
+
}) && this._rangeProtectionRuleModel.getSubunitRuleList(e, t).length === 0 && (this._worksheetProtectionPointRuleModel.deleteRule(e, t), [...tt()].forEach((o) => {
|
|
867
867
|
const a = new o(e, t);
|
|
868
868
|
this._permissionService.updatePermissionPoint(a.id, a.value);
|
|
869
869
|
}));
|
|
@@ -931,7 +931,7 @@ let z = class extends Fe {
|
|
|
931
931
|
if (i) {
|
|
932
932
|
if (this._rangeProtectionRuleModel.getSubunitRuleList(e, t).filter((h) => h.id !== s).some((h) => h.ranges.some((c) => n.some((d) => $.intersects(d.getRange(), c)))))
|
|
933
933
|
throw new Error("range protection cannot intersect");
|
|
934
|
-
this._commandService.syncExecuteCommand(
|
|
934
|
+
this._commandService.syncExecuteCommand(Pt.id, {
|
|
935
935
|
unitId: e,
|
|
936
936
|
subUnitId: t,
|
|
937
937
|
ruleId: s,
|
|
@@ -980,7 +980,7 @@ let z = class extends Fe {
|
|
|
980
980
|
* ```
|
|
981
981
|
*/
|
|
982
982
|
getPermissionInfoWithCell(e, t, s, n) {
|
|
983
|
-
const i =
|
|
983
|
+
const i = Vt(s, n), o = this._rangeProtectionRuleModel.getSubunitRuleList(e, t).find((a) => a.ranges.some((c) => $.intersects(i, c)));
|
|
984
984
|
if (o)
|
|
985
985
|
return {
|
|
986
986
|
permissionId: o.permissionId,
|
|
@@ -988,21 +988,21 @@ let z = class extends Fe {
|
|
|
988
988
|
};
|
|
989
989
|
}
|
|
990
990
|
};
|
|
991
|
-
z =
|
|
992
|
-
V(0, l(
|
|
991
|
+
z = Nn([
|
|
992
|
+
V(0, l(E)),
|
|
993
993
|
V(1, C),
|
|
994
994
|
V(2, Y),
|
|
995
995
|
V(3, l($e)),
|
|
996
996
|
V(4, l(ie)),
|
|
997
997
|
V(5, l(ze)),
|
|
998
|
-
V(6, l(
|
|
998
|
+
V(6, l(Lt)),
|
|
999
999
|
V(7, l(re))
|
|
1000
1000
|
], z);
|
|
1001
|
-
var
|
|
1002
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1001
|
+
var On = Object.getOwnPropertyDescriptor, Tn = (r, e, t, s) => {
|
|
1002
|
+
for (var n = s > 1 ? void 0 : s ? On(e, t) : e, i = r.length - 1, o; i >= 0; i--)
|
|
1003
1003
|
(o = r[i]) && (n = o(n) || n);
|
|
1004
1004
|
return n;
|
|
1005
|
-
},
|
|
1005
|
+
}, Vn = (r, e) => (t, s) => e(t, s, r);
|
|
1006
1006
|
let ke = class {
|
|
1007
1007
|
constructor(r, e, t, s) {
|
|
1008
1008
|
this._workbook = r, this._worksheet = e, this._selections = t, this._injector = s;
|
|
@@ -1074,7 +1074,7 @@ let ke = class {
|
|
|
1074
1074
|
* ```
|
|
1075
1075
|
*/
|
|
1076
1076
|
getActiveSheet() {
|
|
1077
|
-
const r = this._injector.createInstance(
|
|
1077
|
+
const r = this._injector.createInstance(P, this._workbook);
|
|
1078
1078
|
return this._injector.createInstance(v, r, this._workbook, this._worksheet);
|
|
1079
1079
|
}
|
|
1080
1080
|
/**
|
|
@@ -1152,15 +1152,15 @@ let ke = class {
|
|
|
1152
1152
|
getNextDataRange(r) {
|
|
1153
1153
|
if (!this._selections.find((s) => !!s.primary))
|
|
1154
1154
|
return null;
|
|
1155
|
-
const t =
|
|
1155
|
+
const t = Zt(this._selections.concat(), r, this._worksheet);
|
|
1156
1156
|
return t ? this._injector.createInstance(R, this._workbook, this._worksheet, t) : null;
|
|
1157
1157
|
}
|
|
1158
1158
|
};
|
|
1159
|
-
ke =
|
|
1160
|
-
|
|
1159
|
+
ke = Tn([
|
|
1160
|
+
Vn(3, l(E))
|
|
1161
1161
|
], ke);
|
|
1162
|
-
var Je = /* @__PURE__ */ ((r) => (r[r.Reader = 0] = "Reader", r[r.Editor = 1] = "Editor", r[r.Owner = 2] = "Owner", r[r.UNRECOGNIZED = -1] = "UNRECOGNIZED", r))(Je || {}),
|
|
1163
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1162
|
+
var Je = /* @__PURE__ */ ((r) => (r[r.Reader = 0] = "Reader", r[r.Editor = 1] = "Editor", r[r.Owner = 2] = "Owner", r[r.UNRECOGNIZED = -1] = "UNRECOGNIZED", r))(Je || {}), An = Object.getOwnPropertyDescriptor, Bn = (r, e, t, s) => {
|
|
1163
|
+
for (var n = s > 1 ? void 0 : s ? An(e, t) : e, i = r.length - 1, o; i >= 0; i--)
|
|
1164
1164
|
(o = r[i]) && (n = o(n) || n);
|
|
1165
1165
|
return n;
|
|
1166
1166
|
}, pe = (r, e) => (t, s) => e(t, s, r);
|
|
@@ -1241,7 +1241,7 @@ let O = class {
|
|
|
1241
1241
|
)
|
|
1242
1242
|
))
|
|
1243
1243
|
throw new Error("Range protection cannot intersect with other protection rules");
|
|
1244
|
-
await this._commandService.executeCommand(
|
|
1244
|
+
await this._commandService.executeCommand(Pt.id, {
|
|
1245
1245
|
unitId: this._unitId,
|
|
1246
1246
|
subUnitId: this._subUnitId,
|
|
1247
1247
|
ruleId: this._ruleId,
|
|
@@ -1264,7 +1264,7 @@ let O = class {
|
|
|
1264
1264
|
* ```
|
|
1265
1265
|
*/
|
|
1266
1266
|
async remove() {
|
|
1267
|
-
await this._commandService.executeCommand(
|
|
1267
|
+
await this._commandService.executeCommand(yt.id, {
|
|
1268
1268
|
unitId: this._unitId,
|
|
1269
1269
|
subUnitId: this._subUnitId,
|
|
1270
1270
|
ruleIds: [this._ruleId]
|
|
@@ -1279,64 +1279,64 @@ let O = class {
|
|
|
1279
1279
|
return !(r.endRow < e.startRow || r.startRow > e.endRow || r.endColumn < e.startColumn || r.startColumn > e.endColumn);
|
|
1280
1280
|
}
|
|
1281
1281
|
};
|
|
1282
|
-
O =
|
|
1283
|
-
pe(6, l(
|
|
1282
|
+
O = Bn([
|
|
1283
|
+
pe(6, l(E)),
|
|
1284
1284
|
pe(7, l(C)),
|
|
1285
1285
|
pe(8, l(ie))
|
|
1286
1286
|
], O);
|
|
1287
1287
|
const he = {
|
|
1288
1288
|
[u.Edit]: Le,
|
|
1289
|
-
[u.View]:
|
|
1290
|
-
[u.Print]:
|
|
1291
|
-
[u.Export]:
|
|
1292
|
-
[u.Share]:
|
|
1293
|
-
[u.CopyContent]:
|
|
1294
|
-
[u.DuplicateFile]:
|
|
1295
|
-
[u.Comment]:
|
|
1296
|
-
[u.ManageCollaborator]:
|
|
1297
|
-
[u.CreateSheet]:
|
|
1298
|
-
[u.DeleteSheet]:
|
|
1299
|
-
[u.RenameSheet]:
|
|
1300
|
-
[u.MoveSheet]:
|
|
1301
|
-
[u.HideSheet]:
|
|
1302
|
-
[u.ViewHistory]:
|
|
1303
|
-
[u.ManageHistory]:
|
|
1304
|
-
[u.RecoverHistory]:
|
|
1305
|
-
[u.CreateProtection]:
|
|
1306
|
-
[u.InsertRow]:
|
|
1307
|
-
[u.InsertColumn]:
|
|
1308
|
-
[u.DeleteRow]:
|
|
1309
|
-
[u.DeleteColumn]:
|
|
1310
|
-
[u.CopySheet]:
|
|
1289
|
+
[u.View]: Cs,
|
|
1290
|
+
[u.Print]: ks,
|
|
1291
|
+
[u.Export]: Ss,
|
|
1292
|
+
[u.Share]: ws,
|
|
1293
|
+
[u.CopyContent]: _s,
|
|
1294
|
+
[u.DuplicateFile]: gs,
|
|
1295
|
+
[u.Comment]: ms,
|
|
1296
|
+
[u.ManageCollaborator]: ls,
|
|
1297
|
+
[u.CreateSheet]: us,
|
|
1298
|
+
[u.DeleteSheet]: cs,
|
|
1299
|
+
[u.RenameSheet]: ds,
|
|
1300
|
+
[u.MoveSheet]: hs,
|
|
1301
|
+
[u.HideSheet]: as,
|
|
1302
|
+
[u.ViewHistory]: os,
|
|
1303
|
+
[u.ManageHistory]: is,
|
|
1304
|
+
[u.RecoverHistory]: rs,
|
|
1305
|
+
[u.CreateProtection]: ns,
|
|
1306
|
+
[u.InsertRow]: ss,
|
|
1307
|
+
[u.InsertColumn]: ts,
|
|
1308
|
+
[u.DeleteRow]: es,
|
|
1309
|
+
[u.DeleteColumn]: Xt,
|
|
1310
|
+
[u.CopySheet]: Qt
|
|
1311
1311
|
}, de = {
|
|
1312
1312
|
[_.Edit]: Et,
|
|
1313
|
-
[_.View]:
|
|
1314
|
-
[_.Copy]:
|
|
1315
|
-
[_.SetCellValue]:
|
|
1316
|
-
[_.SetCellStyle]:
|
|
1317
|
-
[_.SetRowStyle]:
|
|
1318
|
-
[_.SetColumnStyle]:
|
|
1313
|
+
[_.View]: Ut,
|
|
1314
|
+
[_.Copy]: Ts,
|
|
1315
|
+
[_.SetCellValue]: Os,
|
|
1316
|
+
[_.SetCellStyle]: Ns,
|
|
1317
|
+
[_.SetRowStyle]: js,
|
|
1318
|
+
[_.SetColumnStyle]: Ws,
|
|
1319
1319
|
[_.InsertRow]: Ds,
|
|
1320
|
-
[_.InsertColumn]:
|
|
1321
|
-
[_.DeleteRow]:
|
|
1322
|
-
[_.DeleteColumn]:
|
|
1320
|
+
[_.InsertColumn]: Ms,
|
|
1321
|
+
[_.DeleteRow]: xs,
|
|
1322
|
+
[_.DeleteColumn]: Us,
|
|
1323
1323
|
[_.Sort]: Es,
|
|
1324
|
-
[_.Filter]:
|
|
1325
|
-
[_.PivotTable]:
|
|
1326
|
-
[_.InsertHyperlink]:
|
|
1327
|
-
[_.EditExtraObject]:
|
|
1328
|
-
[_.ManageCollaborator]:
|
|
1329
|
-
[_.DeleteProtection]:
|
|
1330
|
-
[_.SelectProtectedCells]:
|
|
1331
|
-
[_.SelectUnProtectedCells]:
|
|
1324
|
+
[_.Filter]: Ps,
|
|
1325
|
+
[_.PivotTable]: ys,
|
|
1326
|
+
[_.InsertHyperlink]: ps,
|
|
1327
|
+
[_.EditExtraObject]: Rs,
|
|
1328
|
+
[_.ManageCollaborator]: vs,
|
|
1329
|
+
[_.DeleteProtection]: fs,
|
|
1330
|
+
[_.SelectProtectedCells]: Is,
|
|
1331
|
+
[_.SelectUnProtectedCells]: bs
|
|
1332
1332
|
}, se = {
|
|
1333
|
-
[b.Edit]:
|
|
1334
|
-
[b.View]:
|
|
1335
|
-
[b.ManageCollaborator]:
|
|
1336
|
-
[b.Delete]:
|
|
1333
|
+
[b.Edit]: Fs,
|
|
1334
|
+
[b.View]: Bs,
|
|
1335
|
+
[b.ManageCollaborator]: As,
|
|
1336
|
+
[b.Delete]: Vs
|
|
1337
1337
|
};
|
|
1338
|
-
var
|
|
1339
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1338
|
+
var Fn = Object.getOwnPropertyDescriptor, Hn = (r, e, t, s) => {
|
|
1339
|
+
for (var n = s > 1 ? void 0 : s ? Fn(e, t) : e, i = r.length - 1, o; i >= 0; i--)
|
|
1340
1340
|
(o = r[i]) && (n = o(n) || n);
|
|
1341
1341
|
return n;
|
|
1342
1342
|
}, B = (r, e) => (t, s) => e(t, s, r);
|
|
@@ -1376,7 +1376,7 @@ let Ve = class {
|
|
|
1376
1376
|
*/
|
|
1377
1377
|
_createPermissionStream() {
|
|
1378
1378
|
const r = this._permissionService.permissionPointUpdate$.pipe(
|
|
1379
|
-
|
|
1379
|
+
M((e) => e.id.includes(this._unitId) && e.id.includes(this._subUnitId))
|
|
1380
1380
|
).subscribe(() => {
|
|
1381
1381
|
this._permissionSubject.next(this._buildSnapshot());
|
|
1382
1382
|
});
|
|
@@ -1391,7 +1391,7 @@ let Ve = class {
|
|
|
1391
1391
|
*/
|
|
1392
1392
|
_createPointChangeStream() {
|
|
1393
1393
|
return this._permissionService.permissionPointUpdate$.pipe(
|
|
1394
|
-
|
|
1394
|
+
M((r) => r.id.includes(this._unitId) && r.id.includes(this._subUnitId)),
|
|
1395
1395
|
we((r) => {
|
|
1396
1396
|
var t, s;
|
|
1397
1397
|
const e = this._extractWorksheetPointType(r.id);
|
|
@@ -1401,7 +1401,7 @@ let Ve = class {
|
|
|
1401
1401
|
oldValue: !((s = r.value) != null && s)
|
|
1402
1402
|
} : null;
|
|
1403
1403
|
}),
|
|
1404
|
-
|
|
1404
|
+
M((r) => r !== null),
|
|
1405
1405
|
N({ bufferSize: 1, refCount: !0 })
|
|
1406
1406
|
);
|
|
1407
1407
|
}
|
|
@@ -1411,7 +1411,7 @@ let Ve = class {
|
|
|
1411
1411
|
*/
|
|
1412
1412
|
_createRangeProtectionChangeStream() {
|
|
1413
1413
|
return this._rangeProtectionRuleModel.ruleChange$.pipe(
|
|
1414
|
-
|
|
1414
|
+
M((r) => r.unitId === this._unitId && r.subUnitId === this._subUnitId),
|
|
1415
1415
|
we((r) => {
|
|
1416
1416
|
const e = this._buildRangeProtectionRules();
|
|
1417
1417
|
return { type: r.type === "delete" ? "delete" : r.type === "set" ? "update" : "add", rules: e };
|
|
@@ -1425,7 +1425,7 @@ let Ve = class {
|
|
|
1425
1425
|
*/
|
|
1426
1426
|
_createRangeProtectionRulesStream() {
|
|
1427
1427
|
const r = this._rangeProtectionRuleModel.ruleChange$.pipe(
|
|
1428
|
-
|
|
1428
|
+
M((e) => e.unitId === this._unitId && e.subUnitId === this._subUnitId)
|
|
1429
1429
|
).subscribe(() => {
|
|
1430
1430
|
this._rangeRulesSubject.next(this._buildRangeProtectionRules());
|
|
1431
1431
|
});
|
|
@@ -1902,7 +1902,7 @@ let Ve = class {
|
|
|
1902
1902
|
editState: d
|
|
1903
1903
|
};
|
|
1904
1904
|
});
|
|
1905
|
-
if (!await this._commandService.executeCommand(
|
|
1905
|
+
if (!await this._commandService.executeCommand(pt.id, {
|
|
1906
1906
|
unitId: this._unitId,
|
|
1907
1907
|
subUnitId: this._subUnitId,
|
|
1908
1908
|
rules: n
|
|
@@ -2009,8 +2009,8 @@ let Ve = class {
|
|
|
2009
2009
|
this._subscriptions.forEach((r) => r.unsubscribe()), this._permissionSubject.complete(), this._rangeRulesSubject.complete();
|
|
2010
2010
|
}
|
|
2011
2011
|
};
|
|
2012
|
-
Ve =
|
|
2013
|
-
B(1, l(
|
|
2012
|
+
Ve = Hn([
|
|
2013
|
+
B(1, l(E)),
|
|
2014
2014
|
B(2, Y),
|
|
2015
2015
|
B(3, re),
|
|
2016
2016
|
B(4, C),
|
|
@@ -2018,7 +2018,7 @@ Ve = Fn([
|
|
|
2018
2018
|
B(6, l(ze)),
|
|
2019
2019
|
B(7, l($e))
|
|
2020
2020
|
], Ve);
|
|
2021
|
-
function
|
|
2021
|
+
function $n(r) {
|
|
2022
2022
|
switch (r) {
|
|
2023
2023
|
case "left":
|
|
2024
2024
|
return K.LEFT;
|
|
@@ -2030,7 +2030,7 @@ function Hn(r) {
|
|
|
2030
2030
|
throw new Error(`Invalid horizontal alignment: ${r}`);
|
|
2031
2031
|
}
|
|
2032
2032
|
}
|
|
2033
|
-
function
|
|
2033
|
+
function St(r) {
|
|
2034
2034
|
switch (r) {
|
|
2035
2035
|
case K.LEFT:
|
|
2036
2036
|
return "left";
|
|
@@ -2042,7 +2042,7 @@ function wt(r) {
|
|
|
2042
2042
|
return "general";
|
|
2043
2043
|
}
|
|
2044
2044
|
}
|
|
2045
|
-
function
|
|
2045
|
+
function zn(r) {
|
|
2046
2046
|
switch (r) {
|
|
2047
2047
|
case "top":
|
|
2048
2048
|
return J.TOP;
|
|
@@ -2054,7 +2054,7 @@ function $n(r) {
|
|
|
2054
2054
|
throw new Error(`Invalid vertical alignment: ${r}`);
|
|
2055
2055
|
}
|
|
2056
2056
|
}
|
|
2057
|
-
function
|
|
2057
|
+
function kt(r) {
|
|
2058
2058
|
switch (r) {
|
|
2059
2059
|
case J.TOP:
|
|
2060
2060
|
return "top";
|
|
@@ -2075,7 +2075,7 @@ function ye(r, e) {
|
|
|
2075
2075
|
rangeType: p.ROW
|
|
2076
2076
|
};
|
|
2077
2077
|
}
|
|
2078
|
-
function
|
|
2078
|
+
function Pe(r, e) {
|
|
2079
2079
|
return {
|
|
2080
2080
|
startRow: 0,
|
|
2081
2081
|
endRow: e.getRowCount() - 1,
|
|
@@ -2084,8 +2084,8 @@ function Ee(r, e) {
|
|
|
2084
2084
|
rangeType: p.COLUMN
|
|
2085
2085
|
};
|
|
2086
2086
|
}
|
|
2087
|
-
var
|
|
2088
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
2087
|
+
var Ln = Object.getOwnPropertyDescriptor, Gn = (r, e, t, s) => {
|
|
2088
|
+
for (var n = s > 1 ? void 0 : s ? Ln(e, t) : e, i = r.length - 1, o; i >= 0; i--)
|
|
2089
2089
|
(o = r[i]) && (n = o(n) || n);
|
|
2090
2090
|
return n;
|
|
2091
2091
|
}, ce = (r, e) => (t, s) => e(t, s, r);
|
|
@@ -2264,7 +2264,7 @@ let v = class extends He {
|
|
|
2264
2264
|
*/
|
|
2265
2265
|
setDefaultStyle(e) {
|
|
2266
2266
|
const t = this._workbook.getUnitId(), s = this._worksheet.getSheetId();
|
|
2267
|
-
return this._commandService.syncExecuteCommand(
|
|
2267
|
+
return this._commandService.syncExecuteCommand(Hs.id, {
|
|
2268
2268
|
unitId: t,
|
|
2269
2269
|
subUnitId: s,
|
|
2270
2270
|
defaultStyle: e
|
|
@@ -2294,7 +2294,7 @@ let v = class extends He {
|
|
|
2294
2294
|
}
|
|
2295
2295
|
}
|
|
2296
2296
|
};
|
|
2297
|
-
return this._commandService.syncExecuteCommand(
|
|
2297
|
+
return this._commandService.syncExecuteCommand(st.id, i), this;
|
|
2298
2298
|
}
|
|
2299
2299
|
/**
|
|
2300
2300
|
* Set the default style of the worksheet column
|
|
@@ -2320,14 +2320,14 @@ let v = class extends He {
|
|
|
2320
2320
|
}
|
|
2321
2321
|
}
|
|
2322
2322
|
};
|
|
2323
|
-
return this._commandService.syncExecuteCommand(
|
|
2323
|
+
return this._commandService.syncExecuteCommand(nt.id, i), this;
|
|
2324
2324
|
}
|
|
2325
2325
|
getRange(e, t, s, n) {
|
|
2326
2326
|
let i, o;
|
|
2327
2327
|
if (typeof e == "object")
|
|
2328
2328
|
i = e, o = this._worksheet;
|
|
2329
2329
|
else if (typeof e == "string") {
|
|
2330
|
-
const { range: a, sheetName: h } =
|
|
2330
|
+
const { range: a, sheetName: h } = Pn(e), c = h ? this._workbook.getSheetBySheetName(h) : this._worksheet;
|
|
2331
2331
|
if (!c)
|
|
2332
2332
|
throw new Error("Range not found");
|
|
2333
2333
|
o = c, i = {
|
|
@@ -2446,7 +2446,7 @@ let v = class extends He {
|
|
|
2446
2446
|
*/
|
|
2447
2447
|
insertRowsAfter(e, t) {
|
|
2448
2448
|
const s = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), i = oe.DOWN, o = e + 1, a = e + t, h = 0, c = this._worksheet.getColumnCount() - 1, d = ae(this._worksheet, o, a, h, c, !0, e);
|
|
2449
|
-
return this._commandService.syncExecuteCommand(
|
|
2449
|
+
return this._commandService.syncExecuteCommand(rt.id, {
|
|
2450
2450
|
unitId: s,
|
|
2451
2451
|
subUnitId: n,
|
|
2452
2452
|
direction: i,
|
|
@@ -2475,7 +2475,7 @@ let v = class extends He {
|
|
|
2475
2475
|
*/
|
|
2476
2476
|
insertRowsBefore(e, t) {
|
|
2477
2477
|
const s = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), i = oe.UP, o = e, a = e + t - 1, h = 0, c = this._worksheet.getColumnCount() - 1, d = ae(this._worksheet, o, a, h, c, !0, e - 1);
|
|
2478
|
-
return this._commandService.syncExecuteCommand(
|
|
2478
|
+
return this._commandService.syncExecuteCommand(rt.id, {
|
|
2479
2479
|
unitId: s,
|
|
2480
2480
|
subUnitId: n,
|
|
2481
2481
|
direction: i,
|
|
@@ -2525,12 +2525,28 @@ let v = class extends He {
|
|
|
2525
2525
|
startColumn: 0,
|
|
2526
2526
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
2527
2527
|
};
|
|
2528
|
-
return this._commandService.syncExecuteCommand(
|
|
2528
|
+
return this._commandService.syncExecuteCommand($s.id, {
|
|
2529
2529
|
range: s,
|
|
2530
2530
|
unitId: this._workbook.getUnitId(),
|
|
2531
2531
|
subUnitId: this._worksheet.getSheetId()
|
|
2532
2532
|
}), this;
|
|
2533
2533
|
}
|
|
2534
|
+
/**
|
|
2535
|
+
* Deletes the rows specified by the given row points. Each point can be a single row index or a tuple representing a range of rows.
|
|
2536
|
+
* @param {Array<number | [number, number]>} rowPoints - An array of row points to delete. Each point can be a single row index or a tuple representing a range of rows.
|
|
2537
|
+
* @returns {FWorksheet} This sheet, for chaining.
|
|
2538
|
+
* @example
|
|
2539
|
+
* ```typescript
|
|
2540
|
+
* const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
2541
|
+
* // Delete rows at index 2, and range from index 4 to 6 (rows 3, 5-7)
|
|
2542
|
+
* fWorksheet.deleteRowsByPoints([2, [4, 6]]);
|
|
2543
|
+
* ```
|
|
2544
|
+
*/
|
|
2545
|
+
deleteRowsByPoints(e) {
|
|
2546
|
+
return qe(e).reverse().forEach((s) => {
|
|
2547
|
+
this.deleteRows(s[0], s[1] - s[0] + 1);
|
|
2548
|
+
}), this;
|
|
2549
|
+
}
|
|
2534
2550
|
/**
|
|
2535
2551
|
* Moves the rows selected by the given range to the position indicated by the destinationIndex. The rowSpec itself does not have to exactly represent an entire row or group of rows to move—it selects all rows that the range spans.
|
|
2536
2552
|
* @param {FRange} rowSpec - A range spanning the rows that should be moved.
|
|
@@ -2554,7 +2570,7 @@ let v = class extends He {
|
|
|
2554
2570
|
startColumn: i.startColumn,
|
|
2555
2571
|
endColumn: i.endColumn
|
|
2556
2572
|
};
|
|
2557
|
-
return this._commandService.syncExecuteCommand(
|
|
2573
|
+
return this._commandService.syncExecuteCommand(zs.id, {
|
|
2558
2574
|
unitId: s,
|
|
2559
2575
|
subUnitId: n,
|
|
2560
2576
|
range: i,
|
|
@@ -2579,7 +2595,7 @@ let v = class extends He {
|
|
|
2579
2595
|
*/
|
|
2580
2596
|
hideRow(e) {
|
|
2581
2597
|
const t = this._workbook.getUnitId(), s = this._worksheet.getSheetId(), n = ye(e.getRange(), this._worksheet);
|
|
2582
|
-
return this._commandService.syncExecuteCommand(
|
|
2598
|
+
return this._commandService.syncExecuteCommand(it.id, {
|
|
2583
2599
|
unitId: t,
|
|
2584
2600
|
subUnitId: s,
|
|
2585
2601
|
ranges: [n]
|
|
@@ -2607,7 +2623,7 @@ let v = class extends He {
|
|
|
2607
2623
|
endColumn: this._worksheet.getColumnCount() - 1,
|
|
2608
2624
|
rangeType: p.ROW
|
|
2609
2625
|
};
|
|
2610
|
-
return this._commandService.syncExecuteCommand(
|
|
2626
|
+
return this._commandService.syncExecuteCommand(it.id, {
|
|
2611
2627
|
unitId: s,
|
|
2612
2628
|
subUnitId: n,
|
|
2613
2629
|
ranges: [i]
|
|
@@ -2630,7 +2646,7 @@ let v = class extends He {
|
|
|
2630
2646
|
*/
|
|
2631
2647
|
unhideRow(e) {
|
|
2632
2648
|
const t = this._workbook.getUnitId(), s = this._worksheet.getSheetId(), n = ye(e.getRange(), this._worksheet);
|
|
2633
|
-
return this._commandService.syncExecuteCommand(
|
|
2649
|
+
return this._commandService.syncExecuteCommand(ot.id, {
|
|
2634
2650
|
unitId: t,
|
|
2635
2651
|
subUnitId: s,
|
|
2636
2652
|
ranges: [n]
|
|
@@ -2658,7 +2674,7 @@ let v = class extends He {
|
|
|
2658
2674
|
endColumn: this._worksheet.getColumnCount() - 1,
|
|
2659
2675
|
rangeType: p.ROW
|
|
2660
2676
|
};
|
|
2661
|
-
return this._commandService.syncExecuteCommand(
|
|
2677
|
+
return this._commandService.syncExecuteCommand(ot.id, {
|
|
2662
2678
|
unitId: s,
|
|
2663
2679
|
subUnitId: n,
|
|
2664
2680
|
ranges: [i]
|
|
@@ -2704,7 +2720,7 @@ let v = class extends He {
|
|
|
2704
2720
|
subUnitId: this._worksheet.getSheetId(),
|
|
2705
2721
|
range: i[0],
|
|
2706
2722
|
value: ue.WRAP
|
|
2707
|
-
}), this._commandService.syncExecuteCommand(
|
|
2723
|
+
}), this._commandService.syncExecuteCommand(Ls.id, {
|
|
2708
2724
|
unitId: s,
|
|
2709
2725
|
subUnitId: n,
|
|
2710
2726
|
ranges: i,
|
|
@@ -2736,7 +2752,7 @@ let v = class extends He {
|
|
|
2736
2752
|
};
|
|
2737
2753
|
s <= m ? a.push(g) : h.push(g);
|
|
2738
2754
|
}
|
|
2739
|
-
return h.length > 0 && this._commandService.syncExecuteCommand(
|
|
2755
|
+
return h.length > 0 && this._commandService.syncExecuteCommand(at.id, {
|
|
2740
2756
|
unitId: n,
|
|
2741
2757
|
subUnitId: i,
|
|
2742
2758
|
ranges: h,
|
|
@@ -2836,7 +2852,7 @@ let v = class extends He {
|
|
|
2836
2852
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
2837
2853
|
}
|
|
2838
2854
|
];
|
|
2839
|
-
return this._commandService.syncExecuteCommand(
|
|
2855
|
+
return this._commandService.syncExecuteCommand(at.id, {
|
|
2840
2856
|
unitId: n,
|
|
2841
2857
|
subUnitId: i,
|
|
2842
2858
|
ranges: o,
|
|
@@ -2865,7 +2881,7 @@ let v = class extends He {
|
|
|
2865
2881
|
subUnitId: s,
|
|
2866
2882
|
rowData: n
|
|
2867
2883
|
};
|
|
2868
|
-
return this._commandService.syncExecuteCommand(
|
|
2884
|
+
return this._commandService.syncExecuteCommand(nt.id, i), this;
|
|
2869
2885
|
}
|
|
2870
2886
|
// #region Column
|
|
2871
2887
|
/**
|
|
@@ -2933,7 +2949,7 @@ let v = class extends He {
|
|
|
2933
2949
|
*/
|
|
2934
2950
|
insertColumnsAfter(e, t) {
|
|
2935
2951
|
const s = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), i = oe.RIGHT, o = 0, a = this._worksheet.getRowCount() - 1, h = e + 1, c = e + t, d = ae(this._worksheet, o, a, h, c, !1, e);
|
|
2936
|
-
return this._commandService.syncExecuteCommand(
|
|
2952
|
+
return this._commandService.syncExecuteCommand(ht.id, {
|
|
2937
2953
|
unitId: s,
|
|
2938
2954
|
subUnitId: n,
|
|
2939
2955
|
direction: i,
|
|
@@ -2962,7 +2978,7 @@ let v = class extends He {
|
|
|
2962
2978
|
*/
|
|
2963
2979
|
insertColumnsBefore(e, t) {
|
|
2964
2980
|
const s = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), i = oe.LEFT, o = 0, a = this._worksheet.getRowCount() - 1, h = e, c = e + t - 1, d = ae(this._worksheet, o, a, h, c, !1, e - 1);
|
|
2965
|
-
return this._commandService.syncExecuteCommand(
|
|
2981
|
+
return this._commandService.syncExecuteCommand(ht.id, {
|
|
2966
2982
|
unitId: s,
|
|
2967
2983
|
subUnitId: n,
|
|
2968
2984
|
direction: i,
|
|
@@ -3012,12 +3028,28 @@ let v = class extends He {
|
|
|
3012
3028
|
startColumn: e,
|
|
3013
3029
|
endColumn: e + t - 1
|
|
3014
3030
|
};
|
|
3015
|
-
return this._commandService.syncExecuteCommand(
|
|
3031
|
+
return this._commandService.syncExecuteCommand(Gs.id, {
|
|
3016
3032
|
range: s,
|
|
3017
3033
|
unitId: this._workbook.getUnitId(),
|
|
3018
3034
|
subUnitId: this._worksheet.getSheetId()
|
|
3019
3035
|
}), this;
|
|
3020
3036
|
}
|
|
3037
|
+
/**
|
|
3038
|
+
* Deletes the columns specified by the given column points. Each point can be a single column index or a tuple representing a range of columns.
|
|
3039
|
+
* @param {Array<number | [number, number]>} columnPoints - An array of column points to delete. Each point can be a single column index or a tuple representing a range of columns.
|
|
3040
|
+
* @returns {FWorksheet} This sheet, for chaining
|
|
3041
|
+
* @example
|
|
3042
|
+
* ```typescript
|
|
3043
|
+
* const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
3044
|
+
* // Delete columns at index 2, and range from index 4 to 6 (columns C, E-G)
|
|
3045
|
+
* fWorksheet.deleteColumnsByPoints([2, [4, 6]]);
|
|
3046
|
+
* ```
|
|
3047
|
+
*/
|
|
3048
|
+
deleteColumnsByPoints(e) {
|
|
3049
|
+
return qe(e).reverse().forEach((s) => {
|
|
3050
|
+
this.deleteColumns(s[0], s[1] - s[0] + 1);
|
|
3051
|
+
}), this;
|
|
3052
|
+
}
|
|
3021
3053
|
/**
|
|
3022
3054
|
* Moves the columns selected by the given range to the position indicated by the destinationIndex. The columnSpec itself does not have to exactly represent an entire column or group of columns to move—it selects all columns that the range spans.
|
|
3023
3055
|
* @param {FRange} columnSpec - A range spanning the columns that should be moved
|
|
@@ -3035,13 +3067,13 @@ let v = class extends He {
|
|
|
3035
3067
|
* ```
|
|
3036
3068
|
*/
|
|
3037
3069
|
moveColumns(e, t) {
|
|
3038
|
-
const s = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), i =
|
|
3070
|
+
const s = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), i = Pe(e.getRange(), this._worksheet), o = i, a = {
|
|
3039
3071
|
startRow: 0,
|
|
3040
3072
|
endRow: this._worksheet.getRowCount() - 1,
|
|
3041
3073
|
startColumn: t,
|
|
3042
3074
|
endColumn: t
|
|
3043
3075
|
};
|
|
3044
|
-
return this._commandService.syncExecuteCommand(
|
|
3076
|
+
return this._commandService.syncExecuteCommand(Ks.id, {
|
|
3045
3077
|
unitId: s,
|
|
3046
3078
|
subUnitId: n,
|
|
3047
3079
|
range: i,
|
|
@@ -3065,8 +3097,8 @@ let v = class extends He {
|
|
|
3065
3097
|
* ```
|
|
3066
3098
|
*/
|
|
3067
3099
|
hideColumn(e) {
|
|
3068
|
-
const t = this._workbook.getUnitId(), s = this._worksheet.getSheetId(), n =
|
|
3069
|
-
return this._commandService.syncExecuteCommand(
|
|
3100
|
+
const t = this._workbook.getUnitId(), s = this._worksheet.getSheetId(), n = Pe(e.getRange(), this._worksheet);
|
|
3101
|
+
return this._commandService.syncExecuteCommand(dt.id, {
|
|
3070
3102
|
unitId: t,
|
|
3071
3103
|
subUnitId: s,
|
|
3072
3104
|
ranges: [n]
|
|
@@ -3094,7 +3126,7 @@ let v = class extends He {
|
|
|
3094
3126
|
endColumn: e + t - 1,
|
|
3095
3127
|
rangeType: p.COLUMN
|
|
3096
3128
|
};
|
|
3097
|
-
return this._commandService.syncExecuteCommand(
|
|
3129
|
+
return this._commandService.syncExecuteCommand(dt.id, {
|
|
3098
3130
|
unitId: s,
|
|
3099
3131
|
subUnitId: n,
|
|
3100
3132
|
ranges: [i]
|
|
@@ -3116,8 +3148,8 @@ let v = class extends He {
|
|
|
3116
3148
|
* ```
|
|
3117
3149
|
*/
|
|
3118
3150
|
unhideColumn(e) {
|
|
3119
|
-
const t = this._workbook.getUnitId(), s = this._worksheet.getSheetId(), n =
|
|
3120
|
-
return this._commandService.syncExecuteCommand(
|
|
3151
|
+
const t = this._workbook.getUnitId(), s = this._worksheet.getSheetId(), n = Pe(e.getRange(), this._worksheet);
|
|
3152
|
+
return this._commandService.syncExecuteCommand(ct.id, {
|
|
3121
3153
|
unitId: t,
|
|
3122
3154
|
subUnitId: s,
|
|
3123
3155
|
ranges: [n]
|
|
@@ -3145,7 +3177,7 @@ let v = class extends He {
|
|
|
3145
3177
|
endColumn: e + t - 1,
|
|
3146
3178
|
rangeType: p.COLUMN
|
|
3147
3179
|
};
|
|
3148
|
-
return this._commandService.syncExecuteCommand(
|
|
3180
|
+
return this._commandService.syncExecuteCommand(ct.id, {
|
|
3149
3181
|
unitId: s,
|
|
3150
3182
|
subUnitId: n,
|
|
3151
3183
|
ranges: [i]
|
|
@@ -3188,7 +3220,7 @@ let v = class extends He {
|
|
|
3188
3220
|
endRow: this._worksheet.getRowCount() - 1
|
|
3189
3221
|
}
|
|
3190
3222
|
];
|
|
3191
|
-
return this._commandService.syncExecuteCommand(
|
|
3223
|
+
return this._commandService.syncExecuteCommand(Js.id, {
|
|
3192
3224
|
unitId: n,
|
|
3193
3225
|
subUnitId: i,
|
|
3194
3226
|
ranges: o,
|
|
@@ -3240,7 +3272,7 @@ let v = class extends He {
|
|
|
3240
3272
|
subUnitId: s,
|
|
3241
3273
|
columnData: n
|
|
3242
3274
|
};
|
|
3243
|
-
return this._commandService.syncExecuteCommand(
|
|
3275
|
+
return this._commandService.syncExecuteCommand(st.id, i), this;
|
|
3244
3276
|
}
|
|
3245
3277
|
// #region merge cells
|
|
3246
3278
|
/**
|
|
@@ -3377,7 +3409,7 @@ let v = class extends He {
|
|
|
3377
3409
|
* ```
|
|
3378
3410
|
*/
|
|
3379
3411
|
cancelFreeze() {
|
|
3380
|
-
return this._commandService.syncExecuteCommand(
|
|
3412
|
+
return this._commandService.syncExecuteCommand(qs.id, {
|
|
3381
3413
|
unitId: this._workbook.getUnitId(),
|
|
3382
3414
|
subUnitId: this.getSheetId()
|
|
3383
3415
|
}), this;
|
|
@@ -3584,7 +3616,7 @@ let v = class extends He {
|
|
|
3584
3616
|
* ```
|
|
3585
3617
|
*/
|
|
3586
3618
|
setTabColor(e) {
|
|
3587
|
-
return this._commandService.syncExecuteCommand(
|
|
3619
|
+
return this._commandService.syncExecuteCommand(Ys.id, {
|
|
3588
3620
|
unitId: this._workbook.getUnitId(),
|
|
3589
3621
|
subUnitId: this._worksheet.getSheetId(),
|
|
3590
3622
|
value: e
|
|
@@ -3610,7 +3642,7 @@ let v = class extends He {
|
|
|
3610
3642
|
*/
|
|
3611
3643
|
onCellDataChange(e) {
|
|
3612
3644
|
return this._injector.get(C).onCommandExecuted((s) => {
|
|
3613
|
-
if (s.id ===
|
|
3645
|
+
if (s.id === ut.id) {
|
|
3614
3646
|
const n = s.params;
|
|
3615
3647
|
n.unitId === this._workbook.getUnitId() && n.subUnitId === this._worksheet.getSheetId() && n.cellValue && e(new Ie(n.cellValue));
|
|
3616
3648
|
}
|
|
@@ -3621,7 +3653,7 @@ let v = class extends He {
|
|
|
3621
3653
|
*/
|
|
3622
3654
|
onBeforeCellDataChange(e) {
|
|
3623
3655
|
return this._injector.get(C).beforeCommandExecuted((s) => {
|
|
3624
|
-
if (s.id ===
|
|
3656
|
+
if (s.id === ut.id) {
|
|
3625
3657
|
const n = s.params;
|
|
3626
3658
|
n.unitId === this._workbook.getUnitId() && n.subUnitId === this._worksheet.getSheetId() && n.cellValue && e(new Ie(n.cellValue));
|
|
3627
3659
|
}
|
|
@@ -3642,7 +3674,7 @@ let v = class extends He {
|
|
|
3642
3674
|
const e = this._injector.get(C);
|
|
3643
3675
|
if (this._workbook.getSheets().filter((i) => i.isSheetHidden() !== I.TRUE).length <= 1)
|
|
3644
3676
|
throw new Error("Cannot hide the only visible sheet");
|
|
3645
|
-
return e.syncExecuteCommand(
|
|
3677
|
+
return e.syncExecuteCommand(Zs.id, {
|
|
3646
3678
|
unitId: this._workbook.getUnitId(),
|
|
3647
3679
|
subUnitId: this._worksheet.getSheetId()
|
|
3648
3680
|
}), this;
|
|
@@ -3659,7 +3691,7 @@ let v = class extends He {
|
|
|
3659
3691
|
* ```
|
|
3660
3692
|
*/
|
|
3661
3693
|
showSheet() {
|
|
3662
|
-
return this._injector.get(C).syncExecuteCommand(
|
|
3694
|
+
return this._injector.get(C).syncExecuteCommand(Qs.id, {
|
|
3663
3695
|
unitId: this._workbook.getUnitId(),
|
|
3664
3696
|
subUnitId: this._worksheet.getSheetId()
|
|
3665
3697
|
}), this;
|
|
@@ -3753,7 +3785,7 @@ let v = class extends He {
|
|
|
3753
3785
|
startColumn: 0,
|
|
3754
3786
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
3755
3787
|
};
|
|
3756
|
-
return n.syncExecuteCommand(
|
|
3788
|
+
return n.syncExecuteCommand(Mt.id, {
|
|
3757
3789
|
unitId: t,
|
|
3758
3790
|
subUnitId: s,
|
|
3759
3791
|
ranges: [i],
|
|
@@ -3802,7 +3834,7 @@ let v = class extends He {
|
|
|
3802
3834
|
startColumn: 0,
|
|
3803
3835
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
3804
3836
|
};
|
|
3805
|
-
return s.syncExecuteCommand(
|
|
3837
|
+
return s.syncExecuteCommand(Wt.id, {
|
|
3806
3838
|
unitId: e,
|
|
3807
3839
|
subUnitId: t,
|
|
3808
3840
|
ranges: [n]
|
|
@@ -4023,7 +4055,7 @@ let v = class extends He {
|
|
|
4023
4055
|
const t = this._worksheet.getCellMatrix().hasValue(), s = this._worksheet.getLastRowWithContent(), n = this._worksheet.getRowCount(), i = this._worksheet.getColumnCount(), o = t ? s + 1 : s, a = new Ie();
|
|
4024
4056
|
for (let h = 0; h < e.length; h++)
|
|
4025
4057
|
a.setValue(o, h, xe(e[h]));
|
|
4026
|
-
return this._commandService.syncExecuteCommand(
|
|
4058
|
+
return this._commandService.syncExecuteCommand(Xs.id, {
|
|
4027
4059
|
unitId: this._workbook.getUnitId(),
|
|
4028
4060
|
subUnitId: this._worksheet.getSheetId(),
|
|
4029
4061
|
cellValue: a.getMatrix(),
|
|
@@ -4047,7 +4079,7 @@ let v = class extends He {
|
|
|
4047
4079
|
* ```
|
|
4048
4080
|
*/
|
|
4049
4081
|
setRowCount(e) {
|
|
4050
|
-
return this._commandService.syncExecuteCommand(
|
|
4082
|
+
return this._commandService.syncExecuteCommand(en.id, {
|
|
4051
4083
|
unitId: this._workbook.getUnitId(),
|
|
4052
4084
|
subUnitId: this._worksheet.getSheetId(),
|
|
4053
4085
|
rowCount: e
|
|
@@ -4067,7 +4099,7 @@ let v = class extends He {
|
|
|
4067
4099
|
* ```
|
|
4068
4100
|
*/
|
|
4069
4101
|
setColumnCount(e) {
|
|
4070
|
-
return this._commandService.syncExecuteCommand(
|
|
4102
|
+
return this._commandService.syncExecuteCommand(tn.id, {
|
|
4071
4103
|
unitId: this._workbook.getUnitId(),
|
|
4072
4104
|
subUnitId: this._worksheet.getSheetId(),
|
|
4073
4105
|
columnCount: e
|
|
@@ -4109,14 +4141,14 @@ let v = class extends He {
|
|
|
4109
4141
|
);
|
|
4110
4142
|
}
|
|
4111
4143
|
};
|
|
4112
|
-
v =
|
|
4113
|
-
ce(3, l(
|
|
4114
|
-
ce(4, l(
|
|
4115
|
-
ce(5, l(
|
|
4144
|
+
v = Gn([
|
|
4145
|
+
ce(3, l(E)),
|
|
4146
|
+
ce(4, l(xt)),
|
|
4147
|
+
ce(5, l(ft)),
|
|
4116
4148
|
ce(6, C)
|
|
4117
4149
|
], v);
|
|
4118
|
-
var
|
|
4119
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
4150
|
+
var Kn = Object.getOwnPropertyDescriptor, Jn = (r, e, t, s) => {
|
|
4151
|
+
for (var n = s > 1 ? void 0 : s ? Kn(e, t) : e, i = r.length - 1, o; i >= 0; i--)
|
|
4120
4152
|
(o = r[i]) && (n = o(n) || n);
|
|
4121
4153
|
return n;
|
|
4122
4154
|
}, ee = (r, e) => (t, s) => e(t, s, r);
|
|
@@ -4143,7 +4175,7 @@ let Ae = class {
|
|
|
4143
4175
|
*/
|
|
4144
4176
|
_createPermissionStream() {
|
|
4145
4177
|
const r = this._permissionService.permissionPointUpdate$.pipe(
|
|
4146
|
-
|
|
4178
|
+
M((e) => {
|
|
4147
4179
|
const t = e.id;
|
|
4148
4180
|
return t.includes(this._unitId) && t.includes(this._subUnitId);
|
|
4149
4181
|
})
|
|
@@ -4161,7 +4193,7 @@ let Ae = class {
|
|
|
4161
4193
|
*/
|
|
4162
4194
|
_createProtectionChangeStream() {
|
|
4163
4195
|
return this._rangeProtectionRuleModel.ruleChange$.pipe(
|
|
4164
|
-
|
|
4196
|
+
M((r) => r.unitId !== this._unitId || r.subUnitId !== this._subUnitId ? !1 : r.type === "delete" ? this._rangeMatches(r.rule) : r.type === "add" ? this._rangeMatches(r.rule) : !1),
|
|
4165
4197
|
we((r) => (this._permissionSubject.next(this._buildSnapshot()), r.type === "delete" ? {
|
|
4166
4198
|
type: "unprotected",
|
|
4167
4199
|
ruleId: r.rule.id
|
|
@@ -4589,18 +4621,18 @@ let Ae = class {
|
|
|
4589
4621
|
this._subscriptions.forEach((r) => r.unsubscribe()), this._permissionSubject.complete();
|
|
4590
4622
|
}
|
|
4591
4623
|
};
|
|
4592
|
-
Ae =
|
|
4593
|
-
ee(4, l(
|
|
4624
|
+
Ae = Jn([
|
|
4625
|
+
ee(4, l(E)),
|
|
4594
4626
|
ee(5, l(Y)),
|
|
4595
4627
|
ee(6, l(re)),
|
|
4596
4628
|
ee(7, l(C)),
|
|
4597
4629
|
ee(8, l(ie))
|
|
4598
4630
|
], Ae);
|
|
4599
|
-
var
|
|
4600
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
4631
|
+
var qn = Object.getOwnPropertyDescriptor, Yn = (r, e, t, s) => {
|
|
4632
|
+
for (var n = s > 1 ? void 0 : s ? qn(e, t) : e, i = r.length - 1, o; i >= 0; i--)
|
|
4601
4633
|
(o = r[i]) && (n = o(n) || n);
|
|
4602
4634
|
return n;
|
|
4603
|
-
},
|
|
4635
|
+
}, Ee = (r, e) => (t, s) => e(t, s, r), q;
|
|
4604
4636
|
let R = (q = class extends He {
|
|
4605
4637
|
constructor(e, t, s, n, i, o) {
|
|
4606
4638
|
super(n), this._workbook = e, this._worksheet = t, this._range = s, this._injector = n, this._commandService = i, this._formulaDataModel = o;
|
|
@@ -4858,7 +4890,7 @@ let R = (q = class extends He {
|
|
|
4858
4890
|
*/
|
|
4859
4891
|
getCellStyle(e = "row") {
|
|
4860
4892
|
const t = this.getCellStyleData(e);
|
|
4861
|
-
return t ?
|
|
4893
|
+
return t ? Ye.create(t) : null;
|
|
4862
4894
|
}
|
|
4863
4895
|
/**
|
|
4864
4896
|
* Returns the cell styles for the cells in the range.
|
|
@@ -4881,7 +4913,7 @@ let R = (q = class extends He {
|
|
|
4881
4913
|
return this.getCellDatas().map((s, n) => s.map((i, o) => {
|
|
4882
4914
|
if (!i) return null;
|
|
4883
4915
|
const a = e !== "cell" ? this._worksheet.getComposedCellStyle(n + this._range.startRow, o + this._range.startColumn, e === "row") : this._worksheet.getCellStyle(n + this._range.startRow, o + this._range.startColumn);
|
|
4884
|
-
return a ?
|
|
4916
|
+
return a ? Ye.create(a) : null;
|
|
4885
4917
|
}));
|
|
4886
4918
|
}
|
|
4887
4919
|
getValue(e) {
|
|
@@ -5274,7 +5306,7 @@ let R = (q = class extends He {
|
|
|
5274
5306
|
*/
|
|
5275
5307
|
getHorizontalAlignment() {
|
|
5276
5308
|
const e = this._worksheet.getRange(this._range).getHorizontalAlignment();
|
|
5277
|
-
return
|
|
5309
|
+
return St(e);
|
|
5278
5310
|
}
|
|
5279
5311
|
/**
|
|
5280
5312
|
* Returns the horizontal alignments of the cells in the range.
|
|
@@ -5288,7 +5320,7 @@ let R = (q = class extends He {
|
|
|
5288
5320
|
* ```
|
|
5289
5321
|
*/
|
|
5290
5322
|
getHorizontalAlignments() {
|
|
5291
|
-
return this._worksheet.getRange(this._range).getHorizontalAlignments().map((t) => t.map((s) =>
|
|
5323
|
+
return this._worksheet.getRange(this._range).getHorizontalAlignments().map((t) => t.map((s) => St(s)));
|
|
5292
5324
|
}
|
|
5293
5325
|
/**
|
|
5294
5326
|
* Returns the vertical alignment (top/middle/bottom) of the top-left cell in the range.
|
|
@@ -5302,7 +5334,7 @@ let R = (q = class extends He {
|
|
|
5302
5334
|
* ```
|
|
5303
5335
|
*/
|
|
5304
5336
|
getVerticalAlignment() {
|
|
5305
|
-
return
|
|
5337
|
+
return kt(this._worksheet.getRange(this._range).getVerticalAlignment());
|
|
5306
5338
|
}
|
|
5307
5339
|
/**
|
|
5308
5340
|
* Returns the vertical alignments of the cells in the range.
|
|
@@ -5316,7 +5348,7 @@ let R = (q = class extends He {
|
|
|
5316
5348
|
* ```
|
|
5317
5349
|
*/
|
|
5318
5350
|
getVerticalAlignments() {
|
|
5319
|
-
return this._worksheet.getRange(this._range).getVerticalAlignments().map((t) => t.map((s) =>
|
|
5351
|
+
return this._worksheet.getRange(this._range).getVerticalAlignments().map((t) => t.map((s) => kt(s)));
|
|
5320
5352
|
}
|
|
5321
5353
|
/**
|
|
5322
5354
|
* Set custom meta data for first cell in current range.
|
|
@@ -5339,7 +5371,7 @@ let R = (q = class extends He {
|
|
|
5339
5371
|
custom: e
|
|
5340
5372
|
}
|
|
5341
5373
|
};
|
|
5342
|
-
return this._commandService.syncExecuteCommand(
|
|
5374
|
+
return this._commandService.syncExecuteCommand(lt.id, t), this;
|
|
5343
5375
|
}
|
|
5344
5376
|
/**
|
|
5345
5377
|
* Set custom meta data for current range.
|
|
@@ -5363,7 +5395,7 @@ let R = (q = class extends He {
|
|
|
5363
5395
|
range: this._range,
|
|
5364
5396
|
customMetadata: e.map((s) => s.map((n) => ({ custom: n })))
|
|
5365
5397
|
};
|
|
5366
|
-
return this._commandService.syncExecuteCommand(
|
|
5398
|
+
return this._commandService.syncExecuteCommand(lt.id, t), this;
|
|
5367
5399
|
}
|
|
5368
5400
|
/**
|
|
5369
5401
|
* Returns the custom meta data for the cell at the start of this range.
|
|
@@ -5413,7 +5445,7 @@ let R = (q = class extends He {
|
|
|
5413
5445
|
* ```
|
|
5414
5446
|
*/
|
|
5415
5447
|
setBorder(e, t, s) {
|
|
5416
|
-
return this._commandService.syncExecuteCommand(
|
|
5448
|
+
return this._commandService.syncExecuteCommand(sn.id, {
|
|
5417
5449
|
unitId: this._workbook.getUnitId(),
|
|
5418
5450
|
subUnitId: this._worksheet.getSheetId(),
|
|
5419
5451
|
ranges: [this._range],
|
|
@@ -5439,7 +5471,7 @@ let R = (q = class extends He {
|
|
|
5439
5471
|
getBackground() {
|
|
5440
5472
|
var t, s;
|
|
5441
5473
|
const e = this.getCellStyle();
|
|
5442
|
-
return (s = (t = e == null ? void 0 : e.background) == null ? void 0 : t.rgb) != null ? s :
|
|
5474
|
+
return (s = (t = e == null ? void 0 : e.background) == null ? void 0 : t.rgb) != null ? s : Ze.bg.rgb;
|
|
5443
5475
|
}
|
|
5444
5476
|
/**
|
|
5445
5477
|
* Returns the background colors of the cells in the range.
|
|
@@ -5455,7 +5487,7 @@ let R = (q = class extends He {
|
|
|
5455
5487
|
getBackgrounds() {
|
|
5456
5488
|
return this.getCellStyles().map((t) => t.map((s) => {
|
|
5457
5489
|
var n, i;
|
|
5458
|
-
return (i = (n = s == null ? void 0 : s.background) == null ? void 0 : n.rgb) != null ? i :
|
|
5490
|
+
return (i = (n = s == null ? void 0 : s.background) == null ? void 0 : n.rgb) != null ? i : Ze.bg.rgb;
|
|
5459
5491
|
}));
|
|
5460
5492
|
}
|
|
5461
5493
|
/**
|
|
@@ -5511,7 +5543,7 @@ let R = (q = class extends He {
|
|
|
5511
5543
|
* ```
|
|
5512
5544
|
*/
|
|
5513
5545
|
setTextRotation(e) {
|
|
5514
|
-
return this._commandService.syncExecuteCommand(
|
|
5546
|
+
return this._commandService.syncExecuteCommand(nn.id, {
|
|
5515
5547
|
unitId: this._workbook.getUnitId(),
|
|
5516
5548
|
subUnitId: this._worksheet.getSheetId(),
|
|
5517
5549
|
range: this._range,
|
|
@@ -5631,7 +5663,7 @@ let R = (q = class extends He {
|
|
|
5631
5663
|
* ```
|
|
5632
5664
|
*/
|
|
5633
5665
|
setRichTextValues(e) {
|
|
5634
|
-
const t = e.map((i) => i.map((o) => o && { p: o instanceof L ? o.getData() : o })), s =
|
|
5666
|
+
const t = e.map((i) => i.map((o) => o && { p: o instanceof L ? o.getData() : o })), s = Qe(t, this._range), n = {
|
|
5635
5667
|
unitId: this._workbook.getUnitId(),
|
|
5636
5668
|
subUnitId: this._worksheet.getSheetId(),
|
|
5637
5669
|
range: this._range,
|
|
@@ -5695,11 +5727,11 @@ let R = (q = class extends He {
|
|
|
5695
5727
|
* ```
|
|
5696
5728
|
*/
|
|
5697
5729
|
setVerticalAlignment(e) {
|
|
5698
|
-
return this._commandService.syncExecuteCommand(
|
|
5730
|
+
return this._commandService.syncExecuteCommand(rn.id, {
|
|
5699
5731
|
unitId: this._workbook.getUnitId(),
|
|
5700
5732
|
subUnitId: this._worksheet.getSheetId(),
|
|
5701
5733
|
range: this._range,
|
|
5702
|
-
value:
|
|
5734
|
+
value: zn(e)
|
|
5703
5735
|
}), this;
|
|
5704
5736
|
}
|
|
5705
5737
|
/**
|
|
@@ -5715,11 +5747,11 @@ let R = (q = class extends He {
|
|
|
5715
5747
|
* ```
|
|
5716
5748
|
*/
|
|
5717
5749
|
setHorizontalAlignment(e) {
|
|
5718
|
-
return this._commandService.syncExecuteCommand(
|
|
5750
|
+
return this._commandService.syncExecuteCommand(on.id, {
|
|
5719
5751
|
unitId: this._workbook.getUnitId(),
|
|
5720
5752
|
subUnitId: this._worksheet.getSheetId(),
|
|
5721
5753
|
range: this._range,
|
|
5722
|
-
value:
|
|
5754
|
+
value: $n(e)
|
|
5723
5755
|
}), this;
|
|
5724
5756
|
}
|
|
5725
5757
|
/**
|
|
@@ -5738,7 +5770,7 @@ let R = (q = class extends He {
|
|
|
5738
5770
|
* ```
|
|
5739
5771
|
*/
|
|
5740
5772
|
setValues(e) {
|
|
5741
|
-
const t =
|
|
5773
|
+
const t = Qe(e, this._range);
|
|
5742
5774
|
return this._commandService.syncExecuteCommand(X.id, {
|
|
5743
5775
|
unitId: this._workbook.getUnitId(),
|
|
5744
5776
|
subUnitId: this._worksheet.getSheetId(),
|
|
@@ -6009,7 +6041,7 @@ let R = (q = class extends He {
|
|
|
6009
6041
|
* ```
|
|
6010
6042
|
*/
|
|
6011
6043
|
mergeAcross(e) {
|
|
6012
|
-
const t =
|
|
6044
|
+
const t = mt([this._range], G.ROWS), s = this._workbook.getUnitId(), n = this._worksheet.getSheetId();
|
|
6013
6045
|
return Re(this._injector, s, n, t, e), this;
|
|
6014
6046
|
}
|
|
6015
6047
|
/**
|
|
@@ -6041,7 +6073,7 @@ let R = (q = class extends He {
|
|
|
6041
6073
|
* ```
|
|
6042
6074
|
*/
|
|
6043
6075
|
mergeVertically(e) {
|
|
6044
|
-
const t =
|
|
6076
|
+
const t = mt([this._range], G.COLUMNS), s = this._workbook.getUnitId(), n = this._worksheet.getSheetId();
|
|
6045
6077
|
return Re(this._injector, s, n, t, e), this;
|
|
6046
6078
|
}
|
|
6047
6079
|
/**
|
|
@@ -6077,7 +6109,7 @@ let R = (q = class extends He {
|
|
|
6077
6109
|
* ```
|
|
6078
6110
|
*/
|
|
6079
6111
|
breakApart() {
|
|
6080
|
-
return this._commandService.syncExecuteCommand(
|
|
6112
|
+
return this._commandService.syncExecuteCommand(an.id, {
|
|
6081
6113
|
unitId: this._workbook.getUnitId(),
|
|
6082
6114
|
subUnitId: this._worksheet.getSheetId(),
|
|
6083
6115
|
ranges: [this._range]
|
|
@@ -6157,7 +6189,7 @@ let R = (q = class extends He {
|
|
|
6157
6189
|
* ```
|
|
6158
6190
|
*/
|
|
6159
6191
|
activate() {
|
|
6160
|
-
return this._injector.createInstance(
|
|
6192
|
+
return this._injector.createInstance(P, this._workbook).setActiveRange(this), this;
|
|
6161
6193
|
}
|
|
6162
6194
|
/**
|
|
6163
6195
|
* Sets the specified cell as the current cell.
|
|
@@ -6194,7 +6226,7 @@ let R = (q = class extends He {
|
|
|
6194
6226
|
activateAsCurrentCell() {
|
|
6195
6227
|
const e = this._worksheet.getMergedCell(this._range.startRow, this._range.startColumn);
|
|
6196
6228
|
if (e && $.equals(e, this._range) || !e && this._range.startRow === this._range.endRow && this._range.startColumn === this._range.endColumn) {
|
|
6197
|
-
const n = this._injector.createInstance(
|
|
6229
|
+
const n = this._injector.createInstance(P, this._workbook).getActiveRange();
|
|
6198
6230
|
if (!n || n.getUnitId() !== this.getUnitId() || n.getSheetId() !== this.getSheetId())
|
|
6199
6231
|
return this.activate();
|
|
6200
6232
|
if ($.contains(n.getRange(), this._range)) {
|
|
@@ -6250,7 +6282,7 @@ let R = (q = class extends He {
|
|
|
6250
6282
|
* ```
|
|
6251
6283
|
*/
|
|
6252
6284
|
splitTextToColumns(e, t, s) {
|
|
6253
|
-
this._commandService.syncExecuteCommand(
|
|
6285
|
+
this._commandService.syncExecuteCommand(hn.id, {
|
|
6254
6286
|
unitId: this._workbook.getUnitId(),
|
|
6255
6287
|
subUnitId: this._worksheet.getSheetId(),
|
|
6256
6288
|
range: this._range,
|
|
@@ -6275,7 +6307,7 @@ let R = (q = class extends He {
|
|
|
6275
6307
|
const t = this.getUsedThemeStyle();
|
|
6276
6308
|
t && this.removeThemeStyle(t);
|
|
6277
6309
|
} else
|
|
6278
|
-
this._commandService.syncExecuteCommand(
|
|
6310
|
+
this._commandService.syncExecuteCommand(dn.id, {
|
|
6279
6311
|
unitId: this._workbook.getUnitId(),
|
|
6280
6312
|
subUnitId: this._worksheet.getSheetId(),
|
|
6281
6313
|
range: this._range,
|
|
@@ -6294,7 +6326,7 @@ let R = (q = class extends He {
|
|
|
6294
6326
|
* ```
|
|
6295
6327
|
*/
|
|
6296
6328
|
removeThemeStyle(e) {
|
|
6297
|
-
this._commandService.syncExecuteCommand(
|
|
6329
|
+
this._commandService.syncExecuteCommand(cn.id, {
|
|
6298
6330
|
unitId: this._workbook.getUnitId(),
|
|
6299
6331
|
subUnitId: this._worksheet.getSheetId(),
|
|
6300
6332
|
range: this._range,
|
|
@@ -6315,7 +6347,7 @@ let R = (q = class extends He {
|
|
|
6315
6347
|
* ```
|
|
6316
6348
|
*/
|
|
6317
6349
|
getUsedThemeStyle() {
|
|
6318
|
-
return this._injector.get(
|
|
6350
|
+
return this._injector.get(jt).getAppliedRangeThemeStyle({
|
|
6319
6351
|
unitId: this._workbook.getUnitId(),
|
|
6320
6352
|
subUnitId: this._worksheet.getSheetId(),
|
|
6321
6353
|
range: this._range
|
|
@@ -6341,7 +6373,7 @@ let R = (q = class extends He {
|
|
|
6341
6373
|
* ```
|
|
6342
6374
|
*/
|
|
6343
6375
|
clear(e) {
|
|
6344
|
-
return e && e.contentsOnly && !e.formatOnly ? this.clearContent() : e && e.formatOnly && !e.contentsOnly ? this.clearFormat() : (this._commandService.syncExecuteCommand(
|
|
6376
|
+
return e && e.contentsOnly && !e.formatOnly ? this.clearContent() : e && e.formatOnly && !e.contentsOnly ? this.clearFormat() : (this._commandService.syncExecuteCommand(Mt.id, {
|
|
6345
6377
|
unitId: this._workbook.getUnitId(),
|
|
6346
6378
|
subUnitId: this._worksheet.getSheetId(),
|
|
6347
6379
|
ranges: [this._range],
|
|
@@ -6381,7 +6413,7 @@ let R = (q = class extends He {
|
|
|
6381
6413
|
* ```
|
|
6382
6414
|
*/
|
|
6383
6415
|
clearFormat() {
|
|
6384
|
-
return this._commandService.syncExecuteCommand(
|
|
6416
|
+
return this._commandService.syncExecuteCommand(Wt.id, {
|
|
6385
6417
|
unitId: this._workbook.getUnitId(),
|
|
6386
6418
|
subUnitId: this._worksheet.getSheetId(),
|
|
6387
6419
|
ranges: [this._range]
|
|
@@ -6443,9 +6475,9 @@ let R = (q = class extends He {
|
|
|
6443
6475
|
* ```
|
|
6444
6476
|
*/
|
|
6445
6477
|
insertCells(e) {
|
|
6446
|
-
e === G.ROWS ? this._commandService.executeCommand(
|
|
6478
|
+
e === G.ROWS ? this._commandService.executeCommand(un.id, {
|
|
6447
6479
|
range: this._range
|
|
6448
|
-
}) : this._commandService.executeCommand(
|
|
6480
|
+
}) : this._commandService.executeCommand(ln.id, {
|
|
6449
6481
|
range: this._range
|
|
6450
6482
|
});
|
|
6451
6483
|
}
|
|
@@ -6505,9 +6537,9 @@ let R = (q = class extends He {
|
|
|
6505
6537
|
* ```
|
|
6506
6538
|
*/
|
|
6507
6539
|
deleteCells(e) {
|
|
6508
|
-
e === G.ROWS ? this._commandService.executeCommand(
|
|
6540
|
+
e === G.ROWS ? this._commandService.executeCommand(mn.id, {
|
|
6509
6541
|
range: this._range
|
|
6510
|
-
}) : this._commandService.executeCommand(
|
|
6542
|
+
}) : this._commandService.executeCommand(gn.id, {
|
|
6511
6543
|
range: this._range
|
|
6512
6544
|
});
|
|
6513
6545
|
}
|
|
@@ -6696,7 +6728,7 @@ let R = (q = class extends He {
|
|
|
6696
6728
|
* ```
|
|
6697
6729
|
*/
|
|
6698
6730
|
getRangePermission() {
|
|
6699
|
-
const e = this._injector.createInstance(v, this._injector.createInstance(
|
|
6731
|
+
const e = this._injector.createInstance(v, this._injector.createInstance(P, this._workbook), this._workbook, this._worksheet);
|
|
6700
6732
|
return this._injector.createInstance(
|
|
6701
6733
|
Ae,
|
|
6702
6734
|
this._workbook.getUnitId(),
|
|
@@ -6706,13 +6738,13 @@ let R = (q = class extends He {
|
|
|
6706
6738
|
);
|
|
6707
6739
|
}
|
|
6708
6740
|
}, q._enableManualInit(), q);
|
|
6709
|
-
R =
|
|
6710
|
-
|
|
6711
|
-
|
|
6712
|
-
|
|
6741
|
+
R = Yn([
|
|
6742
|
+
Ee(3, l(E)),
|
|
6743
|
+
Ee(4, C),
|
|
6744
|
+
Ee(5, l(Un))
|
|
6713
6745
|
], R);
|
|
6714
|
-
var
|
|
6715
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
6746
|
+
var Zn = Object.getOwnPropertyDescriptor, Qn = (r, e, t, s) => {
|
|
6747
|
+
for (var n = s > 1 ? void 0 : s ? Zn(e, t) : e, i = r.length - 1, o; i >= 0; i--)
|
|
6716
6748
|
(o = r[i]) && (n = o(n) || n);
|
|
6717
6749
|
return n;
|
|
6718
6750
|
}, Ue = (r, e) => (t, s) => e(t, s, r);
|
|
@@ -6721,7 +6753,7 @@ let Be = class {
|
|
|
6721
6753
|
w(this, "_permissionSubject");
|
|
6722
6754
|
// Collaborator changes are tracked manually since IAuthzIoService doesn't provide an observable
|
|
6723
6755
|
// TODO: If IAuthzIoService adds an observable in the future, migrate to use that
|
|
6724
|
-
w(this, "_collaboratorChangeSubject", new
|
|
6756
|
+
w(this, "_collaboratorChangeSubject", new xn());
|
|
6725
6757
|
/**
|
|
6726
6758
|
* Observable stream of permission snapshot changes (BehaviorSubject)
|
|
6727
6759
|
* Emits immediately on subscription with current state, then on any permission point change
|
|
@@ -6749,7 +6781,7 @@ let Be = class {
|
|
|
6749
6781
|
*/
|
|
6750
6782
|
_createPermissionStream() {
|
|
6751
6783
|
const r = this._permissionService.permissionPointUpdate$.pipe(
|
|
6752
|
-
|
|
6784
|
+
M((e) => e.id.includes(this._unitId))
|
|
6753
6785
|
).subscribe(() => {
|
|
6754
6786
|
this._permissionSubject.next(this._buildSnapshot());
|
|
6755
6787
|
});
|
|
@@ -6769,14 +6801,14 @@ let Be = class {
|
|
|
6769
6801
|
r.set(t, this.getPoint(t));
|
|
6770
6802
|
}
|
|
6771
6803
|
return this._permissionService.permissionPointUpdate$.pipe(
|
|
6772
|
-
|
|
6804
|
+
M((e) => e.id.includes(this._unitId)),
|
|
6773
6805
|
we((e) => {
|
|
6774
6806
|
const t = this._extractWorkbookPointType(e.id);
|
|
6775
6807
|
if (!t) return null;
|
|
6776
6808
|
const s = !!e.value, n = r.get(t);
|
|
6777
6809
|
return r.set(t, s), n === s ? null : { point: t, value: s, oldValue: n };
|
|
6778
6810
|
}),
|
|
6779
|
-
|
|
6811
|
+
M((e) => e !== null),
|
|
6780
6812
|
N({ bufferSize: 1, refCount: !0 })
|
|
6781
6813
|
);
|
|
6782
6814
|
}
|
|
@@ -7159,17 +7191,17 @@ let Be = class {
|
|
|
7159
7191
|
this._subscriptions.forEach((r) => r.unsubscribe()), this._permissionSubject.complete(), this._collaboratorChangeSubject.complete();
|
|
7160
7192
|
}
|
|
7161
7193
|
};
|
|
7162
|
-
Be =
|
|
7163
|
-
Ue(1, l(
|
|
7194
|
+
Be = Qn([
|
|
7195
|
+
Ue(1, l(E)),
|
|
7164
7196
|
Ue(2, Y),
|
|
7165
7197
|
Ue(3, re)
|
|
7166
7198
|
], Be);
|
|
7167
|
-
var
|
|
7168
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
7199
|
+
var Xn = Object.getOwnPropertyDescriptor, er = (r, e, t, s) => {
|
|
7200
|
+
for (var n = s > 1 ? void 0 : s ? Xn(e, t) : e, i = r.length - 1, o; i >= 0; i--)
|
|
7169
7201
|
(o = r[i]) && (n = o(n) || n);
|
|
7170
7202
|
return n;
|
|
7171
7203
|
}, j = (r, e) => (t, s) => e(t, s, r);
|
|
7172
|
-
let
|
|
7204
|
+
let P = class extends He {
|
|
7173
7205
|
constructor(e, t, s, n, i, o, a, h, c, d) {
|
|
7174
7206
|
super(t);
|
|
7175
7207
|
w(this, "id");
|
|
@@ -7231,7 +7263,7 @@ let E = class extends He {
|
|
|
7231
7263
|
* ```
|
|
7232
7264
|
*/
|
|
7233
7265
|
setName(e) {
|
|
7234
|
-
return this._commandService.syncExecuteCommand(
|
|
7266
|
+
return this._commandService.syncExecuteCommand(_n.id, {
|
|
7235
7267
|
unitId: this._workbook.getUnitId(),
|
|
7236
7268
|
name: e
|
|
7237
7269
|
}), this;
|
|
@@ -7331,7 +7363,7 @@ let E = class extends He {
|
|
|
7331
7363
|
*/
|
|
7332
7364
|
create(e, t, s, n) {
|
|
7333
7365
|
var h, c, d;
|
|
7334
|
-
const i =
|
|
7366
|
+
const i = Xe(et.deepClone((h = n == null ? void 0 : n.sheet) != null ? h : {}));
|
|
7335
7367
|
i.name = this._workbook.uniqueSheetName(e), i.rowCount = t, i.columnCount = s, i.id = (c = n == null ? void 0 : n.sheet) == null ? void 0 : c.id;
|
|
7336
7368
|
const o = (d = n == null ? void 0 : n.index) != null ? d : this._workbook.getSheets().length;
|
|
7337
7369
|
this._commandService.syncExecuteCommand(me.id, {
|
|
@@ -7438,7 +7470,7 @@ let E = class extends He {
|
|
|
7438
7470
|
*/
|
|
7439
7471
|
insertSheet(e, t) {
|
|
7440
7472
|
var o, a, h;
|
|
7441
|
-
const s =
|
|
7473
|
+
const s = Xe(et.deepClone((o = t == null ? void 0 : t.sheet) != null ? o : {}));
|
|
7442
7474
|
s.name = this._workbook.uniqueSheetName(e), s.id = (a = t == null ? void 0 : t.sheet) == null ? void 0 : a.id;
|
|
7443
7475
|
const n = (h = t == null ? void 0 : t.index) != null ? h : this._workbook.getSheets().length;
|
|
7444
7476
|
this._commandService.syncExecuteCommand(me.id, {
|
|
@@ -7488,7 +7520,7 @@ let E = class extends He {
|
|
|
7488
7520
|
* ```
|
|
7489
7521
|
*/
|
|
7490
7522
|
undo() {
|
|
7491
|
-
return this._univerInstanceService.focusUnit(this.id), this._commandService.syncExecuteCommand(
|
|
7523
|
+
return this._univerInstanceService.focusUnit(this.id), this._commandService.syncExecuteCommand(At.id), this;
|
|
7492
7524
|
}
|
|
7493
7525
|
/**
|
|
7494
7526
|
* Redo the last undone action.
|
|
@@ -7501,7 +7533,7 @@ let E = class extends He {
|
|
|
7501
7533
|
* ```
|
|
7502
7534
|
*/
|
|
7503
7535
|
redo() {
|
|
7504
|
-
return this._univerInstanceService.focusUnit(this.id), this._commandService.syncExecuteCommand(
|
|
7536
|
+
return this._univerInstanceService.focusUnit(this.id), this._commandService.syncExecuteCommand(Bt.id), this;
|
|
7505
7537
|
}
|
|
7506
7538
|
/**
|
|
7507
7539
|
* Callback for command execution.
|
|
@@ -7570,7 +7602,7 @@ let E = class extends He {
|
|
|
7570
7602
|
* ```
|
|
7571
7603
|
*/
|
|
7572
7604
|
onSelectionChange(e) {
|
|
7573
|
-
return
|
|
7605
|
+
return vt(
|
|
7574
7606
|
this._selectionManagerService.selectionMoveEnd$.subscribe((t) => {
|
|
7575
7607
|
this._univerInstanceService.getCurrentUnitForType(F.UNIVER_SHEET).getUnitId() === this.id && (t != null && t.length ? e(t.map((s) => s.range)) : e([]));
|
|
7576
7608
|
})
|
|
@@ -7675,7 +7707,7 @@ let E = class extends He {
|
|
|
7675
7707
|
* ```
|
|
7676
7708
|
*/
|
|
7677
7709
|
duplicateSheet(e) {
|
|
7678
|
-
return this._commandService.syncExecuteCommand(
|
|
7710
|
+
return this._commandService.syncExecuteCommand(wn.id, {
|
|
7679
7711
|
unitId: e.getWorkbook().getUnitId(),
|
|
7680
7712
|
subUnitId: e.getSheetId()
|
|
7681
7713
|
}), this._injector.createInstance(v, this, this._workbook, this._workbook.getActiveSheet());
|
|
@@ -7771,7 +7803,7 @@ let E = class extends He {
|
|
|
7771
7803
|
*/
|
|
7772
7804
|
moveSheet(e, t) {
|
|
7773
7805
|
let s = t;
|
|
7774
|
-
return s < 0 ? s = 0 : s > this._workbook.getSheets().length - 1 && (s = this._workbook.getSheets().length - 1), this._commandService.syncExecuteCommand(
|
|
7806
|
+
return s < 0 ? s = 0 : s > this._workbook.getSheets().length - 1 && (s = this._workbook.getSheets().length - 1), this._commandService.syncExecuteCommand(Sn.id, {
|
|
7775
7807
|
unitId: e.getWorkbook().getUnitId(),
|
|
7776
7808
|
order: s,
|
|
7777
7809
|
subUnitId: e.getSheetId()
|
|
@@ -7917,7 +7949,7 @@ let E = class extends He {
|
|
|
7917
7949
|
* ```
|
|
7918
7950
|
*/
|
|
7919
7951
|
insertDefinedNameBuilder(e) {
|
|
7920
|
-
e.unitId = this.getId(), this._commandService.syncExecuteCommand(
|
|
7952
|
+
e.unitId = this.getId(), this._commandService.syncExecuteCommand(De.id, e);
|
|
7921
7953
|
}
|
|
7922
7954
|
/**
|
|
7923
7955
|
* Update the defined name with the given name.
|
|
@@ -7941,7 +7973,7 @@ let E = class extends He {
|
|
|
7941
7973
|
* ```
|
|
7942
7974
|
*/
|
|
7943
7975
|
updateDefinedNameBuilder(e) {
|
|
7944
|
-
this._commandService.syncExecuteCommand(
|
|
7976
|
+
this._commandService.syncExecuteCommand(De.id, e);
|
|
7945
7977
|
}
|
|
7946
7978
|
/**
|
|
7947
7979
|
* Gets the registered range themes.
|
|
@@ -7955,7 +7987,7 @@ let E = class extends He {
|
|
|
7955
7987
|
* ```
|
|
7956
7988
|
*/
|
|
7957
7989
|
getRegisteredRangeThemes() {
|
|
7958
|
-
return this._injector.get(
|
|
7990
|
+
return this._injector.get(jt).getRegisteredRangeThemes();
|
|
7959
7991
|
}
|
|
7960
7992
|
/**
|
|
7961
7993
|
* Register a custom range theme style.
|
|
@@ -7975,7 +8007,7 @@ let E = class extends He {
|
|
|
7975
8007
|
* ```
|
|
7976
8008
|
*/
|
|
7977
8009
|
registerRangeTheme(e) {
|
|
7978
|
-
this._commandService.syncExecuteCommand(
|
|
8010
|
+
this._commandService.syncExecuteCommand(kn.id, {
|
|
7979
8011
|
unitId: this.getId(),
|
|
7980
8012
|
rangeThemeStyle: e
|
|
7981
8013
|
});
|
|
@@ -7991,7 +8023,7 @@ let E = class extends He {
|
|
|
7991
8023
|
* ```
|
|
7992
8024
|
*/
|
|
7993
8025
|
unregisterRangeTheme(e) {
|
|
7994
|
-
this._commandService.syncExecuteCommand(
|
|
8026
|
+
this._commandService.syncExecuteCommand(Cn.id, {
|
|
7995
8027
|
unitId: this.getId(),
|
|
7996
8028
|
themeName: e
|
|
7997
8029
|
});
|
|
@@ -8015,7 +8047,7 @@ let E = class extends He {
|
|
|
8015
8047
|
* ```
|
|
8016
8048
|
*/
|
|
8017
8049
|
createRangeThemeStyle(e, t) {
|
|
8018
|
-
return new
|
|
8050
|
+
return new bn(e, t);
|
|
8019
8051
|
}
|
|
8020
8052
|
/**
|
|
8021
8053
|
* Set custom metadata of workbook
|
|
@@ -8120,18 +8152,18 @@ let E = class extends He {
|
|
|
8120
8152
|
this._workbook.removeStyles(e);
|
|
8121
8153
|
}
|
|
8122
8154
|
};
|
|
8123
|
-
|
|
8124
|
-
j(1, l(
|
|
8125
|
-
j(2, l(
|
|
8126
|
-
j(3, l(
|
|
8127
|
-
j(4,
|
|
8155
|
+
P = er([
|
|
8156
|
+
j(1, l(E)),
|
|
8157
|
+
j(2, l(Ft)),
|
|
8158
|
+
j(3, l(xt)),
|
|
8159
|
+
j(4, Me),
|
|
8128
8160
|
j(5, C),
|
|
8129
8161
|
j(6, Y),
|
|
8130
|
-
j(7,
|
|
8131
|
-
j(8, l(
|
|
8132
|
-
j(9,
|
|
8133
|
-
],
|
|
8134
|
-
class
|
|
8162
|
+
j(7, ft),
|
|
8163
|
+
j(8, l(bt)),
|
|
8164
|
+
j(9, Nt)
|
|
8165
|
+
], P);
|
|
8166
|
+
class tr extends Rt {
|
|
8135
8167
|
getCommandSheetTarget(e) {
|
|
8136
8168
|
var i;
|
|
8137
8169
|
const t = e.params;
|
|
@@ -8152,29 +8184,33 @@ class er extends vt {
|
|
|
8152
8184
|
return { workbook: s, worksheet: n };
|
|
8153
8185
|
}
|
|
8154
8186
|
_initWorkbookEvent(e) {
|
|
8155
|
-
const t = e.get(
|
|
8156
|
-
this.
|
|
8157
|
-
this.
|
|
8158
|
-
|
|
8159
|
-
|
|
8160
|
-
|
|
8161
|
-
unitType: s.type,
|
|
8162
|
-
snapshot: s.getSnapshot()
|
|
8163
|
-
});
|
|
8164
|
-
})
|
|
8165
|
-
), this.registerEventHandler(
|
|
8166
|
-
this.Event.WorkbookCreated,
|
|
8167
|
-
() => t.unitAdded$.subscribe((s) => {
|
|
8168
|
-
if (s.type === F.UNIVER_SHEET) {
|
|
8169
|
-
const n = s, i = e.createInstance(E, n);
|
|
8170
|
-
this.fireEvent(this.Event.WorkbookCreated, {
|
|
8187
|
+
const t = e.get(Me);
|
|
8188
|
+
this.disposeWithMe(
|
|
8189
|
+
this.registerEventHandler(
|
|
8190
|
+
this.Event.WorkbookDisposed,
|
|
8191
|
+
() => t.unitDisposed$.subscribe((s) => {
|
|
8192
|
+
s.type === F.UNIVER_SHEET && this.fireEvent(this.Event.WorkbookDisposed, {
|
|
8171
8193
|
unitId: s.getUnitId(),
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
unit: i
|
|
8194
|
+
unitType: s.type,
|
|
8195
|
+
snapshot: s.getSnapshot()
|
|
8175
8196
|
});
|
|
8176
|
-
}
|
|
8177
|
-
|
|
8197
|
+
})
|
|
8198
|
+
)
|
|
8199
|
+
), this.disposeWithMe(
|
|
8200
|
+
this.registerEventHandler(
|
|
8201
|
+
this.Event.WorkbookCreated,
|
|
8202
|
+
() => t.unitAdded$.subscribe((s) => {
|
|
8203
|
+
if (s.type === F.UNIVER_SHEET) {
|
|
8204
|
+
const n = s, i = e.createInstance(P, n);
|
|
8205
|
+
this.fireEvent(this.Event.WorkbookCreated, {
|
|
8206
|
+
unitId: s.getUnitId(),
|
|
8207
|
+
type: s.type,
|
|
8208
|
+
workbook: i,
|
|
8209
|
+
unit: i
|
|
8210
|
+
});
|
|
8211
|
+
}
|
|
8212
|
+
})
|
|
8213
|
+
)
|
|
8178
8214
|
);
|
|
8179
8215
|
}
|
|
8180
8216
|
/**
|
|
@@ -8183,275 +8219,311 @@ class er extends vt {
|
|
|
8183
8219
|
// eslint-disable-next-line max-lines-per-function
|
|
8184
8220
|
_initialize(e) {
|
|
8185
8221
|
const t = e.get(C);
|
|
8186
|
-
this.
|
|
8187
|
-
this.
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
|
|
8193
|
-
|
|
8194
|
-
|
|
8195
|
-
|
|
8196
|
-
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
|
|
8205
|
-
|
|
8206
|
-
|
|
8207
|
-
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
|
|
8213
|
-
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8224
|
-
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
|
|
8255
|
-
|
|
8256
|
-
|
|
8257
|
-
|
|
8258
|
-
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
|
|
8263
|
-
if (
|
|
8264
|
-
|
|
8265
|
-
|
|
8266
|
-
|
|
8267
|
-
|
|
8268
|
-
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
|
|
8277
|
-
|
|
8278
|
-
|
|
8279
|
-
|
|
8280
|
-
|
|
8281
|
-
|
|
8282
|
-
|
|
8283
|
-
|
|
8284
|
-
|
|
8285
|
-
|
|
8286
|
-
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
|
|
8295
|
-
|
|
8296
|
-
|
|
8297
|
-
|
|
8298
|
-
|
|
8299
|
-
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8307
|
-
|
|
8308
|
-
|
|
8309
|
-
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
|
|
8317
|
-
|
|
8318
|
-
|
|
8319
|
-
|
|
8320
|
-
|
|
8321
|
-
|
|
8322
|
-
|
|
8323
|
-
|
|
8324
|
-
|
|
8325
|
-
|
|
8326
|
-
|
|
8327
|
-
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
-
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
|
|
8343
|
-
}
|
|
8344
|
-
}
|
|
8345
|
-
|
|
8346
|
-
), this.
|
|
8347
|
-
this.
|
|
8348
|
-
|
|
8349
|
-
|
|
8350
|
-
|
|
8351
|
-
|
|
8352
|
-
|
|
8353
|
-
|
|
8354
|
-
|
|
8355
|
-
|
|
8356
|
-
|
|
8357
|
-
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
|
|
8367
|
-
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
|
|
8383
|
-
|
|
8384
|
-
|
|
8385
|
-
|
|
8386
|
-
|
|
8387
|
-
|
|
8388
|
-
|
|
8389
|
-
|
|
8390
|
-
|
|
8391
|
-
|
|
8392
|
-
|
|
8393
|
-
|
|
8394
|
-
|
|
8395
|
-
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8412
|
-
|
|
8413
|
-
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
if (
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8222
|
+
this.disposeWithMe(
|
|
8223
|
+
this.registerEventHandler(
|
|
8224
|
+
this.Event.BeforeSheetCreate,
|
|
8225
|
+
() => t.beforeCommandExecuted((s) => {
|
|
8226
|
+
var n;
|
|
8227
|
+
if (s.id === me.id) {
|
|
8228
|
+
const i = s.params, { unitId: o, index: a, sheet: h } = i || {}, c = o ? this.getUniverSheet(o) : (n = this.getActiveWorkbook) == null ? void 0 : n.call(this);
|
|
8229
|
+
if (!c)
|
|
8230
|
+
return;
|
|
8231
|
+
const d = {
|
|
8232
|
+
workbook: c,
|
|
8233
|
+
index: a,
|
|
8234
|
+
sheet: h
|
|
8235
|
+
};
|
|
8236
|
+
if (this.fireEvent(this.Event.BeforeSheetCreate, d), d.cancel)
|
|
8237
|
+
throw new D();
|
|
8238
|
+
}
|
|
8239
|
+
})
|
|
8240
|
+
)
|
|
8241
|
+
), this.disposeWithMe(
|
|
8242
|
+
this.registerEventHandler(
|
|
8243
|
+
this.Event.BeforeActiveSheetChange,
|
|
8244
|
+
() => t.beforeCommandExecuted((s) => {
|
|
8245
|
+
var n;
|
|
8246
|
+
if (s.id === te.id) {
|
|
8247
|
+
const { subUnitId: i, unitId: o } = s.params, a = o ? this.getUniverSheet(o) : (n = this.getActiveWorkbook) == null ? void 0 : n.call(this);
|
|
8248
|
+
if (!a || !i) return;
|
|
8249
|
+
const h = a.getSheetBySheetId(i), c = a.getActiveSheet();
|
|
8250
|
+
if (!h || !c) return;
|
|
8251
|
+
const d = {
|
|
8252
|
+
workbook: a,
|
|
8253
|
+
activeSheet: h,
|
|
8254
|
+
oldActiveSheet: c
|
|
8255
|
+
};
|
|
8256
|
+
if (this.fireEvent(this.Event.BeforeActiveSheetChange, d), d.cancel)
|
|
8257
|
+
throw new D();
|
|
8258
|
+
}
|
|
8259
|
+
})
|
|
8260
|
+
)
|
|
8261
|
+
), this.disposeWithMe(
|
|
8262
|
+
this.registerEventHandler(
|
|
8263
|
+
this.Event.BeforeSheetDelete,
|
|
8264
|
+
() => t.beforeCommandExecuted((s) => {
|
|
8265
|
+
if (s.id === Te.id) {
|
|
8266
|
+
const n = this.getCommandSheetTarget(s);
|
|
8267
|
+
if (!n) return;
|
|
8268
|
+
const { workbook: i, worksheet: o } = n, a = {
|
|
8269
|
+
workbook: i,
|
|
8270
|
+
worksheet: o
|
|
8271
|
+
};
|
|
8272
|
+
if (this.fireEvent(this.Event.BeforeSheetDelete, a), a.cancel)
|
|
8273
|
+
throw new D();
|
|
8274
|
+
}
|
|
8275
|
+
})
|
|
8276
|
+
)
|
|
8277
|
+
), this.disposeWithMe(
|
|
8278
|
+
this.registerEventHandler(
|
|
8279
|
+
this.Event.BeforeSheetMove,
|
|
8280
|
+
() => t.beforeCommandExecuted((s) => {
|
|
8281
|
+
if (s.id === gt.id) {
|
|
8282
|
+
const { fromOrder: n, toOrder: i } = s.params, o = this.getCommandSheetTarget(s);
|
|
8283
|
+
if (!o) return;
|
|
8284
|
+
const a = {
|
|
8285
|
+
workbook: o.workbook,
|
|
8286
|
+
worksheet: o.worksheet,
|
|
8287
|
+
newIndex: i,
|
|
8288
|
+
oldIndex: n
|
|
8289
|
+
};
|
|
8290
|
+
if (this.fireEvent(this.Event.BeforeSheetMove, a), a.cancel)
|
|
8291
|
+
throw new D();
|
|
8292
|
+
}
|
|
8293
|
+
})
|
|
8294
|
+
)
|
|
8295
|
+
), this.disposeWithMe(
|
|
8296
|
+
this.registerEventHandler(
|
|
8297
|
+
this.Event.BeforeSheetNameChange,
|
|
8298
|
+
() => t.beforeCommandExecuted((s) => {
|
|
8299
|
+
if (s.id === Oe.id) {
|
|
8300
|
+
const { name: n } = s.params, i = this.getCommandSheetTarget(s);
|
|
8301
|
+
if (!i) return;
|
|
8302
|
+
const o = {
|
|
8303
|
+
workbook: i.workbook,
|
|
8304
|
+
worksheet: i.worksheet,
|
|
8305
|
+
newName: n,
|
|
8306
|
+
oldName: i.worksheet.getSheetName()
|
|
8307
|
+
};
|
|
8308
|
+
if (this.fireEvent(this.Event.BeforeSheetNameChange, o), o.cancel)
|
|
8309
|
+
throw new D();
|
|
8310
|
+
}
|
|
8311
|
+
})
|
|
8312
|
+
)
|
|
8313
|
+
), this.disposeWithMe(
|
|
8314
|
+
this.registerEventHandler(
|
|
8315
|
+
this.Event.BeforeSheetTabColorChange,
|
|
8316
|
+
() => t.beforeCommandExecuted((s) => {
|
|
8317
|
+
if (s.id === _t.id) {
|
|
8318
|
+
const { color: n } = s.params, i = this.getCommandSheetTarget(s);
|
|
8319
|
+
if (!i) return;
|
|
8320
|
+
const o = {
|
|
8321
|
+
workbook: i.workbook,
|
|
8322
|
+
worksheet: i.worksheet,
|
|
8323
|
+
newColor: n,
|
|
8324
|
+
oldColor: i.worksheet.getTabColor()
|
|
8325
|
+
};
|
|
8326
|
+
if (this.fireEvent(this.Event.BeforeSheetTabColorChange, o), o.cancel)
|
|
8327
|
+
throw new D();
|
|
8328
|
+
}
|
|
8329
|
+
})
|
|
8330
|
+
)
|
|
8331
|
+
), this.disposeWithMe(
|
|
8332
|
+
this.registerEventHandler(
|
|
8333
|
+
this.Event.BeforeSheetHideChange,
|
|
8334
|
+
() => t.beforeCommandExecuted((s) => {
|
|
8335
|
+
if (s.id === wt.id) {
|
|
8336
|
+
const { hidden: n } = s.params, i = this.getCommandSheetTarget(s);
|
|
8337
|
+
if (!i) return;
|
|
8338
|
+
const o = {
|
|
8339
|
+
workbook: i.workbook,
|
|
8340
|
+
worksheet: i.worksheet,
|
|
8341
|
+
hidden: !!n
|
|
8342
|
+
};
|
|
8343
|
+
if (this.fireEvent(this.Event.BeforeSheetHideChange, o), o.cancel)
|
|
8344
|
+
throw new D();
|
|
8345
|
+
}
|
|
8346
|
+
})
|
|
8347
|
+
)
|
|
8348
|
+
), this.disposeWithMe(
|
|
8349
|
+
this.registerEventHandler(
|
|
8350
|
+
this.Event.BeforeGridlineColorChange,
|
|
8351
|
+
() => t.beforeCommandExecuted((s) => {
|
|
8352
|
+
var n;
|
|
8353
|
+
if (s.id === Ne.id) {
|
|
8354
|
+
const i = this.getCommandSheetTarget(s);
|
|
8355
|
+
if (!i) return;
|
|
8356
|
+
const o = {
|
|
8357
|
+
...i,
|
|
8358
|
+
color: (n = s.params) == null ? void 0 : n.color
|
|
8359
|
+
};
|
|
8360
|
+
if (this.fireEvent(this.Event.BeforeGridlineColorChange, o), o.cancel)
|
|
8361
|
+
throw new D();
|
|
8362
|
+
}
|
|
8363
|
+
})
|
|
8364
|
+
)
|
|
8365
|
+
), this.disposeWithMe(
|
|
8366
|
+
this.registerEventHandler(
|
|
8367
|
+
this.Event.BeforeGridlineEnableChange,
|
|
8368
|
+
() => t.beforeCommandExecuted((s) => {
|
|
8369
|
+
var n;
|
|
8370
|
+
if (s.id === je.id) {
|
|
8371
|
+
const i = this.getCommandSheetTarget(s);
|
|
8372
|
+
if (!i) return;
|
|
8373
|
+
const o = {
|
|
8374
|
+
...i,
|
|
8375
|
+
enabled: !!((n = s.params) != null && n.showGridlines)
|
|
8376
|
+
};
|
|
8377
|
+
if (this.fireEvent(this.Event.BeforeGridlineEnableChange, o), o.cancel)
|
|
8378
|
+
throw new D();
|
|
8379
|
+
}
|
|
8380
|
+
})
|
|
8381
|
+
)
|
|
8382
|
+
), this.disposeWithMe(
|
|
8383
|
+
this.registerEventHandler(
|
|
8384
|
+
this.Event.SheetValueChanged,
|
|
8385
|
+
() => t.onCommandExecuted((s) => {
|
|
8386
|
+
if (In.indexOf(s.id) > -1) {
|
|
8387
|
+
if (!this.getActiveSheet()) return;
|
|
8388
|
+
const i = fn(s).map(
|
|
8389
|
+
(o) => {
|
|
8390
|
+
var a, h;
|
|
8391
|
+
return (h = (a = this.getWorkbook(o.unitId)) == null ? void 0 : a.getSheetBySheetId(o.subUnitId)) == null ? void 0 : h.getRange(o.range);
|
|
8392
|
+
}
|
|
8393
|
+
).filter(Boolean);
|
|
8394
|
+
if (!i.length) return;
|
|
8395
|
+
this.fireEvent(this.Event.SheetValueChanged, {
|
|
8396
|
+
payload: s,
|
|
8397
|
+
effectedRanges: i
|
|
8398
|
+
});
|
|
8399
|
+
}
|
|
8400
|
+
})
|
|
8401
|
+
)
|
|
8402
|
+
), this.disposeWithMe(
|
|
8403
|
+
this.registerEventHandler(
|
|
8404
|
+
this.Event.SheetCreated,
|
|
8405
|
+
() => t.onCommandExecuted((s) => {
|
|
8406
|
+
var n;
|
|
8407
|
+
if (s.id === me.id) {
|
|
8408
|
+
const i = s.params, { unitId: o } = i || {}, a = o ? this.getUniverSheet(o) : (n = this.getActiveWorkbook) == null ? void 0 : n.call(this);
|
|
8409
|
+
if (!a)
|
|
8410
|
+
return;
|
|
8411
|
+
const h = a.getActiveSheet();
|
|
8412
|
+
if (!h)
|
|
8413
|
+
return;
|
|
8414
|
+
const c = {
|
|
8415
|
+
workbook: a,
|
|
8416
|
+
worksheet: h
|
|
8417
|
+
};
|
|
8418
|
+
this.fireEvent(
|
|
8419
|
+
this.Event.SheetCreated,
|
|
8420
|
+
c
|
|
8421
|
+
);
|
|
8422
|
+
}
|
|
8423
|
+
})
|
|
8424
|
+
)
|
|
8425
|
+
), this.disposeWithMe(
|
|
8426
|
+
this.registerEventHandler(
|
|
8427
|
+
this.Event.ActiveSheetChanged,
|
|
8428
|
+
() => t.onCommandExecuted((s) => {
|
|
8429
|
+
if (s.id === te.id) {
|
|
8430
|
+
const n = this.getActiveSheet();
|
|
8431
|
+
if (!n) return;
|
|
8432
|
+
const { workbook: i, worksheet: o } = n;
|
|
8433
|
+
this._fireActiveSheetChanged(i, o);
|
|
8434
|
+
}
|
|
8435
|
+
})
|
|
8436
|
+
)
|
|
8437
|
+
), this.disposeWithMe(
|
|
8438
|
+
this.registerEventHandler(
|
|
8439
|
+
this.Event.SheetDeleted,
|
|
8440
|
+
() => t.onCommandExecuted((s) => {
|
|
8441
|
+
var n;
|
|
8442
|
+
if (s.id === Te.id) {
|
|
8443
|
+
const { subUnitId: i, unitId: o } = s.params, a = o ? this.getUniverSheet(o) : (n = this.getActiveWorkbook) == null ? void 0 : n.call(this);
|
|
8444
|
+
if (!a || !i) return;
|
|
8445
|
+
this._fireSheetDeleted(a, i);
|
|
8446
|
+
}
|
|
8447
|
+
})
|
|
8448
|
+
)
|
|
8449
|
+
), this.disposeWithMe(
|
|
8450
|
+
this.registerEventHandler(
|
|
8451
|
+
this.Event.SheetMoved,
|
|
8452
|
+
() => t.onCommandExecuted((s) => {
|
|
8453
|
+
if (s.id === gt.id) {
|
|
8454
|
+
const { toOrder: n } = s.params, i = this.getCommandSheetTarget(s);
|
|
8455
|
+
if (!i) return;
|
|
8456
|
+
this._fireSheetMoved(i.workbook, i.worksheet, n);
|
|
8457
|
+
}
|
|
8458
|
+
})
|
|
8459
|
+
)
|
|
8460
|
+
), this.disposeWithMe(
|
|
8461
|
+
this.registerEventHandler(
|
|
8462
|
+
this.Event.SheetNameChanged,
|
|
8463
|
+
() => t.onCommandExecuted((s) => {
|
|
8464
|
+
if (s.id === Oe.id) {
|
|
8465
|
+
const { name: n } = s.params, i = this.getCommandSheetTarget(s);
|
|
8466
|
+
if (!i) return;
|
|
8467
|
+
this._fireSheetNameChanged(i.workbook, i.worksheet, n);
|
|
8468
|
+
}
|
|
8469
|
+
})
|
|
8470
|
+
)
|
|
8471
|
+
), this.disposeWithMe(
|
|
8472
|
+
this.registerEventHandler(
|
|
8473
|
+
this.Event.SheetTabColorChanged,
|
|
8474
|
+
() => t.onCommandExecuted((s) => {
|
|
8475
|
+
if (s.id === _t.id) {
|
|
8476
|
+
const { color: n } = s.params, i = this.getCommandSheetTarget(s);
|
|
8477
|
+
if (!i) return;
|
|
8478
|
+
this._fireSheetTabColorChanged(i.workbook, i.worksheet, n);
|
|
8479
|
+
}
|
|
8480
|
+
})
|
|
8481
|
+
)
|
|
8482
|
+
), this.disposeWithMe(
|
|
8483
|
+
this.registerEventHandler(
|
|
8484
|
+
this.Event.SheetHideChanged,
|
|
8485
|
+
() => t.onCommandExecuted((s) => {
|
|
8486
|
+
if (s.id === wt.id) {
|
|
8487
|
+
const { hidden: n } = s.params, i = this.getCommandSheetTarget(s);
|
|
8488
|
+
if (!i) return;
|
|
8489
|
+
this._fireSheetHideChanged(i.workbook, i.worksheet, !!n);
|
|
8490
|
+
}
|
|
8491
|
+
})
|
|
8492
|
+
)
|
|
8493
|
+
), this.disposeWithMe(
|
|
8494
|
+
this.registerEventHandler(
|
|
8495
|
+
this.Event.GridlineChanged,
|
|
8496
|
+
() => t.onCommandExecuted((s) => {
|
|
8497
|
+
if (s.id === Ne.id || s.id === je.id) {
|
|
8498
|
+
const n = this.getCommandSheetTarget(s);
|
|
8499
|
+
if (!n) return;
|
|
8500
|
+
this.fireEvent(this.Event.GridlineChanged, {
|
|
8501
|
+
...n,
|
|
8502
|
+
enabled: !n.worksheet.hasHiddenGridLines(),
|
|
8503
|
+
color: n.worksheet.getGridLinesColor()
|
|
8504
|
+
});
|
|
8505
|
+
}
|
|
8506
|
+
})
|
|
8507
|
+
)
|
|
8436
8508
|
), this._initWorkbookEvent(e);
|
|
8437
8509
|
}
|
|
8438
8510
|
createUniverSheet(e, t) {
|
|
8439
|
-
const n = this._injector.get(
|
|
8440
|
-
return this._injector.createInstance(
|
|
8511
|
+
const n = this._injector.get(Me).createUnit(F.UNIVER_SHEET, e, t);
|
|
8512
|
+
return this._injector.createInstance(P, n);
|
|
8441
8513
|
}
|
|
8442
8514
|
createWorkbook(e, t) {
|
|
8443
8515
|
return this.createUniverSheet(e, t);
|
|
8444
8516
|
}
|
|
8445
8517
|
getActiveWorkbook() {
|
|
8446
8518
|
const e = this._univerInstanceService.getCurrentUnitForType(F.UNIVER_SHEET);
|
|
8447
|
-
return e ? this._injector.createInstance(
|
|
8519
|
+
return e ? this._injector.createInstance(P, e) : null;
|
|
8448
8520
|
}
|
|
8449
8521
|
getActiveUniverSheet() {
|
|
8450
8522
|
return this.getActiveWorkbook();
|
|
8451
8523
|
}
|
|
8452
8524
|
getUniverSheet(e) {
|
|
8453
8525
|
const t = this._univerInstanceService.getUnit(e, F.UNIVER_SHEET);
|
|
8454
|
-
return t ? this._injector.createInstance(
|
|
8526
|
+
return t ? this._injector.createInstance(P, t) : null;
|
|
8455
8527
|
}
|
|
8456
8528
|
getWorkbook(e) {
|
|
8457
8529
|
return this.getUniverSheet(e);
|
|
@@ -8461,10 +8533,10 @@ class er extends vt {
|
|
|
8461
8533
|
}
|
|
8462
8534
|
onUniverSheetCreated(e) {
|
|
8463
8535
|
const t = this._univerInstanceService.getTypeOfUnitAdded$(F.UNIVER_SHEET).subscribe((s) => {
|
|
8464
|
-
const n = this._injector.createInstance(
|
|
8536
|
+
const n = this._injector.createInstance(P, s);
|
|
8465
8537
|
e(n);
|
|
8466
8538
|
});
|
|
8467
|
-
return
|
|
8539
|
+
return vt(t);
|
|
8468
8540
|
}
|
|
8469
8541
|
newDefinedName() {
|
|
8470
8542
|
return this._injector.createInstance(Ce);
|
|
@@ -8477,7 +8549,7 @@ class er extends vt {
|
|
|
8477
8549
|
return t ? { workbook: e, worksheet: t } : null;
|
|
8478
8550
|
}
|
|
8479
8551
|
setFreezeSync(e) {
|
|
8480
|
-
this._injector.get(
|
|
8552
|
+
this._injector.get(vn).setEnabled(e);
|
|
8481
8553
|
}
|
|
8482
8554
|
_fireActiveSheetChanged(e, t) {
|
|
8483
8555
|
this.fireEvent(this.Event.ActiveSheetChanged, {
|
|
@@ -8520,16 +8592,16 @@ class er extends vt {
|
|
|
8520
8592
|
});
|
|
8521
8593
|
}
|
|
8522
8594
|
}
|
|
8523
|
-
|
|
8524
|
-
class
|
|
8595
|
+
Rt.extend(tr);
|
|
8596
|
+
class sr {
|
|
8525
8597
|
get SheetValueChangeType() {
|
|
8526
|
-
return
|
|
8598
|
+
return Rn;
|
|
8527
8599
|
}
|
|
8528
8600
|
get SheetSkeletonChangeType() {
|
|
8529
|
-
return
|
|
8601
|
+
return pn;
|
|
8530
8602
|
}
|
|
8531
8603
|
get SplitDelimiterType() {
|
|
8532
|
-
return
|
|
8604
|
+
return yn;
|
|
8533
8605
|
}
|
|
8534
8606
|
get UnitRole() {
|
|
8535
8607
|
return H;
|
|
@@ -8544,8 +8616,8 @@ class tr {
|
|
|
8544
8616
|
return b;
|
|
8545
8617
|
}
|
|
8546
8618
|
}
|
|
8547
|
-
|
|
8548
|
-
class
|
|
8619
|
+
Ht.extend(sr);
|
|
8620
|
+
class nr {
|
|
8549
8621
|
get SheetCreated() {
|
|
8550
8622
|
return "SheetCreated";
|
|
8551
8623
|
}
|
|
@@ -8607,27 +8679,27 @@ class sr {
|
|
|
8607
8679
|
return "SheetValueChanged";
|
|
8608
8680
|
}
|
|
8609
8681
|
}
|
|
8610
|
-
|
|
8611
|
-
var
|
|
8612
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
8682
|
+
$t.extend(nr);
|
|
8683
|
+
var rr = Object.getOwnPropertyDescriptor, ir = (r, e, t, s) => {
|
|
8684
|
+
for (var n = s > 1 ? void 0 : s ? rr(e, t) : e, i = r.length - 1, o; i >= 0; i--)
|
|
8613
8685
|
(o = r[i]) && (n = o(n) || n);
|
|
8614
8686
|
return n;
|
|
8615
|
-
},
|
|
8616
|
-
let
|
|
8687
|
+
}, or = (r, e) => (t, s) => e(t, s, r);
|
|
8688
|
+
let Ct = class extends Fe {
|
|
8617
8689
|
constructor(r) {
|
|
8618
8690
|
super(), this._injector = r;
|
|
8619
8691
|
}
|
|
8620
8692
|
};
|
|
8621
|
-
|
|
8622
|
-
|
|
8623
|
-
],
|
|
8693
|
+
Ct = ir([
|
|
8694
|
+
or(0, l(E))
|
|
8695
|
+
], Ct);
|
|
8624
8696
|
export {
|
|
8625
8697
|
z as FPermission,
|
|
8626
8698
|
R as FRange,
|
|
8627
8699
|
ke as FSelection,
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
|
|
8700
|
+
nr as FSheetEventName,
|
|
8701
|
+
Ct as FSheetHooks,
|
|
8702
|
+
sr as FSheetsEnum,
|
|
8703
|
+
P as FWorkbook,
|
|
8632
8704
|
v as FWorksheet
|
|
8633
8705
|
};
|