@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/es/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 De, CanceledError as M } from "@univerjs/core";
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 Me, 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 Ds, WorksheetInsertRowPermission as Ms, 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 Dt, ClearSelectionContentCommand as Mt, 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";
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 D, distinctUntilChanged as _e, shareReplay as N, map as we } from "rxjs/operators";
10
- var Dn = Object.getOwnPropertyDescriptor, Mn = (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--)
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(Me.id, this._definedNameParam);
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 = Mn([
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]: Ms,
1320
- [_.InsertColumn]: Ds,
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
- D((e) => e.id.includes(this._unitId) && e.id.includes(this._subUnitId))
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
- D((r) => r.id.includes(this._unitId) && r.id.includes(this._subUnitId)),
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
- D((r) => r !== null),
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
- D((r) => r.unitId === this._unitId && r.subUnitId === this._subUnitId),
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
- D((e) => e.unitId === this._unitId && e.subUnitId === this._subUnitId)
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(Dt.id, {
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(Mt.id, {
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
- D((e) => {
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
- D((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),
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(Dt.id, {
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(Mt.id, {
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
- D((e) => e.id.includes(this._unitId))
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
- D((e) => e.id.includes(this._unitId)),
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
- D((e) => e !== null),
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(Me.id, e);
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(Me.id, e);
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, De),
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(De);
8188
- this.registerEventHandler(
8189
- this.Event.WorkbookDisposed,
8190
- () => t.unitDisposed$.subscribe((s) => {
8191
- s.type === F.UNIVER_SHEET && this.fireEvent(this.Event.WorkbookDisposed, {
8192
- unitId: s.getUnitId(),
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
- type: s.type,
8205
- workbook: i,
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.registerEventHandler(
8219
- this.Event.BeforeSheetCreate,
8220
- () => t.beforeCommandExecuted((s) => {
8221
- var n;
8222
- if (s.id === me.id) {
8223
- 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);
8224
- if (!c)
8225
- return;
8226
- const d = {
8227
- workbook: c,
8228
- index: a,
8229
- sheet: h
8230
- };
8231
- if (this.fireEvent(this.Event.BeforeSheetCreate, d), d.cancel)
8232
- throw new M();
8233
- }
8234
- })
8235
- ), this.registerEventHandler(
8236
- this.Event.BeforeActiveSheetChange,
8237
- () => t.beforeCommandExecuted((s) => {
8238
- var n;
8239
- if (s.id === te.id) {
8240
- const { subUnitId: i, unitId: o } = s.params, a = o ? this.getUniverSheet(o) : (n = this.getActiveWorkbook) == null ? void 0 : n.call(this);
8241
- if (!a || !i) return;
8242
- const h = a.getSheetBySheetId(i), c = a.getActiveSheet();
8243
- if (!h || !c) return;
8244
- const d = {
8245
- workbook: a,
8246
- activeSheet: h,
8247
- oldActiveSheet: c
8248
- };
8249
- if (this.fireEvent(this.Event.BeforeActiveSheetChange, d), d.cancel)
8250
- throw new M();
8251
- }
8252
- })
8253
- ), this.registerEventHandler(
8254
- this.Event.BeforeSheetDelete,
8255
- () => t.beforeCommandExecuted((s) => {
8256
- if (s.id === Te.id) {
8257
- const n = this.getCommandSheetTarget(s);
8258
- if (!n) return;
8259
- const { workbook: i, worksheet: o } = n, a = {
8260
- workbook: i,
8261
- worksheet: o
8262
- };
8263
- if (this.fireEvent(this.Event.BeforeSheetDelete, a), a.cancel)
8264
- throw new M();
8265
- }
8266
- })
8267
- ), this.registerEventHandler(
8268
- this.Event.BeforeSheetMove,
8269
- () => t.beforeCommandExecuted((s) => {
8270
- if (s.id === gt.id) {
8271
- const { fromOrder: n, toOrder: i } = s.params, o = this.getCommandSheetTarget(s);
8272
- if (!o) return;
8273
- const a = {
8274
- workbook: o.workbook,
8275
- worksheet: o.worksheet,
8276
- newIndex: i,
8277
- oldIndex: n
8278
- };
8279
- if (this.fireEvent(this.Event.BeforeSheetMove, a), a.cancel)
8280
- throw new M();
8281
- }
8282
- })
8283
- ), this.registerEventHandler(
8284
- this.Event.BeforeSheetNameChange,
8285
- () => t.beforeCommandExecuted((s) => {
8286
- if (s.id === Oe.id) {
8287
- const { name: n } = s.params, i = this.getCommandSheetTarget(s);
8288
- if (!i) return;
8289
- const o = {
8290
- workbook: i.workbook,
8291
- worksheet: i.worksheet,
8292
- newName: n,
8293
- oldName: i.worksheet.getSheetName()
8294
- };
8295
- if (this.fireEvent(this.Event.BeforeSheetNameChange, o), o.cancel)
8296
- throw new M();
8297
- }
8298
- })
8299
- ), this.registerEventHandler(
8300
- this.Event.BeforeSheetTabColorChange,
8301
- () => t.beforeCommandExecuted((s) => {
8302
- if (s.id === _t.id) {
8303
- const { color: n } = s.params, i = this.getCommandSheetTarget(s);
8304
- if (!i) return;
8305
- const o = {
8306
- workbook: i.workbook,
8307
- worksheet: i.worksheet,
8308
- newColor: n,
8309
- oldColor: i.worksheet.getTabColor()
8310
- };
8311
- if (this.fireEvent(this.Event.BeforeSheetTabColorChange, o), o.cancel)
8312
- throw new M();
8313
- }
8314
- })
8315
- ), this.registerEventHandler(
8316
- this.Event.BeforeSheetHideChange,
8317
- () => t.beforeCommandExecuted((s) => {
8318
- if (s.id === wt.id) {
8319
- const { hidden: n } = s.params, i = this.getCommandSheetTarget(s);
8320
- if (!i) return;
8321
- const o = {
8322
- workbook: i.workbook,
8323
- worksheet: i.worksheet,
8324
- hidden: !!n
8325
- };
8326
- if (this.fireEvent(this.Event.BeforeSheetHideChange, o), o.cancel)
8327
- throw new M();
8328
- }
8329
- })
8330
- ), this.registerEventHandler(
8331
- this.Event.BeforeGridlineColorChange,
8332
- () => t.beforeCommandExecuted((s) => {
8333
- var n;
8334
- if (s.id === Ne.id) {
8335
- const i = this.getCommandSheetTarget(s);
8336
- if (!i) return;
8337
- const o = {
8338
- ...i,
8339
- color: (n = s.params) == null ? void 0 : n.color
8340
- };
8341
- if (this.fireEvent(this.Event.BeforeGridlineColorChange, o), o.cancel)
8342
- throw new M();
8343
- }
8344
- })
8345
- ), this.registerEventHandler(
8346
- this.Event.BeforeGridlineEnableChange,
8347
- () => t.beforeCommandExecuted((s) => {
8348
- var n;
8349
- if (s.id === je.id) {
8350
- const i = this.getCommandSheetTarget(s);
8351
- if (!i) return;
8352
- const o = {
8353
- ...i,
8354
- enabled: !!((n = s.params) != null && n.showGridlines)
8355
- };
8356
- if (this.fireEvent(this.Event.BeforeGridlineEnableChange, o), o.cancel)
8357
- throw new M();
8358
- }
8359
- })
8360
- ), this.registerEventHandler(
8361
- this.Event.SheetValueChanged,
8362
- () => t.onCommandExecuted((s) => {
8363
- if (In.indexOf(s.id) > -1) {
8364
- if (!this.getActiveSheet()) return;
8365
- const i = fn(s).map(
8366
- (o) => {
8367
- var a, h;
8368
- return (h = (a = this.getWorkbook(o.unitId)) == null ? void 0 : a.getSheetBySheetId(o.subUnitId)) == null ? void 0 : h.getRange(o.range);
8369
- }
8370
- ).filter(Boolean);
8371
- if (!i.length) return;
8372
- this.fireEvent(this.Event.SheetValueChanged, {
8373
- payload: s,
8374
- effectedRanges: i
8375
- });
8376
- }
8377
- })
8378
- ), this.registerEventHandler(
8379
- this.Event.SheetCreated,
8380
- () => t.onCommandExecuted((s) => {
8381
- var n;
8382
- if (s.id === me.id) {
8383
- const i = s.params, { unitId: o } = i || {}, a = o ? this.getUniverSheet(o) : (n = this.getActiveWorkbook) == null ? void 0 : n.call(this);
8384
- if (!a)
8385
- return;
8386
- const h = a.getActiveSheet();
8387
- if (!h)
8388
- return;
8389
- const c = {
8390
- workbook: a,
8391
- worksheet: h
8392
- };
8393
- this.fireEvent(
8394
- this.Event.SheetCreated,
8395
- c
8396
- );
8397
- }
8398
- })
8399
- ), this.registerEventHandler(
8400
- this.Event.ActiveSheetChanged,
8401
- () => t.onCommandExecuted((s) => {
8402
- if (s.id === te.id) {
8403
- const n = this.getActiveSheet();
8404
- if (!n) return;
8405
- const { workbook: i, worksheet: o } = n;
8406
- this._fireActiveSheetChanged(i, o);
8407
- }
8408
- })
8409
- ), this.registerEventHandler(
8410
- this.Event.SheetDeleted,
8411
- () => t.onCommandExecuted((s) => {
8412
- var n;
8413
- if (s.id === Te.id) {
8414
- const { subUnitId: i, unitId: o } = s.params, a = o ? this.getUniverSheet(o) : (n = this.getActiveWorkbook) == null ? void 0 : n.call(this);
8415
- if (!a || !i) return;
8416
- this._fireSheetDeleted(a, i);
8417
- }
8418
- })
8419
- ), this.registerEventHandler(
8420
- this.Event.SheetMoved,
8421
- () => t.onCommandExecuted((s) => {
8422
- if (s.id === gt.id) {
8423
- const { toOrder: n } = s.params, i = this.getCommandSheetTarget(s);
8424
- if (!i) return;
8425
- this._fireSheetMoved(i.workbook, i.worksheet, n);
8426
- }
8427
- })
8428
- ), this.registerEventHandler(
8429
- this.Event.SheetNameChanged,
8430
- () => t.onCommandExecuted((s) => {
8431
- if (s.id === Oe.id) {
8432
- const { name: n } = s.params, i = this.getCommandSheetTarget(s);
8433
- if (!i) return;
8434
- this._fireSheetNameChanged(i.workbook, i.worksheet, n);
8435
- }
8436
- })
8437
- ), this.registerEventHandler(
8438
- this.Event.SheetTabColorChanged,
8439
- () => t.onCommandExecuted((s) => {
8440
- if (s.id === _t.id) {
8441
- const { color: n } = s.params, i = this.getCommandSheetTarget(s);
8442
- if (!i) return;
8443
- this._fireSheetTabColorChanged(i.workbook, i.worksheet, n);
8444
- }
8445
- })
8446
- ), this.registerEventHandler(
8447
- this.Event.SheetHideChanged,
8448
- () => t.onCommandExecuted((s) => {
8449
- if (s.id === wt.id) {
8450
- const { hidden: n } = s.params, i = this.getCommandSheetTarget(s);
8451
- if (!i) return;
8452
- this._fireSheetHideChanged(i.workbook, i.worksheet, !!n);
8453
- }
8454
- })
8455
- ), this.registerEventHandler(
8456
- this.Event.GridlineChanged,
8457
- () => t.onCommandExecuted((s) => {
8458
- if (s.id === Ne.id || s.id === je.id) {
8459
- const n = this.getCommandSheetTarget(s);
8460
- if (!n) return;
8461
- this.fireEvent(this.Event.GridlineChanged, {
8462
- ...n,
8463
- enabled: !n.worksheet.hasHiddenGridLines(),
8464
- color: n.worksheet.getGridLinesColor()
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(De).createUnit(F.UNIVER_SHEET, e, t);
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) {