@univerjs/sheets 0.15.3 → 0.15.4
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 +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -0
- package/lib/es/facade.js +338 -298
- package/lib/es/index.js +7 -4
- package/lib/es/locale/sk-SK.js +17 -0
- package/lib/facade.js +338 -298
- package/lib/index.js +7 -4
- package/lib/locale/sk-SK.js +17 -0
- package/lib/types/locale/sk-SK.d.ts +3 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -0
- package/package.json +8 -8
package/lib/facade.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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 l, Injector as E, ICommandService as C, IPermissionService as Y, IAuthzIoService as re, LocaleService as bt, generateRandomId as It, 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
|
|
4
|
+
import { Inject as l, Injector as E, ICommandService as C, IPermissionService as Y, IAuthzIoService as re, LocaleService as bt, generateRandomId as It, 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
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
|
|
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
7
|
import { IDefinedNamesService as Nt, serializeRange as Ke, deserializeRangeWithSheet as Pn, serializeRangeWithSheet as En, FormulaDataModel as Un } from "@univerjs/engine-formula";
|
|
8
8
|
import { BehaviorSubject as ge, Subject as xn } from "rxjs";
|
|
9
|
-
import { filter as
|
|
10
|
-
var
|
|
11
|
-
for (var n = s > 1 ? void 0 : s ?
|
|
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);
|
|
@@ -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 = Wn(this._definedNameParam.unitId, this._localeService, this._definedNamesService)), this._commandService.syncExecuteCommand(
|
|
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.
|
|
@@ -449,7 +449,7 @@ let Se = class extends Fe {
|
|
|
449
449
|
return r.load(this._definedNameParam), r;
|
|
450
450
|
}
|
|
451
451
|
};
|
|
452
|
-
Se =
|
|
452
|
+
Se = Dn([
|
|
453
453
|
W(1, l(E)),
|
|
454
454
|
W(2, C),
|
|
455
455
|
W(3, Y),
|
|
@@ -1316,8 +1316,8 @@ const he = {
|
|
|
1316
1316
|
[_.SetCellStyle]: Ns,
|
|
1317
1317
|
[_.SetRowStyle]: js,
|
|
1318
1318
|
[_.SetColumnStyle]: Ws,
|
|
1319
|
-
[_.InsertRow]:
|
|
1320
|
-
[_.InsertColumn]:
|
|
1319
|
+
[_.InsertRow]: Ds,
|
|
1320
|
+
[_.InsertColumn]: Ms,
|
|
1321
1321
|
[_.DeleteRow]: xs,
|
|
1322
1322
|
[_.DeleteColumn]: Us,
|
|
1323
1323
|
[_.Sort]: Es,
|
|
@@ -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
|
});
|
|
@@ -3785,7 +3785,7 @@ let v = class extends He {
|
|
|
3785
3785
|
startColumn: 0,
|
|
3786
3786
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
3787
3787
|
};
|
|
3788
|
-
return n.syncExecuteCommand(
|
|
3788
|
+
return n.syncExecuteCommand(Mt.id, {
|
|
3789
3789
|
unitId: t,
|
|
3790
3790
|
subUnitId: s,
|
|
3791
3791
|
ranges: [i],
|
|
@@ -3810,7 +3810,7 @@ let v = class extends He {
|
|
|
3810
3810
|
startColumn: 0,
|
|
3811
3811
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
3812
3812
|
};
|
|
3813
|
-
return s.syncExecuteCommand(
|
|
3813
|
+
return s.syncExecuteCommand(Dt.id, {
|
|
3814
3814
|
unitId: e,
|
|
3815
3815
|
subUnitId: t,
|
|
3816
3816
|
ranges: [n]
|
|
@@ -4175,7 +4175,7 @@ let Ae = class {
|
|
|
4175
4175
|
*/
|
|
4176
4176
|
_createPermissionStream() {
|
|
4177
4177
|
const r = this._permissionService.permissionPointUpdate$.pipe(
|
|
4178
|
-
|
|
4178
|
+
M((e) => {
|
|
4179
4179
|
const t = e.id;
|
|
4180
4180
|
return t.includes(this._unitId) && t.includes(this._subUnitId);
|
|
4181
4181
|
})
|
|
@@ -4193,7 +4193,7 @@ let Ae = class {
|
|
|
4193
4193
|
*/
|
|
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
|
we((r) => (this._permissionSubject.next(this._buildSnapshot()), r.type === "delete" ? {
|
|
4198
4198
|
type: "unprotected",
|
|
4199
4199
|
ruleId: r.rule.id
|
|
@@ -6373,7 +6373,7 @@ let R = (q = class extends He {
|
|
|
6373
6373
|
* ```
|
|
6374
6374
|
*/
|
|
6375
6375
|
clear(e) {
|
|
6376
|
-
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, {
|
|
6377
6377
|
unitId: this._workbook.getUnitId(),
|
|
6378
6378
|
subUnitId: this._worksheet.getSheetId(),
|
|
6379
6379
|
ranges: [this._range],
|
|
@@ -6394,7 +6394,7 @@ let R = (q = class extends He {
|
|
|
6394
6394
|
* ```
|
|
6395
6395
|
*/
|
|
6396
6396
|
clearContent() {
|
|
6397
|
-
return this._commandService.syncExecuteCommand(
|
|
6397
|
+
return this._commandService.syncExecuteCommand(Dt.id, {
|
|
6398
6398
|
unitId: this._workbook.getUnitId(),
|
|
6399
6399
|
subUnitId: this._worksheet.getSheetId(),
|
|
6400
6400
|
ranges: [this._range]
|
|
@@ -6781,7 +6781,7 @@ let Be = class {
|
|
|
6781
6781
|
*/
|
|
6782
6782
|
_createPermissionStream() {
|
|
6783
6783
|
const r = this._permissionService.permissionPointUpdate$.pipe(
|
|
6784
|
-
|
|
6784
|
+
M((e) => e.id.includes(this._unitId))
|
|
6785
6785
|
).subscribe(() => {
|
|
6786
6786
|
this._permissionSubject.next(this._buildSnapshot());
|
|
6787
6787
|
});
|
|
@@ -6801,14 +6801,14 @@ let Be = class {
|
|
|
6801
6801
|
r.set(t, this.getPoint(t));
|
|
6802
6802
|
}
|
|
6803
6803
|
return this._permissionService.permissionPointUpdate$.pipe(
|
|
6804
|
-
|
|
6804
|
+
M((e) => e.id.includes(this._unitId)),
|
|
6805
6805
|
we((e) => {
|
|
6806
6806
|
const t = this._extractWorkbookPointType(e.id);
|
|
6807
6807
|
if (!t) return null;
|
|
6808
6808
|
const s = !!e.value, n = r.get(t);
|
|
6809
6809
|
return r.set(t, s), n === s ? null : { point: t, value: s, oldValue: n };
|
|
6810
6810
|
}),
|
|
6811
|
-
|
|
6811
|
+
M((e) => e !== null),
|
|
6812
6812
|
N({ bufferSize: 1, refCount: !0 })
|
|
6813
6813
|
);
|
|
6814
6814
|
}
|
|
@@ -7949,7 +7949,7 @@ let P = class extends He {
|
|
|
7949
7949
|
* ```
|
|
7950
7950
|
*/
|
|
7951
7951
|
insertDefinedNameBuilder(e) {
|
|
7952
|
-
e.unitId = this.getId(), this._commandService.syncExecuteCommand(
|
|
7952
|
+
e.unitId = this.getId(), this._commandService.syncExecuteCommand(De.id, e);
|
|
7953
7953
|
}
|
|
7954
7954
|
/**
|
|
7955
7955
|
* Update the defined name with the given name.
|
|
@@ -7973,7 +7973,7 @@ let P = class extends He {
|
|
|
7973
7973
|
* ```
|
|
7974
7974
|
*/
|
|
7975
7975
|
updateDefinedNameBuilder(e) {
|
|
7976
|
-
this._commandService.syncExecuteCommand(
|
|
7976
|
+
this._commandService.syncExecuteCommand(De.id, e);
|
|
7977
7977
|
}
|
|
7978
7978
|
/**
|
|
7979
7979
|
* Gets the registered range themes.
|
|
@@ -8156,7 +8156,7 @@ P = er([
|
|
|
8156
8156
|
j(1, l(E)),
|
|
8157
8157
|
j(2, l(Ft)),
|
|
8158
8158
|
j(3, l(xt)),
|
|
8159
|
-
j(4,
|
|
8159
|
+
j(4, Me),
|
|
8160
8160
|
j(5, C),
|
|
8161
8161
|
j(6, Y),
|
|
8162
8162
|
j(7, ft),
|
|
@@ -8184,29 +8184,33 @@ class tr extends Rt {
|
|
|
8184
8184
|
return { workbook: s, worksheet: n };
|
|
8185
8185
|
}
|
|
8186
8186
|
_initWorkbookEvent(e) {
|
|
8187
|
-
const t = e.get(
|
|
8188
|
-
this.
|
|
8189
|
-
this.
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
|
|
8193
|
-
unitType: s.type,
|
|
8194
|
-
snapshot: s.getSnapshot()
|
|
8195
|
-
});
|
|
8196
|
-
})
|
|
8197
|
-
), this.registerEventHandler(
|
|
8198
|
-
this.Event.WorkbookCreated,
|
|
8199
|
-
() => t.unitAdded$.subscribe((s) => {
|
|
8200
|
-
if (s.type === F.UNIVER_SHEET) {
|
|
8201
|
-
const n = s, i = e.createInstance(P, n);
|
|
8202
|
-
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, {
|
|
8203
8193
|
unitId: s.getUnitId(),
|
|
8204
|
-
|
|
8205
|
-
|
|
8206
|
-
unit: i
|
|
8194
|
+
unitType: s.type,
|
|
8195
|
+
snapshot: s.getSnapshot()
|
|
8207
8196
|
});
|
|
8208
|
-
}
|
|
8209
|
-
|
|
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
|
+
)
|
|
8210
8214
|
);
|
|
8211
8215
|
}
|
|
8212
8216
|
/**
|
|
@@ -8215,260 +8219,296 @@ class tr extends Rt {
|
|
|
8215
8219
|
// eslint-disable-next-line max-lines-per-function
|
|
8216
8220
|
_initialize(e) {
|
|
8217
8221
|
const t = e.get(C);
|
|
8218
|
-
this.
|
|
8219
|
-
this.
|
|
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
|
-
|
|
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
|
-
if (
|
|
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
|
-
|
|
8347
|
-
|
|
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
|
-
), this.
|
|
8379
|
-
this.
|
|
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
|
-
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
|
|
8440
|
-
|
|
8441
|
-
|
|
8442
|
-
|
|
8443
|
-
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
if (
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
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
|
+
)
|
|
8468
8508
|
), this._initWorkbookEvent(e);
|
|
8469
8509
|
}
|
|
8470
8510
|
createUniverSheet(e, t) {
|
|
8471
|
-
const n = this._injector.get(
|
|
8511
|
+
const n = this._injector.get(Me).createUnit(F.UNIVER_SHEET, e, t);
|
|
8472
8512
|
return this._injector.createInstance(P, n);
|
|
8473
8513
|
}
|
|
8474
8514
|
createWorkbook(e, t) {
|