@univerjs/sheets 0.15.4 → 0.15.5
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/es/facade.js +466 -409
- package/lib/es/index.js +6244 -4715
- package/lib/facade.js +466 -409
- package/lib/index.js +6244 -4715
- package/lib/types/basics/const/command-listener-const.d.ts +2 -2
- package/lib/types/basics/utils.d.ts +1 -0
- package/lib/types/commands/commands/auto-fill.command.d.ts +15 -0
- package/lib/types/commands/commands/refill.command.d.ts +6 -0
- package/lib/types/controllers/auto-fill.controller.d.ts +22 -0
- package/lib/types/controllers/permission/sheet-permission-check.controller.d.ts +1 -0
- package/lib/types/facade/f-range.d.ts +40 -1
- package/lib/types/index.d.ts +10 -3
- package/lib/types/services/auto-fill/auto-fill.service.d.ts +72 -0
- package/lib/types/services/auto-fill/rules.d.ts +12 -0
- package/lib/types/services/auto-fill/tools.d.ts +141 -0
- package/lib/types/services/auto-fill/type.d.ts +66 -0
- package/lib/types/services/ref-range/util.d.ts +2 -2
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +3 -3
- package/package.json +7 -7
package/lib/es/facade.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
var Ot = Object.defineProperty;
|
|
2
2
|
var Tt = (r, e, t) => e in r ? Ot(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var w = (r, e, t) => Tt(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { Inject as
|
|
4
|
+
import { Inject as g, Injector as P, ICommandService as k, IPermissionService as Y, IAuthzIoService as re, LocaleService as bt, generateRandomId as It, Rectangle as B, 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 fe, covertCellValue as Me, 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 H, IResourceLoaderService as Ft, IUniverInstanceService as le, CanceledError as D } from "@univerjs/core";
|
|
5
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
|
|
7
|
-
import { IDefinedNamesService as Nt, serializeRange as Ke, deserializeRangeWithSheet as Pn, serializeRangeWithSheet as
|
|
8
|
-
import { BehaviorSubject as
|
|
9
|
-
import { filter as M, distinctUntilChanged as
|
|
10
|
-
var
|
|
11
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
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 Et, WorksheetEditPermission as Pt, WorksheetViewPermission as Ut, getPrimaryForRange as me, 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 Cs, WorkbookViewPermission as ks, WorksheetSelectUnProtectedCellsPermission as bs, WorksheetSelectProtectedCellsPermission as Is, WorksheetDeleteProtectionPermission as fs, WorksheetManageCollaboratorPermission as vs, WorksheetEditExtraObjectPermission as Rs, WorksheetInsertHyperlinkPermission as ps, WorksheetPivotTablePermission as ys, WorksheetFilterPermission as Es, WorksheetSortPermission as Ps, 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 ve, InsertColByRangeCommand as ht, RemoveColByRangeCommand as Gs, MoveColsCommand as Ks, SetColHiddenCommand as dt, SetSpecificColsVisibleCommand as ct, SetColWidthCommand as Js, SetFrozenCommand as Re, 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 pe, 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, AutoFillCommand as _n, SetWorkbookNameCommand as wn, InsertSheetCommand as ge, SetWorksheetActiveOperation as te, RemoveSheetCommand as Te, CopySheetCommand as Sn, SetWorksheetOrderCommand as Cn, RegisterWorksheetRangeThemeStyleCommand as kn, UnregisterWorksheetRangeThemeStyleCommand as bn, RangeThemeStyle as In, SetWorksheetOrderMutation as gt, SetTabColorMutation as _t, SetWorksheetHideMutation as wt, COMMAND_LISTENER_VALUE_CHANGE as fn, getValueChangedEffectedRange as vn, SheetsFreezeSyncController as Rn, SheetValueChangeType as pn, SheetSkeletonChangeType as yn, SplitDelimiterEnum as En } from "@univerjs/sheets";
|
|
7
|
+
import { IDefinedNamesService as Nt, serializeRange as Ke, deserializeRangeWithSheet as Pn, serializeRangeWithSheet as Un, FormulaDataModel as xn } from "@univerjs/engine-formula";
|
|
8
|
+
import { BehaviorSubject as _e, Subject as Mn } from "rxjs";
|
|
9
|
+
import { filter as M, distinctUntilChanged as we, shareReplay as N, map as Se } from "rxjs/operators";
|
|
10
|
+
var Dn = Object.getOwnPropertyDescriptor, Wn = (r, e, t, s) => {
|
|
11
|
+
for (var n = s > 1 ? void 0 : s ? Dn(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 jn(r, e, t) {
|
|
16
16
|
const s = t.getDefinedNameMap(r);
|
|
17
17
|
if (s == null)
|
|
18
18
|
return e.t("definedName.defaultName") + 1;
|
|
@@ -27,7 +27,7 @@ function Wn(r, e, t) {
|
|
|
27
27
|
a++;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
class
|
|
30
|
+
class be {
|
|
31
31
|
constructor() {
|
|
32
32
|
w(this, "_definedNameParam");
|
|
33
33
|
this._definedNameParam = {
|
|
@@ -230,12 +230,12 @@ class Ce {
|
|
|
230
230
|
return this._definedNameParam = e, this;
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
let
|
|
233
|
+
let Ce = class extends Fe {
|
|
234
234
|
constructor(r, e, t, s, n, i, o, a, h, c) {
|
|
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 = jn(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.
|
|
@@ -445,23 +445,23 @@ let Se = class extends Fe {
|
|
|
445
445
|
* ```
|
|
446
446
|
*/
|
|
447
447
|
toBuilder() {
|
|
448
|
-
const r = this._injector.createInstance(
|
|
448
|
+
const r = this._injector.createInstance(be);
|
|
449
449
|
return r.load(this._definedNameParam), r;
|
|
450
450
|
}
|
|
451
451
|
};
|
|
452
|
-
|
|
453
|
-
W(1,
|
|
454
|
-
W(2,
|
|
452
|
+
Ce = Wn([
|
|
453
|
+
W(1, g(P)),
|
|
454
|
+
W(2, k),
|
|
455
455
|
W(3, Y),
|
|
456
|
-
W(4,
|
|
457
|
-
W(5,
|
|
458
|
-
W(6,
|
|
459
|
-
W(7,
|
|
460
|
-
W(8,
|
|
456
|
+
W(4, g($e)),
|
|
457
|
+
W(5, g(ie)),
|
|
458
|
+
W(6, g(ze)),
|
|
459
|
+
W(7, g(re)),
|
|
460
|
+
W(8, g(bt)),
|
|
461
461
|
W(9, Nt)
|
|
462
|
-
],
|
|
463
|
-
var
|
|
464
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
462
|
+
], Ce);
|
|
463
|
+
var $ = /* @__PURE__ */ ((r) => (r[r.Reader = 0] = "Reader", r[r.Editor = 1] = "Editor", r[r.Owner = 2] = "Owner", r))($ || {}), 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 || {}), Nn = Object.getOwnPropertyDescriptor, On = (r, e, t, s) => {
|
|
464
|
+
for (var n = s > 1 ? void 0 : s ? Nn(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);
|
|
@@ -576,16 +576,16 @@ let z = class extends Fe {
|
|
|
576
576
|
unitID: e
|
|
577
577
|
}), h = new Set(s.allowedUsers);
|
|
578
578
|
n = a.filter((d) => {
|
|
579
|
-
var
|
|
580
|
-
return h.has(((
|
|
579
|
+
var l;
|
|
580
|
+
return h.has(((l = d.subject) == null ? void 0 : l.userID) || d.id);
|
|
581
581
|
}).map((d) => ({
|
|
582
582
|
id: d.id,
|
|
583
|
-
role:
|
|
583
|
+
role: $.Editor,
|
|
584
584
|
subject: d.subject
|
|
585
585
|
}));
|
|
586
586
|
const c = new Set(n.map((d) => {
|
|
587
|
-
var
|
|
588
|
-
return ((
|
|
587
|
+
var l;
|
|
588
|
+
return ((l = d.subject) == null ? void 0 : l.userID) || d.id;
|
|
589
589
|
}));
|
|
590
590
|
s.allowedUsers.forEach((d) => {
|
|
591
591
|
c.has(d) || console.error(`User ${d} not found in collaborators list`);
|
|
@@ -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 ===
|
|
665
|
+
if (s === Pt || 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);
|
|
@@ -685,7 +685,7 @@ let z = class extends Fe {
|
|
|
685
685
|
objectID: o,
|
|
686
686
|
strategies: [{
|
|
687
687
|
action: d,
|
|
688
|
-
role: n ?
|
|
688
|
+
role: n ? $.Owner : $.Reader
|
|
689
689
|
}],
|
|
690
690
|
unitID: e,
|
|
691
691
|
share: void 0,
|
|
@@ -763,24 +763,24 @@ let z = class extends Fe {
|
|
|
763
763
|
async addRangeBaseProtection(e, t, s, n) {
|
|
764
764
|
let i = [];
|
|
765
765
|
if (n != null && n.allowedUsers) {
|
|
766
|
-
const
|
|
766
|
+
const C = await this._authzIoService.listCollaborators({
|
|
767
767
|
objectID: e,
|
|
768
768
|
unitID: e
|
|
769
769
|
}), f = new Set(n.allowedUsers);
|
|
770
|
-
i =
|
|
770
|
+
i = C.filter((y) => {
|
|
771
771
|
var Z;
|
|
772
772
|
return f.has(((Z = y.subject) == null ? void 0 : Z.userID) || y.id);
|
|
773
773
|
}).map((y) => ({
|
|
774
774
|
id: y.id,
|
|
775
|
-
role:
|
|
775
|
+
role: $.Editor,
|
|
776
776
|
subject: y.subject
|
|
777
777
|
}));
|
|
778
|
-
const
|
|
778
|
+
const Ie = new Set(i.map((y) => {
|
|
779
779
|
var Z;
|
|
780
780
|
return ((Z = y.subject) == null ? void 0 : Z.userID) || y.id;
|
|
781
781
|
}));
|
|
782
782
|
n.allowedUsers.forEach((y) => {
|
|
783
|
-
|
|
783
|
+
Ie.has(y) || console.error(`User ${y} not found in collaborators list`);
|
|
784
784
|
});
|
|
785
785
|
}
|
|
786
786
|
const o = await this._authzIoService.create({
|
|
@@ -792,9 +792,9 @@ let z = class extends Fe {
|
|
|
792
792
|
scope: void 0
|
|
793
793
|
}
|
|
794
794
|
}), a = `ruleId_${It(6)}`;
|
|
795
|
-
if (this._rangeProtectionRuleModel.getSubunitRuleList(e, t).some((
|
|
795
|
+
if (this._rangeProtectionRuleModel.getSubunitRuleList(e, t).some((C) => C.ranges.some((f) => s.some((Ie) => B.intersects(Ie.getRange(), f)))))
|
|
796
796
|
throw new Error("range protection cannot intersect");
|
|
797
|
-
const d = this._determineRangeViewState(n),
|
|
797
|
+
const d = this._determineRangeViewState(n), l = this._determineRangeEditState(n), m = {
|
|
798
798
|
unitId: e,
|
|
799
799
|
subUnitId: t,
|
|
800
800
|
rules: [{
|
|
@@ -802,14 +802,14 @@ let z = class extends Fe {
|
|
|
802
802
|
unitType: A.SelectRange,
|
|
803
803
|
unitId: e,
|
|
804
804
|
subUnitId: t,
|
|
805
|
-
ranges: s.map((
|
|
805
|
+
ranges: s.map((C) => C.getRange()),
|
|
806
806
|
id: a,
|
|
807
807
|
description: n == null ? void 0 : n.name,
|
|
808
808
|
viewState: d,
|
|
809
|
-
editState:
|
|
809
|
+
editState: l
|
|
810
810
|
}]
|
|
811
811
|
};
|
|
812
|
-
if (this._commandService.syncExecuteCommand(pt.id,
|
|
812
|
+
if (this._commandService.syncExecuteCommand(pt.id, m))
|
|
813
813
|
return {
|
|
814
814
|
permissionId: o,
|
|
815
815
|
ruleId: a
|
|
@@ -929,9 +929,9 @@ let z = class extends Fe {
|
|
|
929
929
|
setRangeProtectionRanges(e, t, s, n) {
|
|
930
930
|
const i = this._rangeProtectionRuleModel.getRule(e, t, s);
|
|
931
931
|
if (i) {
|
|
932
|
-
if (this._rangeProtectionRuleModel.getSubunitRuleList(e, t).filter((h) => h.id !== s).some((h) => h.ranges.some((c) => n.some((d) =>
|
|
932
|
+
if (this._rangeProtectionRuleModel.getSubunitRuleList(e, t).filter((h) => h.id !== s).some((h) => h.ranges.some((c) => n.some((d) => B.intersects(d.getRange(), c)))))
|
|
933
933
|
throw new Error("range protection cannot intersect");
|
|
934
|
-
this._commandService.syncExecuteCommand(
|
|
934
|
+
this._commandService.syncExecuteCommand(Et.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 = Vt(s, n), o = this._rangeProtectionRuleModel.getSubunitRuleList(e, t).find((a) => a.ranges.some((c) =>
|
|
983
|
+
const i = Vt(s, n), o = this._rangeProtectionRuleModel.getSubunitRuleList(e, t).find((a) => a.ranges.some((c) => B.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,
|
|
993
|
-
V(1,
|
|
991
|
+
z = On([
|
|
992
|
+
V(0, g(P)),
|
|
993
|
+
V(1, k),
|
|
994
994
|
V(2, Y),
|
|
995
|
-
V(3,
|
|
996
|
-
V(4,
|
|
997
|
-
V(5,
|
|
998
|
-
V(6,
|
|
999
|
-
V(7,
|
|
995
|
+
V(3, g($e)),
|
|
996
|
+
V(4, g(ie)),
|
|
997
|
+
V(5, g(ze)),
|
|
998
|
+
V(6, g(Lt)),
|
|
999
|
+
V(7, g(re))
|
|
1000
1000
|
], z);
|
|
1001
|
-
var
|
|
1002
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1001
|
+
var Tn = Object.getOwnPropertyDescriptor, Vn = (r, e, t, s) => {
|
|
1002
|
+
for (var n = s > 1 ? void 0 : s ? Tn(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
|
+
}, An = (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(E, this._workbook);
|
|
1078
1078
|
return this._injector.createInstance(v, r, this._workbook, this._worksheet);
|
|
1079
1079
|
}
|
|
1080
1080
|
/**
|
|
@@ -1099,12 +1099,12 @@ let ke = class {
|
|
|
1099
1099
|
* ```
|
|
1100
1100
|
*/
|
|
1101
1101
|
updatePrimaryCell(r) {
|
|
1102
|
-
const e = this._injector.get(
|
|
1102
|
+
const e = this._injector.get(k);
|
|
1103
1103
|
let t = [], s = !1;
|
|
1104
1104
|
for (const { range: i, style: o } of this._selections)
|
|
1105
|
-
|
|
1105
|
+
B.contains(i, r.getRange()) ? (t.push({
|
|
1106
1106
|
range: i,
|
|
1107
|
-
primary:
|
|
1107
|
+
primary: me(r.getRange(), this._worksheet),
|
|
1108
1108
|
style: o
|
|
1109
1109
|
}), s = !0) : t.push({
|
|
1110
1110
|
range: i,
|
|
@@ -1114,7 +1114,7 @@ let ke = class {
|
|
|
1114
1114
|
s || (t = [
|
|
1115
1115
|
{
|
|
1116
1116
|
range: r.getRange(),
|
|
1117
|
-
primary:
|
|
1117
|
+
primary: me(r.getRange(), this._worksheet)
|
|
1118
1118
|
}
|
|
1119
1119
|
]);
|
|
1120
1120
|
const n = {
|
|
@@ -1156,14 +1156,14 @@ let ke = class {
|
|
|
1156
1156
|
return t ? this._injector.createInstance(R, this._workbook, this._worksheet, t) : null;
|
|
1157
1157
|
}
|
|
1158
1158
|
};
|
|
1159
|
-
ke =
|
|
1160
|
-
|
|
1159
|
+
ke = Vn([
|
|
1160
|
+
An(3, g(P))
|
|
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 || {}), Bn = Object.getOwnPropertyDescriptor, Fn = (r, e, t, s) => {
|
|
1163
|
+
for (var n = s > 1 ? void 0 : s ? Bn(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
|
+
}, ye = (r, e) => (t, s) => e(t, s, r);
|
|
1167
1167
|
let O = class {
|
|
1168
1168
|
constructor(r, e, t, s, n, i, o, a, h) {
|
|
1169
1169
|
this._unitId = r, this._subUnitId = e, this._ruleId = t, this._permissionId = s, this._ranges = n, this._options = i, this._injector = o, this._commandService = a, this._rangeProtectionRuleModel = h;
|
|
@@ -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(Et.id, {
|
|
1245
1245
|
unitId: this._unitId,
|
|
1246
1246
|
subUnitId: this._subUnitId,
|
|
1247
1247
|
ruleId: this._ruleId,
|
|
@@ -1279,15 +1279,15 @@ 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
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1282
|
+
O = Fn([
|
|
1283
|
+
ye(6, g(P)),
|
|
1284
|
+
ye(7, g(k)),
|
|
1285
|
+
ye(8, g(ie))
|
|
1286
1286
|
], O);
|
|
1287
1287
|
const he = {
|
|
1288
1288
|
[u.Edit]: Le,
|
|
1289
|
-
[u.View]:
|
|
1290
|
-
[u.Print]:
|
|
1289
|
+
[u.View]: ks,
|
|
1290
|
+
[u.Print]: Cs,
|
|
1291
1291
|
[u.Export]: Ss,
|
|
1292
1292
|
[u.Share]: ws,
|
|
1293
1293
|
[u.CopyContent]: _s,
|
|
@@ -1309,7 +1309,7 @@ const he = {
|
|
|
1309
1309
|
[u.DeleteColumn]: Xt,
|
|
1310
1310
|
[u.CopySheet]: Qt
|
|
1311
1311
|
}, de = {
|
|
1312
|
-
[_.Edit]:
|
|
1312
|
+
[_.Edit]: Pt,
|
|
1313
1313
|
[_.View]: Ut,
|
|
1314
1314
|
[_.Copy]: Ts,
|
|
1315
1315
|
[_.SetCellValue]: Os,
|
|
@@ -1320,8 +1320,8 @@ const he = {
|
|
|
1320
1320
|
[_.InsertColumn]: Ms,
|
|
1321
1321
|
[_.DeleteRow]: xs,
|
|
1322
1322
|
[_.DeleteColumn]: Us,
|
|
1323
|
-
[_.Sort]:
|
|
1324
|
-
[_.Filter]:
|
|
1323
|
+
[_.Sort]: Ps,
|
|
1324
|
+
[_.Filter]: Es,
|
|
1325
1325
|
[_.PivotTable]: ys,
|
|
1326
1326
|
[_.InsertHyperlink]: ps,
|
|
1327
1327
|
[_.EditExtraObject]: Rs,
|
|
@@ -1335,11 +1335,11 @@ const he = {
|
|
|
1335
1335
|
[b.ManageCollaborator]: As,
|
|
1336
1336
|
[b.Delete]: Vs
|
|
1337
1337
|
};
|
|
1338
|
-
var
|
|
1339
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
1338
|
+
var Hn = Object.getOwnPropertyDescriptor, $n = (r, e, t, s) => {
|
|
1339
|
+
for (var n = s > 1 ? void 0 : s ? Hn(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
|
+
}, F = (r, e) => (t, s) => e(t, s, r);
|
|
1343
1343
|
let Ve = class {
|
|
1344
1344
|
constructor(r, e, t, s, n, i, o, a) {
|
|
1345
1345
|
w(this, "_permissionSubject");
|
|
@@ -1368,7 +1368,7 @@ let Ve = class {
|
|
|
1368
1368
|
w(this, "_subUnitId");
|
|
1369
1369
|
w(this, "_subscriptions", []);
|
|
1370
1370
|
w(this, "_fPermission");
|
|
1371
|
-
this._worksheet = r, this._injector = e, this._permissionService = t, this._authzIoService = s, this._commandService = n, this._rangeProtectionRuleModel = i, this._worksheetProtectionPointModel = o, this._worksheetProtectionRuleModel = a, this._unitId = this._worksheet.getWorkbook().getUnitId(), this._subUnitId = this._worksheet.getSheetId(), this._fPermission = this._injector.createInstance(z), this._permissionSubject = new
|
|
1371
|
+
this._worksheet = r, this._injector = e, this._permissionService = t, this._authzIoService = s, this._commandService = n, this._rangeProtectionRuleModel = i, this._worksheetProtectionPointModel = o, this._worksheetProtectionRuleModel = a, this._unitId = this._worksheet.getWorkbook().getUnitId(), this._subUnitId = this._worksheet.getSheetId(), this._fPermission = this._injector.createInstance(z), this._permissionSubject = new _e(this._buildSnapshot()), this._rangeRulesSubject = new _e(this._buildRangeProtectionRules()), this.permission$ = this._createPermissionStream(), this.pointChange$ = this._createPointChangeStream(), this.rangeProtectionChange$ = this._createRangeProtectionChangeStream(), this.rangeProtectionRules$ = this._createRangeProtectionRulesStream();
|
|
1372
1372
|
}
|
|
1373
1373
|
/**
|
|
1374
1374
|
* Create permission snapshot stream from IPermissionService
|
|
@@ -1381,7 +1381,7 @@ let Ve = class {
|
|
|
1381
1381
|
this._permissionSubject.next(this._buildSnapshot());
|
|
1382
1382
|
});
|
|
1383
1383
|
return this._subscriptions.push(r), this._permissionSubject.asObservable().pipe(
|
|
1384
|
-
|
|
1384
|
+
we((e, t) => JSON.stringify(e) === JSON.stringify(t)),
|
|
1385
1385
|
N({ bufferSize: 1, refCount: !0 })
|
|
1386
1386
|
);
|
|
1387
1387
|
}
|
|
@@ -1392,7 +1392,7 @@ let Ve = class {
|
|
|
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
|
+
Se((r) => {
|
|
1396
1396
|
var t, s;
|
|
1397
1397
|
const e = this._extractWorksheetPointType(r.id);
|
|
1398
1398
|
return e ? {
|
|
@@ -1412,7 +1412,7 @@ let Ve = class {
|
|
|
1412
1412
|
_createRangeProtectionChangeStream() {
|
|
1413
1413
|
return this._rangeProtectionRuleModel.ruleChange$.pipe(
|
|
1414
1414
|
M((r) => r.unitId === this._unitId && r.subUnitId === this._subUnitId),
|
|
1415
|
-
|
|
1415
|
+
Se((r) => {
|
|
1416
1416
|
const e = this._buildRangeProtectionRules();
|
|
1417
1417
|
return { type: r.type === "delete" ? "delete" : r.type === "set" ? "update" : "add", rules: e };
|
|
1418
1418
|
}),
|
|
@@ -1430,7 +1430,7 @@ let Ve = class {
|
|
|
1430
1430
|
this._rangeRulesSubject.next(this._buildRangeProtectionRules());
|
|
1431
1431
|
});
|
|
1432
1432
|
return this._subscriptions.push(r), this._rangeRulesSubject.asObservable().pipe(
|
|
1433
|
-
|
|
1433
|
+
we((e, t) => e.length !== t.length ? !1 : e.every((s, n) => s.id === t[n].id)),
|
|
1434
1434
|
N({ bufferSize: 1, refCount: !0 })
|
|
1435
1435
|
);
|
|
1436
1436
|
}
|
|
@@ -1860,21 +1860,21 @@ let Ve = class {
|
|
|
1860
1860
|
var c, d;
|
|
1861
1861
|
let h = [];
|
|
1862
1862
|
if ((c = a.options) != null && c.allowedUsers) {
|
|
1863
|
-
const
|
|
1863
|
+
const l = new Set(a.options.allowedUsers);
|
|
1864
1864
|
h = e.filter((S) => {
|
|
1865
|
-
var
|
|
1866
|
-
return
|
|
1865
|
+
var C;
|
|
1866
|
+
return l.has(((C = S.subject) == null ? void 0 : C.userID) || S.id);
|
|
1867
1867
|
}).map((S) => ({
|
|
1868
1868
|
id: S.id,
|
|
1869
1869
|
role: Je.Editor,
|
|
1870
1870
|
subject: S.subject
|
|
1871
1871
|
}));
|
|
1872
|
-
const
|
|
1873
|
-
var
|
|
1874
|
-
return ((
|
|
1872
|
+
const m = new Set(h.map((S) => {
|
|
1873
|
+
var C;
|
|
1874
|
+
return ((C = S.subject) == null ? void 0 : C.userID) || S.id;
|
|
1875
1875
|
}));
|
|
1876
1876
|
a.options.allowedUsers.forEach((S) => {
|
|
1877
|
-
|
|
1877
|
+
m.has(S) || console.error(`User ${S} not found in collaborators list`);
|
|
1878
1878
|
});
|
|
1879
1879
|
}
|
|
1880
1880
|
return this._authzIoService.create({
|
|
@@ -1888,16 +1888,16 @@ let Ve = class {
|
|
|
1888
1888
|
});
|
|
1889
1889
|
})
|
|
1890
1890
|
), n = r.map((a, h) => {
|
|
1891
|
-
var
|
|
1891
|
+
var l;
|
|
1892
1892
|
const c = this._determineViewState(a.options), d = this._determineEditState(a.options);
|
|
1893
1893
|
return {
|
|
1894
1894
|
permissionId: s[h],
|
|
1895
1895
|
unitType: A.SelectRange,
|
|
1896
1896
|
unitId: this._unitId,
|
|
1897
1897
|
subUnitId: this._subUnitId,
|
|
1898
|
-
ranges: a.ranges.map((
|
|
1898
|
+
ranges: a.ranges.map((m) => m.getRange()),
|
|
1899
1899
|
id: this._rangeProtectionRuleModel.createRuleId(this._unitId, this._subUnitId),
|
|
1900
|
-
description: ((
|
|
1900
|
+
description: ((l = a.options) == null ? void 0 : l.name) || "",
|
|
1901
1901
|
viewState: c,
|
|
1902
1902
|
editState: d
|
|
1903
1903
|
};
|
|
@@ -2009,16 +2009,16 @@ let Ve = class {
|
|
|
2009
2009
|
this._subscriptions.forEach((r) => r.unsubscribe()), this._permissionSubject.complete(), this._rangeRulesSubject.complete();
|
|
2010
2010
|
}
|
|
2011
2011
|
};
|
|
2012
|
-
Ve =
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2012
|
+
Ve = $n([
|
|
2013
|
+
F(1, g(P)),
|
|
2014
|
+
F(2, Y),
|
|
2015
|
+
F(3, re),
|
|
2016
|
+
F(4, k),
|
|
2017
|
+
F(5, g(ie)),
|
|
2018
|
+
F(6, g(ze)),
|
|
2019
|
+
F(7, g($e))
|
|
2020
2020
|
], Ve);
|
|
2021
|
-
function
|
|
2021
|
+
function zn(r) {
|
|
2022
2022
|
switch (r) {
|
|
2023
2023
|
case "left":
|
|
2024
2024
|
return K.LEFT;
|
|
@@ -2042,7 +2042,7 @@ function St(r) {
|
|
|
2042
2042
|
return "general";
|
|
2043
2043
|
}
|
|
2044
2044
|
}
|
|
2045
|
-
function
|
|
2045
|
+
function Ln(r) {
|
|
2046
2046
|
switch (r) {
|
|
2047
2047
|
case "top":
|
|
2048
2048
|
return J.TOP;
|
|
@@ -2054,7 +2054,7 @@ function zn(r) {
|
|
|
2054
2054
|
throw new Error(`Invalid vertical alignment: ${r}`);
|
|
2055
2055
|
}
|
|
2056
2056
|
}
|
|
2057
|
-
function
|
|
2057
|
+
function Ct(r) {
|
|
2058
2058
|
switch (r) {
|
|
2059
2059
|
case J.TOP:
|
|
2060
2060
|
return "top";
|
|
@@ -2066,7 +2066,7 @@ function kt(r) {
|
|
|
2066
2066
|
return "general";
|
|
2067
2067
|
}
|
|
2068
2068
|
}
|
|
2069
|
-
function
|
|
2069
|
+
function Ee(r, e) {
|
|
2070
2070
|
return {
|
|
2071
2071
|
startRow: r.startRow,
|
|
2072
2072
|
endRow: r.endRow,
|
|
@@ -2084,8 +2084,8 @@ function Pe(r, e) {
|
|
|
2084
2084
|
rangeType: p.COLUMN
|
|
2085
2085
|
};
|
|
2086
2086
|
}
|
|
2087
|
-
var
|
|
2088
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
2087
|
+
var Gn = Object.getOwnPropertyDescriptor, Kn = (r, e, t, s) => {
|
|
2088
|
+
for (var n = s > 1 ? void 0 : s ? Gn(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);
|
|
@@ -2564,7 +2564,7 @@ let v = class extends He {
|
|
|
2564
2564
|
* ```
|
|
2565
2565
|
*/
|
|
2566
2566
|
moveRows(e, t) {
|
|
2567
|
-
const s = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), i =
|
|
2567
|
+
const s = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), i = Ee(e.getRange(), this._worksheet), o = i, a = {
|
|
2568
2568
|
startRow: t,
|
|
2569
2569
|
endRow: t,
|
|
2570
2570
|
startColumn: i.startColumn,
|
|
@@ -2594,7 +2594,7 @@ let v = class extends He {
|
|
|
2594
2594
|
* ```
|
|
2595
2595
|
*/
|
|
2596
2596
|
hideRow(e) {
|
|
2597
|
-
const t = this._workbook.getUnitId(), s = this._worksheet.getSheetId(), n =
|
|
2597
|
+
const t = this._workbook.getUnitId(), s = this._worksheet.getSheetId(), n = Ee(e.getRange(), this._worksheet);
|
|
2598
2598
|
return this._commandService.syncExecuteCommand(it.id, {
|
|
2599
2599
|
unitId: t,
|
|
2600
2600
|
subUnitId: s,
|
|
@@ -2645,7 +2645,7 @@ let v = class extends He {
|
|
|
2645
2645
|
* ```
|
|
2646
2646
|
*/
|
|
2647
2647
|
unhideRow(e) {
|
|
2648
|
-
const t = this._workbook.getUnitId(), s = this._worksheet.getSheetId(), n =
|
|
2648
|
+
const t = this._workbook.getUnitId(), s = this._worksheet.getSheetId(), n = Ee(e.getRange(), this._worksheet);
|
|
2649
2649
|
return this._commandService.syncExecuteCommand(ot.id, {
|
|
2650
2650
|
unitId: t,
|
|
2651
2651
|
subUnitId: s,
|
|
@@ -2744,20 +2744,20 @@ let v = class extends He {
|
|
|
2744
2744
|
var c;
|
|
2745
2745
|
const n = this._workbook.getUnitId(), i = this._worksheet.getSheetId(), o = this._worksheet.getRowManager(), a = [], h = [];
|
|
2746
2746
|
for (let d = e; d < e + t; d++) {
|
|
2747
|
-
const
|
|
2747
|
+
const l = ((c = o.getRow(d)) == null ? void 0 : c.ah) || this._worksheet.getConfig().defaultRowHeight, m = {
|
|
2748
2748
|
startRow: d,
|
|
2749
2749
|
endRow: d,
|
|
2750
2750
|
startColumn: 0,
|
|
2751
2751
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
2752
2752
|
};
|
|
2753
|
-
s <=
|
|
2753
|
+
s <= l ? a.push(m) : h.push(m);
|
|
2754
2754
|
}
|
|
2755
2755
|
return h.length > 0 && this._commandService.syncExecuteCommand(at.id, {
|
|
2756
2756
|
unitId: n,
|
|
2757
2757
|
subUnitId: i,
|
|
2758
2758
|
ranges: h,
|
|
2759
2759
|
value: s
|
|
2760
|
-
}), a.length > 0 && this._commandService.syncExecuteCommand(
|
|
2760
|
+
}), a.length > 0 && this._commandService.syncExecuteCommand(ve.id, {
|
|
2761
2761
|
unitId: n,
|
|
2762
2762
|
subUnitId: i,
|
|
2763
2763
|
ranges: a
|
|
@@ -2803,7 +2803,7 @@ let v = class extends He {
|
|
|
2803
2803
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
2804
2804
|
}
|
|
2805
2805
|
];
|
|
2806
|
-
return this._commandService.syncExecuteCommand(
|
|
2806
|
+
return this._commandService.syncExecuteCommand(ve.id, {
|
|
2807
2807
|
unitId: s,
|
|
2808
2808
|
subUnitId: n,
|
|
2809
2809
|
ranges: i
|
|
@@ -2825,7 +2825,7 @@ let v = class extends He {
|
|
|
2825
2825
|
*/
|
|
2826
2826
|
setRangesAutoHeight(e) {
|
|
2827
2827
|
const t = this._workbook.getUnitId(), s = this._worksheet.getSheetId();
|
|
2828
|
-
return this._commandService.syncExecuteCommand(
|
|
2828
|
+
return this._commandService.syncExecuteCommand(ve.id, {
|
|
2829
2829
|
unitId: t,
|
|
2830
2830
|
subUnitId: s,
|
|
2831
2831
|
ranges: e
|
|
@@ -3392,7 +3392,7 @@ let v = class extends He {
|
|
|
3392
3392
|
* ```
|
|
3393
3393
|
*/
|
|
3394
3394
|
setFreeze(e) {
|
|
3395
|
-
return this._logService.warn("setFreeze is deprecated, use setFrozenRows and setFrozenColumns instead"), this._commandService.syncExecuteCommand(
|
|
3395
|
+
return this._logService.warn("setFreeze is deprecated, use setFrozenRows and setFrozenColumns instead"), this._commandService.syncExecuteCommand(Re.id, {
|
|
3396
3396
|
...e,
|
|
3397
3397
|
unitId: this._workbook.getUnitId(),
|
|
3398
3398
|
subUnitId: this.getSheetId()
|
|
@@ -3439,7 +3439,7 @@ let v = class extends He {
|
|
|
3439
3439
|
});
|
|
3440
3440
|
} else if (arguments.length === 2) {
|
|
3441
3441
|
let [s = 0, n = 0] = e;
|
|
3442
|
-
s > n && ([s, n] = [n, s]), this._commandService.syncExecuteCommand(
|
|
3442
|
+
s > n && ([s, n] = [n, s]), this._commandService.syncExecuteCommand(Re.id, {
|
|
3443
3443
|
startColumn: n + 1,
|
|
3444
3444
|
xSplit: n - s + 1,
|
|
3445
3445
|
startRow: t.startRow,
|
|
@@ -3461,7 +3461,7 @@ let v = class extends He {
|
|
|
3461
3461
|
});
|
|
3462
3462
|
} else if (arguments.length === 2) {
|
|
3463
3463
|
let [s = 0, n = 0] = e;
|
|
3464
|
-
s > n && ([s, n] = [n, s]), this._commandService.syncExecuteCommand(
|
|
3464
|
+
s > n && ([s, n] = [n, s]), this._commandService.syncExecuteCommand(Re.id, {
|
|
3465
3465
|
startRow: n + 1,
|
|
3466
3466
|
ySplit: n - s + 1,
|
|
3467
3467
|
startColumn: t.startColumn,
|
|
@@ -3641,10 +3641,10 @@ let v = class extends He {
|
|
|
3641
3641
|
* @deprecated use `univerAPI.addEvent(univerAPI.Event.SheetValueChanged, (params) => {})` instead
|
|
3642
3642
|
*/
|
|
3643
3643
|
onCellDataChange(e) {
|
|
3644
|
-
return this._injector.get(
|
|
3644
|
+
return this._injector.get(k).onCommandExecuted((s) => {
|
|
3645
3645
|
if (s.id === ut.id) {
|
|
3646
3646
|
const n = s.params;
|
|
3647
|
-
n.unitId === this._workbook.getUnitId() && n.subUnitId === this._worksheet.getSheetId() && n.cellValue && e(new
|
|
3647
|
+
n.unitId === this._workbook.getUnitId() && n.subUnitId === this._worksheet.getSheetId() && n.cellValue && e(new fe(n.cellValue));
|
|
3648
3648
|
}
|
|
3649
3649
|
});
|
|
3650
3650
|
}
|
|
@@ -3652,10 +3652,10 @@ let v = class extends He {
|
|
|
3652
3652
|
* @deprecated use `univerAPI.addEvent(univerAPI.Event.BeforeSheetEditEnd, (params) => {})` instead
|
|
3653
3653
|
*/
|
|
3654
3654
|
onBeforeCellDataChange(e) {
|
|
3655
|
-
return this._injector.get(
|
|
3655
|
+
return this._injector.get(k).beforeCommandExecuted((s) => {
|
|
3656
3656
|
if (s.id === ut.id) {
|
|
3657
3657
|
const n = s.params;
|
|
3658
|
-
n.unitId === this._workbook.getUnitId() && n.subUnitId === this._worksheet.getSheetId() && n.cellValue && e(new
|
|
3658
|
+
n.unitId === this._workbook.getUnitId() && n.subUnitId === this._worksheet.getSheetId() && n.cellValue && e(new fe(n.cellValue));
|
|
3659
3659
|
}
|
|
3660
3660
|
});
|
|
3661
3661
|
}
|
|
@@ -3671,7 +3671,7 @@ let v = class extends He {
|
|
|
3671
3671
|
* ```
|
|
3672
3672
|
*/
|
|
3673
3673
|
hideSheet() {
|
|
3674
|
-
const e = this._injector.get(
|
|
3674
|
+
const e = this._injector.get(k);
|
|
3675
3675
|
if (this._workbook.getSheets().filter((i) => i.isSheetHidden() !== I.TRUE).length <= 1)
|
|
3676
3676
|
throw new Error("Cannot hide the only visible sheet");
|
|
3677
3677
|
return e.syncExecuteCommand(Zs.id, {
|
|
@@ -3691,7 +3691,7 @@ let v = class extends He {
|
|
|
3691
3691
|
* ```
|
|
3692
3692
|
*/
|
|
3693
3693
|
showSheet() {
|
|
3694
|
-
return this._injector.get(
|
|
3694
|
+
return this._injector.get(k).syncExecuteCommand(Qs.id, {
|
|
3695
3695
|
unitId: this._workbook.getUnitId(),
|
|
3696
3696
|
subUnitId: this._worksheet.getSheetId()
|
|
3697
3697
|
}), this;
|
|
@@ -3779,7 +3779,7 @@ let v = class extends He {
|
|
|
3779
3779
|
return this.clearContents();
|
|
3780
3780
|
if (e && e.formatOnly && !e.contentsOnly)
|
|
3781
3781
|
return this.clearFormats();
|
|
3782
|
-
const t = this._workbook.getUnitId(), s = this._worksheet.getSheetId(), n = this._injector.get(
|
|
3782
|
+
const t = this._workbook.getUnitId(), s = this._worksheet.getSheetId(), n = this._injector.get(k), i = {
|
|
3783
3783
|
startRow: 0,
|
|
3784
3784
|
endRow: this._worksheet.getRowCount() - 1,
|
|
3785
3785
|
startColumn: 0,
|
|
@@ -3804,7 +3804,7 @@ let v = class extends He {
|
|
|
3804
3804
|
* ```
|
|
3805
3805
|
*/
|
|
3806
3806
|
clearContents() {
|
|
3807
|
-
const e = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), s = this._injector.get(
|
|
3807
|
+
const e = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), s = this._injector.get(k), n = {
|
|
3808
3808
|
startRow: 0,
|
|
3809
3809
|
endRow: this._worksheet.getRowCount() - 1,
|
|
3810
3810
|
startColumn: 0,
|
|
@@ -3828,7 +3828,7 @@ let v = class extends He {
|
|
|
3828
3828
|
* ```
|
|
3829
3829
|
*/
|
|
3830
3830
|
clearFormats() {
|
|
3831
|
-
const e = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), s = this._injector.get(
|
|
3831
|
+
const e = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), s = this._injector.get(k), n = {
|
|
3832
3832
|
startRow: 0,
|
|
3833
3833
|
endRow: this._worksheet.getRowCount() - 1,
|
|
3834
3834
|
startColumn: 0,
|
|
@@ -3933,7 +3933,7 @@ let v = class extends He {
|
|
|
3933
3933
|
* ```
|
|
3934
3934
|
*/
|
|
3935
3935
|
insertDefinedName(e, t) {
|
|
3936
|
-
const n = this._injector.createInstance(
|
|
3936
|
+
const n = this._injector.createInstance(be).setName(e).setRef(t).build();
|
|
3937
3937
|
n.localSheetId = this.getSheetId(), this._fWorkbook.insertDefinedNameBuilder(n);
|
|
3938
3938
|
}
|
|
3939
3939
|
/**
|
|
@@ -4052,9 +4052,9 @@ let v = class extends He {
|
|
|
4052
4052
|
* ```
|
|
4053
4053
|
*/
|
|
4054
4054
|
appendRow(e) {
|
|
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
|
|
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 fe();
|
|
4056
4056
|
for (let h = 0; h < e.length; h++)
|
|
4057
|
-
a.setValue(o, h,
|
|
4057
|
+
a.setValue(o, h, Me(e[h]));
|
|
4058
4058
|
return this._commandService.syncExecuteCommand(Xs.id, {
|
|
4059
4059
|
unitId: this._workbook.getUnitId(),
|
|
4060
4060
|
subUnitId: this._worksheet.getSheetId(),
|
|
@@ -4141,14 +4141,14 @@ let v = class extends He {
|
|
|
4141
4141
|
);
|
|
4142
4142
|
}
|
|
4143
4143
|
};
|
|
4144
|
-
v =
|
|
4145
|
-
ce(3,
|
|
4146
|
-
ce(4,
|
|
4147
|
-
ce(5,
|
|
4148
|
-
ce(6,
|
|
4144
|
+
v = Kn([
|
|
4145
|
+
ce(3, g(P)),
|
|
4146
|
+
ce(4, g(xt)),
|
|
4147
|
+
ce(5, g(ft)),
|
|
4148
|
+
ce(6, k)
|
|
4149
4149
|
], v);
|
|
4150
|
-
var
|
|
4151
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
4150
|
+
var Jn = Object.getOwnPropertyDescriptor, qn = (r, e, t, s) => {
|
|
4151
|
+
for (var n = s > 1 ? void 0 : s ? Jn(e, t) : e, i = r.length - 1, o; i >= 0; i--)
|
|
4152
4152
|
(o = r[i]) && (n = o(n) || n);
|
|
4153
4153
|
return n;
|
|
4154
4154
|
}, ee = (r, e) => (t, s) => e(t, s, r);
|
|
@@ -4167,7 +4167,7 @@ let Ae = class {
|
|
|
4167
4167
|
* @returns Observable that emits when protection state changes
|
|
4168
4168
|
*/
|
|
4169
4169
|
w(this, "protectionChange$");
|
|
4170
|
-
this._unitId = r, this._subUnitId = e, this._range = t, this._worksheet = s, this._injector = n, this._permissionService = i, this._authzIoService = o, this._commandService = a, this._rangeProtectionRuleModel = h, this._fPermission = this._injector.createInstance(z), this._permissionSubject = new
|
|
4170
|
+
this._unitId = r, this._subUnitId = e, this._range = t, this._worksheet = s, this._injector = n, this._permissionService = i, this._authzIoService = o, this._commandService = a, this._rangeProtectionRuleModel = h, this._fPermission = this._injector.createInstance(z), this._permissionSubject = new _e(this._buildSnapshot()), this.permission$ = this._createPermissionStream(), this.protectionChange$ = this._createProtectionChangeStream();
|
|
4171
4171
|
}
|
|
4172
4172
|
/**
|
|
4173
4173
|
* Create permission snapshot stream from IPermissionService
|
|
@@ -4183,7 +4183,7 @@ let Ae = class {
|
|
|
4183
4183
|
this._permissionSubject.next(this._buildSnapshot());
|
|
4184
4184
|
});
|
|
4185
4185
|
return this._subscriptions.push(r), this._permissionSubject.asObservable().pipe(
|
|
4186
|
-
|
|
4186
|
+
we((e, t) => JSON.stringify(e) === JSON.stringify(t)),
|
|
4187
4187
|
N({ bufferSize: 1, refCount: !0 })
|
|
4188
4188
|
);
|
|
4189
4189
|
}
|
|
@@ -4194,7 +4194,7 @@ let Ae = class {
|
|
|
4194
4194
|
_createProtectionChangeStream() {
|
|
4195
4195
|
return this._rangeProtectionRuleModel.ruleChange$.pipe(
|
|
4196
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),
|
|
4197
|
-
|
|
4197
|
+
Se((r) => (this._permissionSubject.next(this._buildSnapshot()), r.type === "delete" ? {
|
|
4198
4198
|
type: "unprotected",
|
|
4199
4199
|
ruleId: r.rule.id
|
|
4200
4200
|
} : {
|
|
@@ -4621,18 +4621,18 @@ let Ae = class {
|
|
|
4621
4621
|
this._subscriptions.forEach((r) => r.unsubscribe()), this._permissionSubject.complete();
|
|
4622
4622
|
}
|
|
4623
4623
|
};
|
|
4624
|
-
Ae =
|
|
4625
|
-
ee(4,
|
|
4626
|
-
ee(5,
|
|
4627
|
-
ee(6,
|
|
4628
|
-
ee(7,
|
|
4629
|
-
ee(8,
|
|
4624
|
+
Ae = qn([
|
|
4625
|
+
ee(4, g(P)),
|
|
4626
|
+
ee(5, g(Y)),
|
|
4627
|
+
ee(6, g(re)),
|
|
4628
|
+
ee(7, g(k)),
|
|
4629
|
+
ee(8, g(ie))
|
|
4630
4630
|
], Ae);
|
|
4631
|
-
var
|
|
4632
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
4631
|
+
var Yn = Object.getOwnPropertyDescriptor, Zn = (r, e, t, s) => {
|
|
4632
|
+
for (var n = s > 1 ? void 0 : s ? Yn(e, t) : e, i = r.length - 1, o; i >= 0; i--)
|
|
4633
4633
|
(o = r[i]) && (n = o(n) || n);
|
|
4634
4634
|
return n;
|
|
4635
|
-
},
|
|
4635
|
+
}, Ue = (r, e) => (t, s) => e(t, s, r), q;
|
|
4636
4636
|
let R = (q = class extends He {
|
|
4637
4637
|
constructor(e, t, s, n, i, o) {
|
|
4638
4638
|
super(n), this._workbook = e, this._worksheet = t, this._range = s, this._injector = n, this._commandService = i, this._formulaDataModel = o;
|
|
@@ -4806,7 +4806,7 @@ let R = (q = class extends He {
|
|
|
4806
4806
|
*/
|
|
4807
4807
|
isMerged() {
|
|
4808
4808
|
const { startColumn: e, startRow: t, endColumn: s, endRow: n } = this._range;
|
|
4809
|
-
return this._worksheet.getMergedCellRange(t, e, n, s).some((o) =>
|
|
4809
|
+
return this._worksheet.getMergedCellRange(t, e, n, s).some((o) => B.equals(o, this._range));
|
|
4810
4810
|
}
|
|
4811
4811
|
/**
|
|
4812
4812
|
* Return first cell style data in this range. Please note that if there are row styles, col styles and (or)
|
|
@@ -4975,8 +4975,8 @@ let R = (q = class extends He {
|
|
|
4975
4975
|
const { startRow: t, endRow: s, startColumn: n, endColumn: i } = this._range, o = [];
|
|
4976
4976
|
for (let c = t; c <= s; c++) {
|
|
4977
4977
|
const d = [];
|
|
4978
|
-
for (let
|
|
4979
|
-
d.push((h = (a = this._worksheet.getCell(c,
|
|
4978
|
+
for (let l = n; l <= i; l++)
|
|
4979
|
+
d.push((h = (a = this._worksheet.getCell(c, l)) == null ? void 0 : a.v) != null ? h : null);
|
|
4980
4980
|
o.push(d);
|
|
4981
4981
|
}
|
|
4982
4982
|
return o;
|
|
@@ -5028,9 +5028,9 @@ let R = (q = class extends He {
|
|
|
5028
5028
|
const e = this._worksheet.getCellMatrix(), { startRow: t, endRow: s, startColumn: n, endColumn: i } = this._range, o = [];
|
|
5029
5029
|
for (let c = t; c <= s; c++) {
|
|
5030
5030
|
const d = [];
|
|
5031
|
-
for (let
|
|
5032
|
-
const
|
|
5033
|
-
|
|
5031
|
+
for (let l = n; l <= i; l++) {
|
|
5032
|
+
const m = e.getValue(c, l);
|
|
5033
|
+
m != null && m.p && ((a = m.p.body) != null && a.dataStream) ? d.push(m.p.body.dataStream) : d.push((h = m == null ? void 0 : m.v) != null ? h : null);
|
|
5034
5034
|
}
|
|
5035
5035
|
o.push(d);
|
|
5036
5036
|
}
|
|
@@ -5083,9 +5083,9 @@ let R = (q = class extends He {
|
|
|
5083
5083
|
const { startRow: e, endRow: t, startColumn: s, endColumn: n } = this._range, i = [];
|
|
5084
5084
|
for (let c = e; c <= t; c++) {
|
|
5085
5085
|
const d = [];
|
|
5086
|
-
for (let
|
|
5087
|
-
const
|
|
5088
|
-
|
|
5086
|
+
for (let l = s; l <= n; l++) {
|
|
5087
|
+
const m = this._worksheet.getCell(c, l);
|
|
5088
|
+
m != null && m.p && ((o = m.p.body) != null && o.dataStream) ? d.push(m.p.body.dataStream) : d.push((h = (a = m == null ? void 0 : m.v) == null ? void 0 : a.toString()) != null ? h : "");
|
|
5089
5089
|
}
|
|
5090
5090
|
i.push(d);
|
|
5091
5091
|
}
|
|
@@ -5241,8 +5241,8 @@ let R = (q = class extends He {
|
|
|
5241
5241
|
for (let h = t; h <= s; h++) {
|
|
5242
5242
|
const c = [];
|
|
5243
5243
|
for (let d = n; d <= i; d++) {
|
|
5244
|
-
const
|
|
5245
|
-
c.push(
|
|
5244
|
+
const l = this._formulaDataModel.getFormulaStringByCell(h, d, o, a);
|
|
5245
|
+
c.push(l || "");
|
|
5246
5246
|
}
|
|
5247
5247
|
e.push(c);
|
|
5248
5248
|
}
|
|
@@ -5334,7 +5334,7 @@ let R = (q = class extends He {
|
|
|
5334
5334
|
* ```
|
|
5335
5335
|
*/
|
|
5336
5336
|
getVerticalAlignment() {
|
|
5337
|
-
return
|
|
5337
|
+
return Ct(this._worksheet.getRange(this._range).getVerticalAlignment());
|
|
5338
5338
|
}
|
|
5339
5339
|
/**
|
|
5340
5340
|
* Returns the vertical alignments of the cells in the range.
|
|
@@ -5348,7 +5348,7 @@ let R = (q = class extends He {
|
|
|
5348
5348
|
* ```
|
|
5349
5349
|
*/
|
|
5350
5350
|
getVerticalAlignments() {
|
|
5351
|
-
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) => Ct(s)));
|
|
5352
5352
|
}
|
|
5353
5353
|
/**
|
|
5354
5354
|
* Set custom meta data for first cell in current range.
|
|
@@ -5565,7 +5565,7 @@ let R = (q = class extends He {
|
|
|
5565
5565
|
* ```
|
|
5566
5566
|
*/
|
|
5567
5567
|
setValue(e) {
|
|
5568
|
-
const t =
|
|
5568
|
+
const t = Me(e);
|
|
5569
5569
|
if (!t)
|
|
5570
5570
|
throw new Error("Invalid value");
|
|
5571
5571
|
return this._commandService.syncExecuteCommand(X.id, {
|
|
@@ -5590,7 +5590,7 @@ let R = (q = class extends He {
|
|
|
5590
5590
|
* ```
|
|
5591
5591
|
*/
|
|
5592
5592
|
setValueForCell(e) {
|
|
5593
|
-
const t =
|
|
5593
|
+
const t = Me(e);
|
|
5594
5594
|
if (!t)
|
|
5595
5595
|
throw new Error("Invalid value");
|
|
5596
5596
|
return this._commandService.syncExecuteCommand(X.id, {
|
|
@@ -5731,7 +5731,7 @@ let R = (q = class extends He {
|
|
|
5731
5731
|
unitId: this._workbook.getUnitId(),
|
|
5732
5732
|
subUnitId: this._worksheet.getSheetId(),
|
|
5733
5733
|
range: this._range,
|
|
5734
|
-
value:
|
|
5734
|
+
value: Ln(e)
|
|
5735
5735
|
}), this;
|
|
5736
5736
|
}
|
|
5737
5737
|
/**
|
|
@@ -5751,7 +5751,7 @@ let R = (q = class extends He {
|
|
|
5751
5751
|
unitId: this._workbook.getUnitId(),
|
|
5752
5752
|
subUnitId: this._worksheet.getSheetId(),
|
|
5753
5753
|
range: this._range,
|
|
5754
|
-
value:
|
|
5754
|
+
value: zn(e)
|
|
5755
5755
|
}), this;
|
|
5756
5756
|
}
|
|
5757
5757
|
/**
|
|
@@ -6010,7 +6010,7 @@ let R = (q = class extends He {
|
|
|
6010
6010
|
*/
|
|
6011
6011
|
merge(e) {
|
|
6012
6012
|
const t = this._workbook.getUnitId(), s = this._worksheet.getSheetId();
|
|
6013
|
-
return
|
|
6013
|
+
return pe(this._injector, t, s, [this._range], e), this;
|
|
6014
6014
|
}
|
|
6015
6015
|
/**
|
|
6016
6016
|
* Merges cells in a range horizontally.
|
|
@@ -6042,7 +6042,7 @@ let R = (q = class extends He {
|
|
|
6042
6042
|
*/
|
|
6043
6043
|
mergeAcross(e) {
|
|
6044
6044
|
const t = mt([this._range], G.ROWS), s = this._workbook.getUnitId(), n = this._worksheet.getSheetId();
|
|
6045
|
-
return
|
|
6045
|
+
return pe(this._injector, s, n, t, e), this;
|
|
6046
6046
|
}
|
|
6047
6047
|
/**
|
|
6048
6048
|
* Merges cells in a range vertically.
|
|
@@ -6074,7 +6074,7 @@ let R = (q = class extends He {
|
|
|
6074
6074
|
*/
|
|
6075
6075
|
mergeVertically(e) {
|
|
6076
6076
|
const t = mt([this._range], G.COLUMNS), s = this._workbook.getUnitId(), n = this._worksheet.getSheetId();
|
|
6077
|
-
return
|
|
6077
|
+
return pe(this._injector, s, n, t, e), this;
|
|
6078
6078
|
}
|
|
6079
6079
|
/**
|
|
6080
6080
|
* Returns true if cells in the current range overlap a merged cell.
|
|
@@ -6175,7 +6175,7 @@ let R = (q = class extends He {
|
|
|
6175
6175
|
startAbsoluteRefType: t,
|
|
6176
6176
|
endAbsoluteRefType: s
|
|
6177
6177
|
};
|
|
6178
|
-
return e ?
|
|
6178
|
+
return e ? Un(this._worksheet.getName(), n) : Ke(n);
|
|
6179
6179
|
}
|
|
6180
6180
|
/**
|
|
6181
6181
|
* Sets the specified range as the active range, with the top left cell in the range as the current cell.
|
|
@@ -6189,7 +6189,7 @@ let R = (q = class extends He {
|
|
|
6189
6189
|
* ```
|
|
6190
6190
|
*/
|
|
6191
6191
|
activate() {
|
|
6192
|
-
return this._injector.createInstance(
|
|
6192
|
+
return this._injector.createInstance(E, this._workbook).setActiveRange(this), this;
|
|
6193
6193
|
}
|
|
6194
6194
|
/**
|
|
6195
6195
|
* Sets the specified cell as the current cell.
|
|
@@ -6225,18 +6225,18 @@ let R = (q = class extends He {
|
|
|
6225
6225
|
*/
|
|
6226
6226
|
activateAsCurrentCell() {
|
|
6227
6227
|
const e = this._worksheet.getMergedCell(this._range.startRow, this._range.startColumn);
|
|
6228
|
-
if (e &&
|
|
6229
|
-
const n = this._injector.createInstance(
|
|
6228
|
+
if (e && B.equals(e, this._range) || !e && this._range.startRow === this._range.endRow && this._range.startColumn === this._range.endColumn) {
|
|
6229
|
+
const n = this._injector.createInstance(E, this._workbook).getActiveRange();
|
|
6230
6230
|
if (!n || n.getUnitId() !== this.getUnitId() || n.getSheetId() !== this.getSheetId())
|
|
6231
6231
|
return this.activate();
|
|
6232
|
-
if (
|
|
6232
|
+
if (B.contains(n.getRange(), this._range)) {
|
|
6233
6233
|
const i = {
|
|
6234
6234
|
unitId: this.getUnitId(),
|
|
6235
6235
|
subUnitId: this.getSheetId(),
|
|
6236
6236
|
selections: [
|
|
6237
6237
|
{
|
|
6238
6238
|
range: n.getRange(),
|
|
6239
|
-
primary:
|
|
6239
|
+
primary: me(this.getRange(), this._worksheet),
|
|
6240
6240
|
style: null
|
|
6241
6241
|
}
|
|
6242
6242
|
]
|
|
@@ -6582,24 +6582,24 @@ let R = (q = class extends He {
|
|
|
6582
6582
|
// eslint-disable-next-line complexity
|
|
6583
6583
|
getDataRegion(e) {
|
|
6584
6584
|
const { startRow: t, startColumn: s, endRow: n, endColumn: i } = this._range, o = this._worksheet.getMaxRows(), a = this._worksheet.getMaxColumns(), h = this._worksheet.getCellMatrix();
|
|
6585
|
-
let c = t, d = s,
|
|
6585
|
+
let c = t, d = s, l = n, m = i;
|
|
6586
6586
|
if (e !== G.COLUMNS) {
|
|
6587
|
-
let S = !1,
|
|
6588
|
-
for (let f = s; f <= i && (t > 0 && !Q(h.getValue(t - 1, f)) && (S = !0), n < o - 1 && !Q(h.getValue(n + 1, f)) && (
|
|
6587
|
+
let S = !1, C = !1;
|
|
6588
|
+
for (let f = s; f <= i && (t > 0 && !Q(h.getValue(t - 1, f)) && (S = !0), n < o - 1 && !Q(h.getValue(n + 1, f)) && (C = !0), !(S && C)); f++)
|
|
6589
6589
|
;
|
|
6590
|
-
S && (c = t - 1),
|
|
6590
|
+
S && (c = t - 1), C && (l = n + 1);
|
|
6591
6591
|
}
|
|
6592
6592
|
if (e !== G.ROWS) {
|
|
6593
|
-
let S = !1,
|
|
6594
|
-
for (let f = t; f <= n && (s > 0 && !Q(h.getValue(f, s - 1)) && (S = !0), i < a - 1 && !Q(h.getValue(f, i + 1)) && (
|
|
6593
|
+
let S = !1, C = !1;
|
|
6594
|
+
for (let f = t; f <= n && (s > 0 && !Q(h.getValue(f, s - 1)) && (S = !0), i < a - 1 && !Q(h.getValue(f, i + 1)) && (C = !0), !(S && C)); f++)
|
|
6595
6595
|
;
|
|
6596
|
-
S && (d = s - 1),
|
|
6596
|
+
S && (d = s - 1), C && (m = i + 1);
|
|
6597
6597
|
}
|
|
6598
6598
|
return this._injector.createInstance(R, this._workbook, this._worksheet, {
|
|
6599
6599
|
startRow: c,
|
|
6600
6600
|
startColumn: d,
|
|
6601
|
-
endRow:
|
|
6602
|
-
endColumn:
|
|
6601
|
+
endRow: l,
|
|
6602
|
+
endColumn: m
|
|
6603
6603
|
});
|
|
6604
6604
|
}
|
|
6605
6605
|
/**
|
|
@@ -6652,14 +6652,14 @@ let R = (q = class extends He {
|
|
|
6652
6652
|
* ```
|
|
6653
6653
|
*/
|
|
6654
6654
|
offset(e, t, s, n) {
|
|
6655
|
-
const { startRow: i, startColumn: o, endRow: a, endColumn: h } = this._range, c = i + e, d = o + t,
|
|
6656
|
-
if (c < 0 || d < 0 ||
|
|
6655
|
+
const { startRow: i, startColumn: o, endRow: a, endColumn: h } = this._range, c = i + e, d = o + t, l = s ? c + s - 1 : a + e, m = n ? d + n - 1 : h + t;
|
|
6656
|
+
if (c < 0 || d < 0 || l < 0 || m < 0)
|
|
6657
6657
|
throw new Error("The row or column index is out of range");
|
|
6658
6658
|
return this._injector.createInstance(R, this._workbook, this._worksheet, {
|
|
6659
6659
|
startRow: c,
|
|
6660
6660
|
startColumn: d,
|
|
6661
|
-
endRow:
|
|
6662
|
-
endColumn:
|
|
6661
|
+
endRow: l,
|
|
6662
|
+
endColumn: m
|
|
6663
6663
|
});
|
|
6664
6664
|
}
|
|
6665
6665
|
/**
|
|
@@ -6728,7 +6728,7 @@ let R = (q = class extends He {
|
|
|
6728
6728
|
* ```
|
|
6729
6729
|
*/
|
|
6730
6730
|
getRangePermission() {
|
|
6731
|
-
const e = this._injector.createInstance(v, this._injector.createInstance(
|
|
6731
|
+
const e = this._injector.createInstance(v, this._injector.createInstance(E, this._workbook), this._workbook, this._worksheet);
|
|
6732
6732
|
return this._injector.createInstance(
|
|
6733
6733
|
Ae,
|
|
6734
6734
|
this._workbook.getUnitId(),
|
|
@@ -6737,23 +6737,80 @@ let R = (q = class extends He {
|
|
|
6737
6737
|
e
|
|
6738
6738
|
);
|
|
6739
6739
|
}
|
|
6740
|
+
/**
|
|
6741
|
+
* Fills the target range with data based on the data in the current range.
|
|
6742
|
+
* @param {FRange} targetRange - The range to be filled with data.
|
|
6743
|
+
* @param {AUTO_FILL_APPLY_TYPE} [applyType] - The type of data fill to be applied.
|
|
6744
|
+
* @returns {Promise<boolean>} A promise that resolves to true if the fill operation was successful, false otherwise.
|
|
6745
|
+
* @example
|
|
6746
|
+
* ```ts
|
|
6747
|
+
* // Auto-fill the range D1:D10 based on the data in the range C1:C2
|
|
6748
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
6749
|
+
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
6750
|
+
* const fRange = fWorksheet.getRange('A1:A4');
|
|
6751
|
+
*
|
|
6752
|
+
* // Auto-fill without specifying applyType (default behavior)
|
|
6753
|
+
* await fRange.autoFill(fWorksheet.getRange('A1:A20'))
|
|
6754
|
+
*
|
|
6755
|
+
* // Auto-fill with 'COPY' type
|
|
6756
|
+
* await fRange.autoFill(fWorksheet.getRange('A1:A20'), 'COPY')
|
|
6757
|
+
*
|
|
6758
|
+
* // Auto-fill with 'SERIES' type
|
|
6759
|
+
* await fRange.autoFill(fWorksheet.getRange('A1:A20'), 'SERIES')
|
|
6760
|
+
* ```
|
|
6761
|
+
*
|
|
6762
|
+
* ```ts
|
|
6763
|
+
* // Operate on a specific worksheet
|
|
6764
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
6765
|
+
* const fWorksheet = fWorkbook.getSheetBySheetId('sheetId');
|
|
6766
|
+
* const fRange = fWorksheet.getRange('A1:A4');
|
|
6767
|
+
*
|
|
6768
|
+
* // Auto-fill without specifying applyType (default behavior)
|
|
6769
|
+
* await fRange.autoFill(fWorksheet.getRange('A1:A20'))
|
|
6770
|
+
*
|
|
6771
|
+
* // Auto-fill with 'COPY' type
|
|
6772
|
+
* await fRange.autoFill(fWorksheet.getRange('A1:A20'), 'COPY')
|
|
6773
|
+
*
|
|
6774
|
+
* // Auto-fill with 'SERIES' type
|
|
6775
|
+
* await fRange.autoFill(fWorksheet.getRange('A1:A20'), 'SERIES')
|
|
6776
|
+
* ```
|
|
6777
|
+
*/
|
|
6778
|
+
autoFill(e, t) {
|
|
6779
|
+
const s = this.getRange(), n = e.getRange();
|
|
6780
|
+
if (!B.contains(n, s))
|
|
6781
|
+
throw new Error("AutoFill target range must contain source range");
|
|
6782
|
+
const { startRow: i, startColumn: o, endRow: a, endColumn: h } = s, { startRow: c, startColumn: d, endRow: l, endColumn: m } = n;
|
|
6783
|
+
if (a - i !== l - c && h - o !== m - d)
|
|
6784
|
+
throw new Error("AutoFill can only fill in one direction");
|
|
6785
|
+
if (a - i === l - c && o !== d && h !== m)
|
|
6786
|
+
throw new Error("AutoFill can only fill in one direction");
|
|
6787
|
+
if (h - o === m - d && i !== c && a !== l)
|
|
6788
|
+
throw new Error("AutoFill can only fill in one direction");
|
|
6789
|
+
return this._commandService.executeCommand(_n.id, {
|
|
6790
|
+
sourceRange: s,
|
|
6791
|
+
targetRange: n,
|
|
6792
|
+
unitId: this.getUnitId(),
|
|
6793
|
+
subUnitId: this.getSheetId(),
|
|
6794
|
+
applyType: t
|
|
6795
|
+
});
|
|
6796
|
+
}
|
|
6740
6797
|
}, q._enableManualInit(), q);
|
|
6741
|
-
R =
|
|
6742
|
-
|
|
6743
|
-
|
|
6744
|
-
|
|
6798
|
+
R = Zn([
|
|
6799
|
+
Ue(3, g(P)),
|
|
6800
|
+
Ue(4, k),
|
|
6801
|
+
Ue(5, g(xn))
|
|
6745
6802
|
], R);
|
|
6746
|
-
var
|
|
6747
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
6803
|
+
var Qn = Object.getOwnPropertyDescriptor, Xn = (r, e, t, s) => {
|
|
6804
|
+
for (var n = s > 1 ? void 0 : s ? Qn(e, t) : e, i = r.length - 1, o; i >= 0; i--)
|
|
6748
6805
|
(o = r[i]) && (n = o(n) || n);
|
|
6749
6806
|
return n;
|
|
6750
|
-
},
|
|
6807
|
+
}, xe = (r, e) => (t, s) => e(t, s, r);
|
|
6751
6808
|
let Be = class {
|
|
6752
6809
|
constructor(r, e, t, s) {
|
|
6753
6810
|
w(this, "_permissionSubject");
|
|
6754
6811
|
// Collaborator changes are tracked manually since IAuthzIoService doesn't provide an observable
|
|
6755
6812
|
// TODO: If IAuthzIoService adds an observable in the future, migrate to use that
|
|
6756
|
-
w(this, "_collaboratorChangeSubject", new
|
|
6813
|
+
w(this, "_collaboratorChangeSubject", new Mn());
|
|
6757
6814
|
/**
|
|
6758
6815
|
* Observable stream of permission snapshot changes (BehaviorSubject)
|
|
6759
6816
|
* Emits immediately on subscription with current state, then on any permission point change
|
|
@@ -6771,7 +6828,7 @@ let Be = class {
|
|
|
6771
6828
|
w(this, "collaboratorChange$");
|
|
6772
6829
|
w(this, "_subscriptions", []);
|
|
6773
6830
|
w(this, "_fPermission");
|
|
6774
|
-
this._unitId = r, this._injector = e, this._permissionService = t, this._authzIoService = s, this._fPermission = this._injector.createInstance(z), this._permissionSubject = new
|
|
6831
|
+
this._unitId = r, this._injector = e, this._permissionService = t, this._authzIoService = s, this._fPermission = this._injector.createInstance(z), this._permissionSubject = new _e(this._buildSnapshot()), this.permission$ = this._createPermissionStream(), this.pointChange$ = this._createPointChangeStream(), this.collaboratorChange$ = this._collaboratorChangeSubject.asObservable().pipe(
|
|
6775
6832
|
N({ bufferSize: 1, refCount: !0 })
|
|
6776
6833
|
);
|
|
6777
6834
|
}
|
|
@@ -6786,7 +6843,7 @@ let Be = class {
|
|
|
6786
6843
|
this._permissionSubject.next(this._buildSnapshot());
|
|
6787
6844
|
});
|
|
6788
6845
|
return this._subscriptions.push(r), this._permissionSubject.asObservable().pipe(
|
|
6789
|
-
|
|
6846
|
+
we((e, t) => JSON.stringify(e) === JSON.stringify(t)),
|
|
6790
6847
|
N({ bufferSize: 1, refCount: !0 })
|
|
6791
6848
|
);
|
|
6792
6849
|
}
|
|
@@ -6802,7 +6859,7 @@ let Be = class {
|
|
|
6802
6859
|
}
|
|
6803
6860
|
return this._permissionService.permissionPointUpdate$.pipe(
|
|
6804
6861
|
M((e) => e.id.includes(this._unitId)),
|
|
6805
|
-
|
|
6862
|
+
Se((e) => {
|
|
6806
6863
|
const t = this._extractWorkbookPointType(e.id);
|
|
6807
6864
|
if (!t) return null;
|
|
6808
6865
|
const s = !!e.value, n = r.get(t);
|
|
@@ -7118,7 +7175,7 @@ let Be = class {
|
|
|
7118
7175
|
type: "delete",
|
|
7119
7176
|
collaborator: {
|
|
7120
7177
|
user: { id: r },
|
|
7121
|
-
role:
|
|
7178
|
+
role: $.Reader
|
|
7122
7179
|
// Placeholder value
|
|
7123
7180
|
}
|
|
7124
7181
|
});
|
|
@@ -7191,17 +7248,17 @@ let Be = class {
|
|
|
7191
7248
|
this._subscriptions.forEach((r) => r.unsubscribe()), this._permissionSubject.complete(), this._collaboratorChangeSubject.complete();
|
|
7192
7249
|
}
|
|
7193
7250
|
};
|
|
7194
|
-
Be =
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7251
|
+
Be = Xn([
|
|
7252
|
+
xe(1, g(P)),
|
|
7253
|
+
xe(2, Y),
|
|
7254
|
+
xe(3, re)
|
|
7198
7255
|
], Be);
|
|
7199
|
-
var
|
|
7200
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
7256
|
+
var er = Object.getOwnPropertyDescriptor, tr = (r, e, t, s) => {
|
|
7257
|
+
for (var n = s > 1 ? void 0 : s ? er(e, t) : e, i = r.length - 1, o; i >= 0; i--)
|
|
7201
7258
|
(o = r[i]) && (n = o(n) || n);
|
|
7202
7259
|
return n;
|
|
7203
7260
|
}, j = (r, e) => (t, s) => e(t, s, r);
|
|
7204
|
-
let
|
|
7261
|
+
let E = class extends He {
|
|
7205
7262
|
constructor(e, t, s, n, i, o, a, h, c, d) {
|
|
7206
7263
|
super(t);
|
|
7207
7264
|
w(this, "id");
|
|
@@ -7263,7 +7320,7 @@ let P = class extends He {
|
|
|
7263
7320
|
* ```
|
|
7264
7321
|
*/
|
|
7265
7322
|
setName(e) {
|
|
7266
|
-
return this._commandService.syncExecuteCommand(
|
|
7323
|
+
return this._commandService.syncExecuteCommand(wn.id, {
|
|
7267
7324
|
unitId: this._workbook.getUnitId(),
|
|
7268
7325
|
name: e
|
|
7269
7326
|
}), this;
|
|
@@ -7366,7 +7423,7 @@ let P = class extends He {
|
|
|
7366
7423
|
const i = Xe(et.deepClone((h = n == null ? void 0 : n.sheet) != null ? h : {}));
|
|
7367
7424
|
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;
|
|
7368
7425
|
const o = (d = n == null ? void 0 : n.index) != null ? d : this._workbook.getSheets().length;
|
|
7369
|
-
this._commandService.syncExecuteCommand(
|
|
7426
|
+
this._commandService.syncExecuteCommand(ge.id, {
|
|
7370
7427
|
unitId: this.id,
|
|
7371
7428
|
index: o,
|
|
7372
7429
|
sheet: i
|
|
@@ -7473,7 +7530,7 @@ let P = class extends He {
|
|
|
7473
7530
|
const s = Xe(et.deepClone((o = t == null ? void 0 : t.sheet) != null ? o : {}));
|
|
7474
7531
|
s.name = this._workbook.uniqueSheetName(e), s.id = (a = t == null ? void 0 : t.sheet) == null ? void 0 : a.id;
|
|
7475
7532
|
const n = (h = t == null ? void 0 : t.index) != null ? h : this._workbook.getSheets().length;
|
|
7476
|
-
this._commandService.syncExecuteCommand(
|
|
7533
|
+
this._commandService.syncExecuteCommand(ge.id, {
|
|
7477
7534
|
unitId: this.id,
|
|
7478
7535
|
index: n,
|
|
7479
7536
|
sheet: s
|
|
@@ -7604,7 +7661,7 @@ let P = class extends He {
|
|
|
7604
7661
|
onSelectionChange(e) {
|
|
7605
7662
|
return vt(
|
|
7606
7663
|
this._selectionManagerService.selectionMoveEnd$.subscribe((t) => {
|
|
7607
|
-
this._univerInstanceService.getCurrentUnitForType(
|
|
7664
|
+
this._univerInstanceService.getCurrentUnitForType(H.UNIVER_SHEET).getUnitId() === this.id && (t != null && t.length ? e(t.map((s) => s.range)) : e([]));
|
|
7608
7665
|
})
|
|
7609
7666
|
);
|
|
7610
7667
|
}
|
|
@@ -7642,7 +7699,7 @@ let P = class extends He {
|
|
|
7642
7699
|
const i = {
|
|
7643
7700
|
unitId: this.getId(),
|
|
7644
7701
|
subUnitId: s,
|
|
7645
|
-
selections: [e].map((o) => ({ range: o.getRange(), primary:
|
|
7702
|
+
selections: [e].map((o) => ({ range: o.getRange(), primary: me(o.getRange(), n), style: null }))
|
|
7646
7703
|
};
|
|
7647
7704
|
return this._commandService.syncExecuteCommand(Ge.id, i), this;
|
|
7648
7705
|
}
|
|
@@ -7707,7 +7764,7 @@ let P = class extends He {
|
|
|
7707
7764
|
* ```
|
|
7708
7765
|
*/
|
|
7709
7766
|
duplicateSheet(e) {
|
|
7710
|
-
return this._commandService.syncExecuteCommand(
|
|
7767
|
+
return this._commandService.syncExecuteCommand(Sn.id, {
|
|
7711
7768
|
unitId: e.getWorkbook().getUnitId(),
|
|
7712
7769
|
subUnitId: e.getSheetId()
|
|
7713
7770
|
}), this._injector.createInstance(v, this, this._workbook, this._workbook.getActiveSheet());
|
|
@@ -7803,7 +7860,7 @@ let P = class extends He {
|
|
|
7803
7860
|
*/
|
|
7804
7861
|
moveSheet(e, t) {
|
|
7805
7862
|
let s = t;
|
|
7806
|
-
return s < 0 ? s = 0 : s > this._workbook.getSheets().length - 1 && (s = this._workbook.getSheets().length - 1), this._commandService.syncExecuteCommand(
|
|
7863
|
+
return s < 0 ? s = 0 : s > this._workbook.getSheets().length - 1 && (s = this._workbook.getSheets().length - 1), this._commandService.syncExecuteCommand(Cn.id, {
|
|
7807
7864
|
unitId: e.getWorkbook().getUnitId(),
|
|
7808
7865
|
order: s,
|
|
7809
7866
|
subUnitId: e.getSheetId()
|
|
@@ -7884,7 +7941,7 @@ let P = class extends He {
|
|
|
7884
7941
|
*/
|
|
7885
7942
|
getDefinedName(e) {
|
|
7886
7943
|
const t = this._definedNamesService.getValueByName(this.id, e);
|
|
7887
|
-
return t ? this._injector.createInstance(
|
|
7944
|
+
return t ? this._injector.createInstance(Ce, { ...t, unitId: this.id }) : null;
|
|
7888
7945
|
}
|
|
7889
7946
|
/**
|
|
7890
7947
|
* Get all the defined names in the workbook.
|
|
@@ -7899,7 +7956,7 @@ let P = class extends He {
|
|
|
7899
7956
|
*/
|
|
7900
7957
|
getDefinedNames() {
|
|
7901
7958
|
const e = this._definedNamesService.getDefinedNameMap(this.id);
|
|
7902
|
-
return e ? Object.values(e).map((t) => this._injector.createInstance(
|
|
7959
|
+
return e ? Object.values(e).map((t) => this._injector.createInstance(Ce, { ...t, unitId: this.id })) : [];
|
|
7903
7960
|
}
|
|
7904
7961
|
/**
|
|
7905
7962
|
* Insert a defined name.
|
|
@@ -7914,7 +7971,7 @@ let P = class extends He {
|
|
|
7914
7971
|
* ```
|
|
7915
7972
|
*/
|
|
7916
7973
|
insertDefinedName(e, t) {
|
|
7917
|
-
const n = this._injector.createInstance(
|
|
7974
|
+
const n = this._injector.createInstance(be).setName(e).setRef(t).build();
|
|
7918
7975
|
return n.localSheetId = ne, this.insertDefinedNameBuilder(n), this;
|
|
7919
7976
|
}
|
|
7920
7977
|
/**
|
|
@@ -8023,7 +8080,7 @@ let P = class extends He {
|
|
|
8023
8080
|
* ```
|
|
8024
8081
|
*/
|
|
8025
8082
|
unregisterRangeTheme(e) {
|
|
8026
|
-
this._commandService.syncExecuteCommand(
|
|
8083
|
+
this._commandService.syncExecuteCommand(bn.id, {
|
|
8027
8084
|
unitId: this.getId(),
|
|
8028
8085
|
themeName: e
|
|
8029
8086
|
});
|
|
@@ -8047,7 +8104,7 @@ let P = class extends He {
|
|
|
8047
8104
|
* ```
|
|
8048
8105
|
*/
|
|
8049
8106
|
createRangeThemeStyle(e, t) {
|
|
8050
|
-
return new
|
|
8107
|
+
return new In(e, t);
|
|
8051
8108
|
}
|
|
8052
8109
|
/**
|
|
8053
8110
|
* Set custom metadata of workbook
|
|
@@ -8152,18 +8209,18 @@ let P = class extends He {
|
|
|
8152
8209
|
this._workbook.removeStyles(e);
|
|
8153
8210
|
}
|
|
8154
8211
|
};
|
|
8155
|
-
|
|
8156
|
-
j(1,
|
|
8157
|
-
j(2,
|
|
8158
|
-
j(3,
|
|
8159
|
-
j(4,
|
|
8160
|
-
j(5,
|
|
8212
|
+
E = tr([
|
|
8213
|
+
j(1, g(P)),
|
|
8214
|
+
j(2, g(Ft)),
|
|
8215
|
+
j(3, g(xt)),
|
|
8216
|
+
j(4, le),
|
|
8217
|
+
j(5, k),
|
|
8161
8218
|
j(6, Y),
|
|
8162
8219
|
j(7, ft),
|
|
8163
|
-
j(8,
|
|
8220
|
+
j(8, g(bt)),
|
|
8164
8221
|
j(9, Nt)
|
|
8165
|
-
],
|
|
8166
|
-
class
|
|
8222
|
+
], E);
|
|
8223
|
+
class sr extends Rt {
|
|
8167
8224
|
getCommandSheetTarget(e) {
|
|
8168
8225
|
var i;
|
|
8169
8226
|
const t = e.params;
|
|
@@ -8184,12 +8241,12 @@ class tr extends Rt {
|
|
|
8184
8241
|
return { workbook: s, worksheet: n };
|
|
8185
8242
|
}
|
|
8186
8243
|
_initWorkbookEvent(e) {
|
|
8187
|
-
const t = e.get(
|
|
8244
|
+
const t = e.get(le);
|
|
8188
8245
|
this.disposeWithMe(
|
|
8189
8246
|
this.registerEventHandler(
|
|
8190
8247
|
this.Event.WorkbookDisposed,
|
|
8191
8248
|
() => t.unitDisposed$.subscribe((s) => {
|
|
8192
|
-
s.type ===
|
|
8249
|
+
s.type === H.UNIVER_SHEET && this.fireEvent(this.Event.WorkbookDisposed, {
|
|
8193
8250
|
unitId: s.getUnitId(),
|
|
8194
8251
|
unitType: s.type,
|
|
8195
8252
|
snapshot: s.getSnapshot()
|
|
@@ -8200,8 +8257,8 @@ class tr extends Rt {
|
|
|
8200
8257
|
this.registerEventHandler(
|
|
8201
8258
|
this.Event.WorkbookCreated,
|
|
8202
8259
|
() => t.unitAdded$.subscribe((s) => {
|
|
8203
|
-
if (s.type ===
|
|
8204
|
-
const n = s, i = e.createInstance(
|
|
8260
|
+
if (s.type === H.UNIVER_SHEET) {
|
|
8261
|
+
const n = s, i = e.createInstance(E, n);
|
|
8205
8262
|
this.fireEvent(this.Event.WorkbookCreated, {
|
|
8206
8263
|
unitId: s.getUnitId(),
|
|
8207
8264
|
type: s.type,
|
|
@@ -8218,22 +8275,22 @@ class tr extends Rt {
|
|
|
8218
8275
|
*/
|
|
8219
8276
|
// eslint-disable-next-line max-lines-per-function
|
|
8220
8277
|
_initialize(e) {
|
|
8221
|
-
const t = e.get(
|
|
8278
|
+
const t = e.get(le), s = e.get(k);
|
|
8222
8279
|
this.disposeWithMe(
|
|
8223
8280
|
this.registerEventHandler(
|
|
8224
8281
|
this.Event.BeforeSheetCreate,
|
|
8225
|
-
() =>
|
|
8226
|
-
var
|
|
8227
|
-
if (
|
|
8228
|
-
const
|
|
8229
|
-
if (!
|
|
8282
|
+
() => s.beforeCommandExecuted((n) => {
|
|
8283
|
+
var i;
|
|
8284
|
+
if (n.id === ge.id) {
|
|
8285
|
+
const o = n.params, { unitId: a, index: h, sheet: c } = o || {}, d = a ? this.getUniverSheet(a) : (i = this.getActiveWorkbook) == null ? void 0 : i.call(this);
|
|
8286
|
+
if (!d)
|
|
8230
8287
|
return;
|
|
8231
|
-
const
|
|
8232
|
-
workbook:
|
|
8233
|
-
index:
|
|
8234
|
-
sheet:
|
|
8288
|
+
const l = {
|
|
8289
|
+
workbook: d,
|
|
8290
|
+
index: h,
|
|
8291
|
+
sheet: c
|
|
8235
8292
|
};
|
|
8236
|
-
if (this.fireEvent(this.Event.BeforeSheetCreate,
|
|
8293
|
+
if (this.fireEvent(this.Event.BeforeSheetCreate, l), l.cancel)
|
|
8237
8294
|
throw new D();
|
|
8238
8295
|
}
|
|
8239
8296
|
})
|
|
@@ -8241,19 +8298,19 @@ class tr extends Rt {
|
|
|
8241
8298
|
), this.disposeWithMe(
|
|
8242
8299
|
this.registerEventHandler(
|
|
8243
8300
|
this.Event.BeforeActiveSheetChange,
|
|
8244
|
-
() =>
|
|
8245
|
-
var
|
|
8246
|
-
if (
|
|
8247
|
-
const { subUnitId:
|
|
8248
|
-
if (!
|
|
8249
|
-
const
|
|
8250
|
-
if (!
|
|
8251
|
-
const
|
|
8252
|
-
workbook:
|
|
8253
|
-
activeSheet:
|
|
8254
|
-
oldActiveSheet:
|
|
8301
|
+
() => s.beforeCommandExecuted((n) => {
|
|
8302
|
+
var i;
|
|
8303
|
+
if (n.id === te.id) {
|
|
8304
|
+
const { subUnitId: o, unitId: a } = n.params, h = a ? this.getUniverSheet(a) : (i = this.getActiveWorkbook) == null ? void 0 : i.call(this);
|
|
8305
|
+
if (!h || !o) return;
|
|
8306
|
+
const c = h.getSheetBySheetId(o), d = h.getActiveSheet();
|
|
8307
|
+
if (!c || !d) return;
|
|
8308
|
+
const l = {
|
|
8309
|
+
workbook: h,
|
|
8310
|
+
activeSheet: c,
|
|
8311
|
+
oldActiveSheet: d
|
|
8255
8312
|
};
|
|
8256
|
-
if (this.fireEvent(this.Event.BeforeActiveSheetChange,
|
|
8313
|
+
if (this.fireEvent(this.Event.BeforeActiveSheetChange, l), l.cancel)
|
|
8257
8314
|
throw new D();
|
|
8258
8315
|
}
|
|
8259
8316
|
})
|
|
@@ -8261,15 +8318,15 @@ class tr extends Rt {
|
|
|
8261
8318
|
), this.disposeWithMe(
|
|
8262
8319
|
this.registerEventHandler(
|
|
8263
8320
|
this.Event.BeforeSheetDelete,
|
|
8264
|
-
() =>
|
|
8265
|
-
if (
|
|
8266
|
-
const
|
|
8267
|
-
if (!
|
|
8268
|
-
const { workbook:
|
|
8269
|
-
workbook:
|
|
8270
|
-
worksheet:
|
|
8321
|
+
() => s.beforeCommandExecuted((n) => {
|
|
8322
|
+
if (n.id === Te.id) {
|
|
8323
|
+
const i = this.getCommandSheetTarget(n);
|
|
8324
|
+
if (!i) return;
|
|
8325
|
+
const { workbook: o, worksheet: a } = i, h = {
|
|
8326
|
+
workbook: o,
|
|
8327
|
+
worksheet: a
|
|
8271
8328
|
};
|
|
8272
|
-
if (this.fireEvent(this.Event.BeforeSheetDelete,
|
|
8329
|
+
if (this.fireEvent(this.Event.BeforeSheetDelete, h), h.cancel)
|
|
8273
8330
|
throw new D();
|
|
8274
8331
|
}
|
|
8275
8332
|
})
|
|
@@ -8277,17 +8334,17 @@ class tr extends Rt {
|
|
|
8277
8334
|
), this.disposeWithMe(
|
|
8278
8335
|
this.registerEventHandler(
|
|
8279
8336
|
this.Event.BeforeSheetMove,
|
|
8280
|
-
() =>
|
|
8281
|
-
if (
|
|
8282
|
-
const { fromOrder:
|
|
8283
|
-
if (!
|
|
8284
|
-
const
|
|
8285
|
-
workbook:
|
|
8286
|
-
worksheet:
|
|
8287
|
-
newIndex:
|
|
8288
|
-
oldIndex:
|
|
8337
|
+
() => s.beforeCommandExecuted((n) => {
|
|
8338
|
+
if (n.id === gt.id) {
|
|
8339
|
+
const { fromOrder: i, toOrder: o } = n.params, a = this.getCommandSheetTarget(n);
|
|
8340
|
+
if (!a) return;
|
|
8341
|
+
const h = {
|
|
8342
|
+
workbook: a.workbook,
|
|
8343
|
+
worksheet: a.worksheet,
|
|
8344
|
+
newIndex: o,
|
|
8345
|
+
oldIndex: i
|
|
8289
8346
|
};
|
|
8290
|
-
if (this.fireEvent(this.Event.BeforeSheetMove,
|
|
8347
|
+
if (this.fireEvent(this.Event.BeforeSheetMove, h), h.cancel)
|
|
8291
8348
|
throw new D();
|
|
8292
8349
|
}
|
|
8293
8350
|
})
|
|
@@ -8295,17 +8352,17 @@ class tr extends Rt {
|
|
|
8295
8352
|
), this.disposeWithMe(
|
|
8296
8353
|
this.registerEventHandler(
|
|
8297
8354
|
this.Event.BeforeSheetNameChange,
|
|
8298
|
-
() =>
|
|
8299
|
-
if (
|
|
8300
|
-
const { name:
|
|
8301
|
-
if (!
|
|
8302
|
-
const
|
|
8303
|
-
workbook:
|
|
8304
|
-
worksheet:
|
|
8305
|
-
newName:
|
|
8306
|
-
oldName:
|
|
8355
|
+
() => s.beforeCommandExecuted((n) => {
|
|
8356
|
+
if (n.id === Oe.id) {
|
|
8357
|
+
const { name: i } = n.params, o = this.getCommandSheetTarget(n);
|
|
8358
|
+
if (!o) return;
|
|
8359
|
+
const a = {
|
|
8360
|
+
workbook: o.workbook,
|
|
8361
|
+
worksheet: o.worksheet,
|
|
8362
|
+
newName: i,
|
|
8363
|
+
oldName: o.worksheet.getSheetName()
|
|
8307
8364
|
};
|
|
8308
|
-
if (this.fireEvent(this.Event.BeforeSheetNameChange,
|
|
8365
|
+
if (this.fireEvent(this.Event.BeforeSheetNameChange, a), a.cancel)
|
|
8309
8366
|
throw new D();
|
|
8310
8367
|
}
|
|
8311
8368
|
})
|
|
@@ -8313,17 +8370,17 @@ class tr extends Rt {
|
|
|
8313
8370
|
), this.disposeWithMe(
|
|
8314
8371
|
this.registerEventHandler(
|
|
8315
8372
|
this.Event.BeforeSheetTabColorChange,
|
|
8316
|
-
() =>
|
|
8317
|
-
if (
|
|
8318
|
-
const { color:
|
|
8319
|
-
if (!
|
|
8320
|
-
const
|
|
8321
|
-
workbook:
|
|
8322
|
-
worksheet:
|
|
8323
|
-
newColor:
|
|
8324
|
-
oldColor:
|
|
8373
|
+
() => s.beforeCommandExecuted((n) => {
|
|
8374
|
+
if (n.id === _t.id) {
|
|
8375
|
+
const { color: i } = n.params, o = this.getCommandSheetTarget(n);
|
|
8376
|
+
if (!o) return;
|
|
8377
|
+
const a = {
|
|
8378
|
+
workbook: o.workbook,
|
|
8379
|
+
worksheet: o.worksheet,
|
|
8380
|
+
newColor: i,
|
|
8381
|
+
oldColor: o.worksheet.getTabColor()
|
|
8325
8382
|
};
|
|
8326
|
-
if (this.fireEvent(this.Event.BeforeSheetTabColorChange,
|
|
8383
|
+
if (this.fireEvent(this.Event.BeforeSheetTabColorChange, a), a.cancel)
|
|
8327
8384
|
throw new D();
|
|
8328
8385
|
}
|
|
8329
8386
|
})
|
|
@@ -8331,16 +8388,16 @@ class tr extends Rt {
|
|
|
8331
8388
|
), this.disposeWithMe(
|
|
8332
8389
|
this.registerEventHandler(
|
|
8333
8390
|
this.Event.BeforeSheetHideChange,
|
|
8334
|
-
() =>
|
|
8335
|
-
if (
|
|
8336
|
-
const { hidden:
|
|
8337
|
-
if (!
|
|
8338
|
-
const
|
|
8339
|
-
workbook:
|
|
8340
|
-
worksheet:
|
|
8341
|
-
hidden: !!
|
|
8391
|
+
() => s.beforeCommandExecuted((n) => {
|
|
8392
|
+
if (n.id === wt.id) {
|
|
8393
|
+
const { hidden: i } = n.params, o = this.getCommandSheetTarget(n);
|
|
8394
|
+
if (!o) return;
|
|
8395
|
+
const a = {
|
|
8396
|
+
workbook: o.workbook,
|
|
8397
|
+
worksheet: o.worksheet,
|
|
8398
|
+
hidden: !!i
|
|
8342
8399
|
};
|
|
8343
|
-
if (this.fireEvent(this.Event.BeforeSheetHideChange,
|
|
8400
|
+
if (this.fireEvent(this.Event.BeforeSheetHideChange, a), a.cancel)
|
|
8344
8401
|
throw new D();
|
|
8345
8402
|
}
|
|
8346
8403
|
})
|
|
@@ -8348,16 +8405,16 @@ class tr extends Rt {
|
|
|
8348
8405
|
), this.disposeWithMe(
|
|
8349
8406
|
this.registerEventHandler(
|
|
8350
8407
|
this.Event.BeforeGridlineColorChange,
|
|
8351
|
-
() =>
|
|
8352
|
-
var
|
|
8353
|
-
if (
|
|
8354
|
-
const
|
|
8355
|
-
if (!
|
|
8356
|
-
const
|
|
8357
|
-
...
|
|
8358
|
-
color: (
|
|
8408
|
+
() => s.beforeCommandExecuted((n) => {
|
|
8409
|
+
var i;
|
|
8410
|
+
if (n.id === Ne.id) {
|
|
8411
|
+
const o = this.getCommandSheetTarget(n);
|
|
8412
|
+
if (!o) return;
|
|
8413
|
+
const a = {
|
|
8414
|
+
...o,
|
|
8415
|
+
color: (i = n.params) == null ? void 0 : i.color
|
|
8359
8416
|
};
|
|
8360
|
-
if (this.fireEvent(this.Event.BeforeGridlineColorChange,
|
|
8417
|
+
if (this.fireEvent(this.Event.BeforeGridlineColorChange, a), a.cancel)
|
|
8361
8418
|
throw new D();
|
|
8362
8419
|
}
|
|
8363
8420
|
})
|
|
@@ -8365,16 +8422,16 @@ class tr extends Rt {
|
|
|
8365
8422
|
), this.disposeWithMe(
|
|
8366
8423
|
this.registerEventHandler(
|
|
8367
8424
|
this.Event.BeforeGridlineEnableChange,
|
|
8368
|
-
() =>
|
|
8369
|
-
var
|
|
8370
|
-
if (
|
|
8371
|
-
const
|
|
8372
|
-
if (!
|
|
8373
|
-
const
|
|
8374
|
-
...
|
|
8375
|
-
enabled: !!((
|
|
8425
|
+
() => s.beforeCommandExecuted((n) => {
|
|
8426
|
+
var i;
|
|
8427
|
+
if (n.id === je.id) {
|
|
8428
|
+
const o = this.getCommandSheetTarget(n);
|
|
8429
|
+
if (!o) return;
|
|
8430
|
+
const a = {
|
|
8431
|
+
...o,
|
|
8432
|
+
enabled: !!((i = n.params) != null && i.showGridlines)
|
|
8376
8433
|
};
|
|
8377
|
-
if (this.fireEvent(this.Event.BeforeGridlineEnableChange,
|
|
8434
|
+
if (this.fireEvent(this.Event.BeforeGridlineEnableChange, a), a.cancel)
|
|
8378
8435
|
throw new D();
|
|
8379
8436
|
}
|
|
8380
8437
|
})
|
|
@@ -8382,19 +8439,19 @@ class tr extends Rt {
|
|
|
8382
8439
|
), this.disposeWithMe(
|
|
8383
8440
|
this.registerEventHandler(
|
|
8384
8441
|
this.Event.SheetValueChanged,
|
|
8385
|
-
() =>
|
|
8386
|
-
if (
|
|
8442
|
+
() => s.onCommandExecuted((n) => {
|
|
8443
|
+
if (fn.indexOf(n.id) > -1) {
|
|
8387
8444
|
if (!this.getActiveSheet()) return;
|
|
8388
|
-
const
|
|
8389
|
-
(
|
|
8390
|
-
var
|
|
8391
|
-
return (
|
|
8445
|
+
const o = vn(t, n).map(
|
|
8446
|
+
(a) => {
|
|
8447
|
+
var h, c;
|
|
8448
|
+
return (c = (h = this.getWorkbook(a.unitId)) == null ? void 0 : h.getSheetBySheetId(a.subUnitId)) == null ? void 0 : c.getRange(a.range);
|
|
8392
8449
|
}
|
|
8393
8450
|
).filter(Boolean);
|
|
8394
|
-
if (!
|
|
8451
|
+
if (!o.length) return;
|
|
8395
8452
|
this.fireEvent(this.Event.SheetValueChanged, {
|
|
8396
|
-
payload:
|
|
8397
|
-
effectedRanges:
|
|
8453
|
+
payload: n,
|
|
8454
|
+
effectedRanges: o
|
|
8398
8455
|
});
|
|
8399
8456
|
}
|
|
8400
8457
|
})
|
|
@@ -8402,22 +8459,22 @@ class tr extends Rt {
|
|
|
8402
8459
|
), this.disposeWithMe(
|
|
8403
8460
|
this.registerEventHandler(
|
|
8404
8461
|
this.Event.SheetCreated,
|
|
8405
|
-
() =>
|
|
8406
|
-
var
|
|
8407
|
-
if (
|
|
8408
|
-
const
|
|
8409
|
-
if (!a)
|
|
8410
|
-
return;
|
|
8411
|
-
const h = a.getActiveSheet();
|
|
8462
|
+
() => s.onCommandExecuted((n) => {
|
|
8463
|
+
var i;
|
|
8464
|
+
if (n.id === ge.id) {
|
|
8465
|
+
const o = n.params, { unitId: a } = o || {}, h = a ? this.getUniverSheet(a) : (i = this.getActiveWorkbook) == null ? void 0 : i.call(this);
|
|
8412
8466
|
if (!h)
|
|
8413
8467
|
return;
|
|
8414
|
-
const c =
|
|
8415
|
-
|
|
8416
|
-
|
|
8468
|
+
const c = h.getActiveSheet();
|
|
8469
|
+
if (!c)
|
|
8470
|
+
return;
|
|
8471
|
+
const d = {
|
|
8472
|
+
workbook: h,
|
|
8473
|
+
worksheet: c
|
|
8417
8474
|
};
|
|
8418
8475
|
this.fireEvent(
|
|
8419
8476
|
this.Event.SheetCreated,
|
|
8420
|
-
|
|
8477
|
+
d
|
|
8421
8478
|
);
|
|
8422
8479
|
}
|
|
8423
8480
|
})
|
|
@@ -8425,82 +8482,82 @@ class tr extends Rt {
|
|
|
8425
8482
|
), this.disposeWithMe(
|
|
8426
8483
|
this.registerEventHandler(
|
|
8427
8484
|
this.Event.ActiveSheetChanged,
|
|
8428
|
-
() =>
|
|
8429
|
-
if (
|
|
8430
|
-
const
|
|
8431
|
-
if (!
|
|
8432
|
-
const { workbook:
|
|
8433
|
-
this._fireActiveSheetChanged(
|
|
8485
|
+
() => s.onCommandExecuted((n) => {
|
|
8486
|
+
if (n.id === te.id) {
|
|
8487
|
+
const i = this.getActiveSheet();
|
|
8488
|
+
if (!i) return;
|
|
8489
|
+
const { workbook: o, worksheet: a } = i;
|
|
8490
|
+
this._fireActiveSheetChanged(o, a);
|
|
8434
8491
|
}
|
|
8435
8492
|
})
|
|
8436
8493
|
)
|
|
8437
8494
|
), this.disposeWithMe(
|
|
8438
8495
|
this.registerEventHandler(
|
|
8439
8496
|
this.Event.SheetDeleted,
|
|
8440
|
-
() =>
|
|
8441
|
-
var
|
|
8442
|
-
if (
|
|
8443
|
-
const { subUnitId:
|
|
8444
|
-
if (!
|
|
8445
|
-
this._fireSheetDeleted(
|
|
8497
|
+
() => s.onCommandExecuted((n) => {
|
|
8498
|
+
var i;
|
|
8499
|
+
if (n.id === Te.id) {
|
|
8500
|
+
const { subUnitId: o, unitId: a } = n.params, h = a ? this.getUniverSheet(a) : (i = this.getActiveWorkbook) == null ? void 0 : i.call(this);
|
|
8501
|
+
if (!h || !o) return;
|
|
8502
|
+
this._fireSheetDeleted(h, o);
|
|
8446
8503
|
}
|
|
8447
8504
|
})
|
|
8448
8505
|
)
|
|
8449
8506
|
), this.disposeWithMe(
|
|
8450
8507
|
this.registerEventHandler(
|
|
8451
8508
|
this.Event.SheetMoved,
|
|
8452
|
-
() =>
|
|
8453
|
-
if (
|
|
8454
|
-
const { toOrder:
|
|
8455
|
-
if (!
|
|
8456
|
-
this._fireSheetMoved(
|
|
8509
|
+
() => s.onCommandExecuted((n) => {
|
|
8510
|
+
if (n.id === gt.id) {
|
|
8511
|
+
const { toOrder: i } = n.params, o = this.getCommandSheetTarget(n);
|
|
8512
|
+
if (!o) return;
|
|
8513
|
+
this._fireSheetMoved(o.workbook, o.worksheet, i);
|
|
8457
8514
|
}
|
|
8458
8515
|
})
|
|
8459
8516
|
)
|
|
8460
8517
|
), this.disposeWithMe(
|
|
8461
8518
|
this.registerEventHandler(
|
|
8462
8519
|
this.Event.SheetNameChanged,
|
|
8463
|
-
() =>
|
|
8464
|
-
if (
|
|
8465
|
-
const { name:
|
|
8466
|
-
if (!
|
|
8467
|
-
this._fireSheetNameChanged(
|
|
8520
|
+
() => s.onCommandExecuted((n) => {
|
|
8521
|
+
if (n.id === Oe.id) {
|
|
8522
|
+
const { name: i } = n.params, o = this.getCommandSheetTarget(n);
|
|
8523
|
+
if (!o) return;
|
|
8524
|
+
this._fireSheetNameChanged(o.workbook, o.worksheet, i);
|
|
8468
8525
|
}
|
|
8469
8526
|
})
|
|
8470
8527
|
)
|
|
8471
8528
|
), this.disposeWithMe(
|
|
8472
8529
|
this.registerEventHandler(
|
|
8473
8530
|
this.Event.SheetTabColorChanged,
|
|
8474
|
-
() =>
|
|
8475
|
-
if (
|
|
8476
|
-
const { color:
|
|
8477
|
-
if (!
|
|
8478
|
-
this._fireSheetTabColorChanged(
|
|
8531
|
+
() => s.onCommandExecuted((n) => {
|
|
8532
|
+
if (n.id === _t.id) {
|
|
8533
|
+
const { color: i } = n.params, o = this.getCommandSheetTarget(n);
|
|
8534
|
+
if (!o) return;
|
|
8535
|
+
this._fireSheetTabColorChanged(o.workbook, o.worksheet, i);
|
|
8479
8536
|
}
|
|
8480
8537
|
})
|
|
8481
8538
|
)
|
|
8482
8539
|
), this.disposeWithMe(
|
|
8483
8540
|
this.registerEventHandler(
|
|
8484
8541
|
this.Event.SheetHideChanged,
|
|
8485
|
-
() =>
|
|
8486
|
-
if (
|
|
8487
|
-
const { hidden:
|
|
8488
|
-
if (!
|
|
8489
|
-
this._fireSheetHideChanged(
|
|
8542
|
+
() => s.onCommandExecuted((n) => {
|
|
8543
|
+
if (n.id === wt.id) {
|
|
8544
|
+
const { hidden: i } = n.params, o = this.getCommandSheetTarget(n);
|
|
8545
|
+
if (!o) return;
|
|
8546
|
+
this._fireSheetHideChanged(o.workbook, o.worksheet, !!i);
|
|
8490
8547
|
}
|
|
8491
8548
|
})
|
|
8492
8549
|
)
|
|
8493
8550
|
), this.disposeWithMe(
|
|
8494
8551
|
this.registerEventHandler(
|
|
8495
8552
|
this.Event.GridlineChanged,
|
|
8496
|
-
() =>
|
|
8497
|
-
if (
|
|
8498
|
-
const
|
|
8499
|
-
if (!
|
|
8553
|
+
() => s.onCommandExecuted((n) => {
|
|
8554
|
+
if (n.id === Ne.id || n.id === je.id) {
|
|
8555
|
+
const i = this.getCommandSheetTarget(n);
|
|
8556
|
+
if (!i) return;
|
|
8500
8557
|
this.fireEvent(this.Event.GridlineChanged, {
|
|
8501
|
-
...
|
|
8502
|
-
enabled: !
|
|
8503
|
-
color:
|
|
8558
|
+
...i,
|
|
8559
|
+
enabled: !i.worksheet.hasHiddenGridLines(),
|
|
8560
|
+
color: i.worksheet.getGridLinesColor()
|
|
8504
8561
|
});
|
|
8505
8562
|
}
|
|
8506
8563
|
})
|
|
@@ -8508,22 +8565,22 @@ class tr extends Rt {
|
|
|
8508
8565
|
), this._initWorkbookEvent(e);
|
|
8509
8566
|
}
|
|
8510
8567
|
createUniverSheet(e, t) {
|
|
8511
|
-
const n = this._injector.get(
|
|
8512
|
-
return this._injector.createInstance(
|
|
8568
|
+
const n = this._injector.get(le).createUnit(H.UNIVER_SHEET, e, t);
|
|
8569
|
+
return this._injector.createInstance(E, n);
|
|
8513
8570
|
}
|
|
8514
8571
|
createWorkbook(e, t) {
|
|
8515
8572
|
return this.createUniverSheet(e, t);
|
|
8516
8573
|
}
|
|
8517
8574
|
getActiveWorkbook() {
|
|
8518
|
-
const e = this._univerInstanceService.getCurrentUnitForType(
|
|
8519
|
-
return e ? this._injector.createInstance(
|
|
8575
|
+
const e = this._univerInstanceService.getCurrentUnitForType(H.UNIVER_SHEET);
|
|
8576
|
+
return e ? this._injector.createInstance(E, e) : null;
|
|
8520
8577
|
}
|
|
8521
8578
|
getActiveUniverSheet() {
|
|
8522
8579
|
return this.getActiveWorkbook();
|
|
8523
8580
|
}
|
|
8524
8581
|
getUniverSheet(e) {
|
|
8525
|
-
const t = this._univerInstanceService.getUnit(e,
|
|
8526
|
-
return t ? this._injector.createInstance(
|
|
8582
|
+
const t = this._univerInstanceService.getUnit(e, H.UNIVER_SHEET);
|
|
8583
|
+
return t ? this._injector.createInstance(E, t) : null;
|
|
8527
8584
|
}
|
|
8528
8585
|
getWorkbook(e) {
|
|
8529
8586
|
return this.getUniverSheet(e);
|
|
@@ -8532,14 +8589,14 @@ class tr extends Rt {
|
|
|
8532
8589
|
return this._injector.createInstance(z);
|
|
8533
8590
|
}
|
|
8534
8591
|
onUniverSheetCreated(e) {
|
|
8535
|
-
const t = this._univerInstanceService.getTypeOfUnitAdded$(
|
|
8536
|
-
const n = this._injector.createInstance(
|
|
8592
|
+
const t = this._univerInstanceService.getTypeOfUnitAdded$(H.UNIVER_SHEET).subscribe((s) => {
|
|
8593
|
+
const n = this._injector.createInstance(E, s);
|
|
8537
8594
|
e(n);
|
|
8538
8595
|
});
|
|
8539
8596
|
return vt(t);
|
|
8540
8597
|
}
|
|
8541
8598
|
newDefinedName() {
|
|
8542
|
-
return this._injector.createInstance(
|
|
8599
|
+
return this._injector.createInstance(be);
|
|
8543
8600
|
}
|
|
8544
8601
|
getActiveSheet() {
|
|
8545
8602
|
const e = this.getActiveWorkbook();
|
|
@@ -8549,7 +8606,7 @@ class tr extends Rt {
|
|
|
8549
8606
|
return t ? { workbook: e, worksheet: t } : null;
|
|
8550
8607
|
}
|
|
8551
8608
|
setFreezeSync(e) {
|
|
8552
|
-
this._injector.get(
|
|
8609
|
+
this._injector.get(Rn).setEnabled(e);
|
|
8553
8610
|
}
|
|
8554
8611
|
_fireActiveSheetChanged(e, t) {
|
|
8555
8612
|
this.fireEvent(this.Event.ActiveSheetChanged, {
|
|
@@ -8592,19 +8649,19 @@ class tr extends Rt {
|
|
|
8592
8649
|
});
|
|
8593
8650
|
}
|
|
8594
8651
|
}
|
|
8595
|
-
Rt.extend(
|
|
8596
|
-
class
|
|
8652
|
+
Rt.extend(sr);
|
|
8653
|
+
class nr {
|
|
8597
8654
|
get SheetValueChangeType() {
|
|
8598
|
-
return
|
|
8655
|
+
return pn;
|
|
8599
8656
|
}
|
|
8600
8657
|
get SheetSkeletonChangeType() {
|
|
8601
|
-
return
|
|
8658
|
+
return yn;
|
|
8602
8659
|
}
|
|
8603
8660
|
get SplitDelimiterType() {
|
|
8604
|
-
return
|
|
8661
|
+
return En;
|
|
8605
8662
|
}
|
|
8606
8663
|
get UnitRole() {
|
|
8607
|
-
return
|
|
8664
|
+
return $;
|
|
8608
8665
|
}
|
|
8609
8666
|
get WorkbookPermissionPoint() {
|
|
8610
8667
|
return u;
|
|
@@ -8616,8 +8673,8 @@ class sr {
|
|
|
8616
8673
|
return b;
|
|
8617
8674
|
}
|
|
8618
8675
|
}
|
|
8619
|
-
Ht.extend(
|
|
8620
|
-
class
|
|
8676
|
+
Ht.extend(nr);
|
|
8677
|
+
class rr {
|
|
8621
8678
|
get SheetCreated() {
|
|
8622
8679
|
return "SheetCreated";
|
|
8623
8680
|
}
|
|
@@ -8679,27 +8736,27 @@ class nr {
|
|
|
8679
8736
|
return "SheetValueChanged";
|
|
8680
8737
|
}
|
|
8681
8738
|
}
|
|
8682
|
-
$t.extend(
|
|
8683
|
-
var
|
|
8684
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
8739
|
+
$t.extend(rr);
|
|
8740
|
+
var ir = Object.getOwnPropertyDescriptor, or = (r, e, t, s) => {
|
|
8741
|
+
for (var n = s > 1 ? void 0 : s ? ir(e, t) : e, i = r.length - 1, o; i >= 0; i--)
|
|
8685
8742
|
(o = r[i]) && (n = o(n) || n);
|
|
8686
8743
|
return n;
|
|
8687
|
-
},
|
|
8688
|
-
let
|
|
8744
|
+
}, ar = (r, e) => (t, s) => e(t, s, r);
|
|
8745
|
+
let kt = class extends Fe {
|
|
8689
8746
|
constructor(r) {
|
|
8690
8747
|
super(), this._injector = r;
|
|
8691
8748
|
}
|
|
8692
8749
|
};
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
],
|
|
8750
|
+
kt = or([
|
|
8751
|
+
ar(0, g(P))
|
|
8752
|
+
], kt);
|
|
8696
8753
|
export {
|
|
8697
8754
|
z as FPermission,
|
|
8698
8755
|
R as FRange,
|
|
8699
8756
|
ke as FSelection,
|
|
8700
|
-
|
|
8701
|
-
|
|
8702
|
-
|
|
8703
|
-
|
|
8757
|
+
rr as FSheetEventName,
|
|
8758
|
+
kt as FSheetHooks,
|
|
8759
|
+
nr as FSheetsEnum,
|
|
8760
|
+
E as FWorkbook,
|
|
8704
8761
|
v as FWorksheet
|
|
8705
8762
|
};
|