@univerjs/sheets-ui 0.6.0-experimental.20250125-1d060b9 → 0.6.0-experimental.20250220-d9a8e74

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.
Files changed (85) hide show
  1. package/lib/cjs/facade.js +1 -1
  2. package/lib/cjs/index.js +54 -52
  3. package/lib/es/facade.js +656 -563
  4. package/lib/es/index.js +8672 -8437
  5. package/lib/index.css +1 -1
  6. package/lib/types/common/keys.d.ts +1 -1
  7. package/lib/types/components/border-panel/border-line/icons/BorderDashDot.d.ts +1 -1
  8. package/lib/types/components/border-panel/border-line/icons/BorderDashDotDot.d.ts +1 -1
  9. package/lib/types/components/border-panel/border-line/icons/BorderDashed.d.ts +1 -1
  10. package/lib/types/components/border-panel/border-line/icons/BorderDotted.d.ts +1 -1
  11. package/lib/types/components/border-panel/border-line/icons/BorderHair.d.ts +1 -1
  12. package/lib/types/components/border-panel/border-line/icons/BorderMedium.d.ts +1 -1
  13. package/lib/types/components/border-panel/border-line/icons/BorderMediumDashDot.d.ts +1 -1
  14. package/lib/types/components/border-panel/border-line/icons/BorderMediumDashDotDot.d.ts +1 -1
  15. package/lib/types/components/border-panel/border-line/icons/BorderMediumDashed.d.ts +1 -1
  16. package/lib/types/components/border-panel/border-line/icons/BorderThick.d.ts +1 -1
  17. package/lib/types/components/border-panel/border-line/icons/BorderThin.d.ts +1 -1
  18. package/lib/types/components/color-picker/index.d.ts +1 -1
  19. package/lib/types/components/color-picker/interface.d.ts +1 -1
  20. package/lib/types/components/const.d.ts +1 -1
  21. package/lib/types/components/font-family/index.d.ts +1 -1
  22. package/lib/types/components/font-family/interface.d.ts +1 -1
  23. package/lib/types/components/font-size/index.d.ts +1 -1
  24. package/lib/types/components/font-size/interface.d.ts +1 -1
  25. package/lib/types/components/menu-item-input/index.d.ts +1 -1
  26. package/lib/types/consts/plugin-name.d.ts +1 -1
  27. package/lib/types/consts/ui-name.d.ts +1 -1
  28. package/lib/types/controllers/auto-fill.controller.d.ts +1 -1
  29. package/lib/types/controllers/clipboard/clipboard.controller.d.ts +3 -0
  30. package/lib/types/controllers/clipboard/const.d.ts +1 -1
  31. package/lib/types/controllers/editor/utils/{isEmbeddingFormulaEditor.d.ts → is-embedding-formula-editor.d.ts} +1 -1
  32. package/lib/types/controllers/editor/utils/{isRangeSelector.d.ts → is-range-selector.d.ts} +1 -1
  33. package/lib/types/controllers/format-painter/format-painter.controller.d.ts +0 -1
  34. package/lib/types/controllers/permission/sheet-permission-init-ui.controller.d.ts +7 -0
  35. package/lib/types/controllers/render-controllers/clipboard.render-controller.d.ts +13 -0
  36. package/lib/types/controllers/render-controllers/format-painter.render-controller.d.ts +6 -2
  37. package/lib/types/controllers/render-controllers/scroll.render-controller.d.ts +1 -0
  38. package/lib/types/controllers/render-controllers/skeleton.render-controller.d.ts +4 -2
  39. package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +1 -1
  40. package/lib/types/controllers/utils/cell-tools.d.ts +1 -1
  41. package/lib/types/facade/f-event.d.ts +6 -3
  42. package/lib/types/facade/f-univer.d.ts +4 -6
  43. package/lib/types/facade/index.d.ts +1 -1
  44. package/lib/types/index.d.ts +8 -7
  45. package/lib/types/locale/zh-CN.d.ts +1 -1
  46. package/lib/types/services/clipboard/clipboard.service.d.ts +4 -0
  47. package/lib/types/services/clipboard/utils.d.ts +1 -0
  48. package/lib/types/services/editor-bridge.service.d.ts +5 -0
  49. package/lib/types/services/scroll-manager.service.d.ts +17 -12
  50. package/lib/types/services/sheet-skeleton-manager.service.d.ts +39 -16
  51. package/lib/types/services/sheets-render.service.d.ts +1 -1
  52. package/lib/types/views/cell-alert/index.d.ts +1 -1
  53. package/lib/types/views/clipboard/ClipboardPopupMenu.d.ts +1 -1
  54. package/lib/types/views/count-bar/CountBar.d.ts +1 -1
  55. package/lib/types/views/count-bar/ZoomSlider.d.ts +1 -1
  56. package/lib/types/views/count-bar/index.d.ts +1 -1
  57. package/lib/types/views/defined-name/DefinedName.d.ts +1 -1
  58. package/lib/types/views/defined-name/DefinedNameContainer.d.ts +1 -1
  59. package/lib/types/views/defined-name/DefinedNameOverlay.d.ts +1 -1
  60. package/lib/types/views/defined-name/component-name.d.ts +1 -1
  61. package/lib/types/views/editor-container/index.d.ts +1 -1
  62. package/lib/types/views/formula-bar/FormulaBar.d.ts +6 -2
  63. package/lib/types/views/formula-bar/index.d.ts +1 -1
  64. package/lib/types/views/mobile/sheet-bar/MobileSheetBar.d.ts +1 -1
  65. package/lib/types/views/operate-container/index.d.ts +1 -1
  66. package/lib/types/views/permission/error-msg-dialog/index.d.ts +1 -1
  67. package/lib/types/views/permission/error-msg-dialog/interface.d.ts +1 -1
  68. package/lib/types/views/permission/extensions/protect-background-img.d.ts +1 -1
  69. package/lib/types/views/permission/index.d.ts +1 -1
  70. package/lib/types/views/permission/panel-list/constant.d.ts +1 -1
  71. package/lib/types/views/permission/panel-list/index.d.ts +1 -1
  72. package/lib/types/views/permission/permission-dialog/index.d.ts +1 -1
  73. package/lib/types/views/permission/user-dialog/constant.d.ts +1 -1
  74. package/lib/types/views/permission/user-dialog/index.d.ts +1 -1
  75. package/lib/types/views/sheet-bar/SheetBar.d.ts +1 -1
  76. package/lib/types/views/sheet-bar/sheet-bar-tabs/SheetBarTabs.d.ts +1 -1
  77. package/lib/types/views/sheet-bar/sheet-bar-tabs/utils/animate.d.ts +1 -1
  78. package/lib/types/views/sheet-bar/sheet-bar-tabs/utils/slide-tab-bar.d.ts +2 -2
  79. package/lib/types/views/sheet-container/SheetContainer.d.ts +1 -1
  80. package/lib/types/views/status-bar/CopyableStatisticItem.d.ts +1 -1
  81. package/lib/types/views/status-bar/StatusBar.d.ts +1 -1
  82. package/lib/umd/facade.js +1 -1
  83. package/lib/umd/index.js +47 -45
  84. package/package.json +17 -17
  85. /package/lib/types/hooks/{useHighlightRange.d.ts → use-highlight-range.d.ts} +0 -0
package/lib/es/facade.js CHANGED
@@ -1,353 +1,424 @@
1
- import { FUniver as ue, ICommandService as P, IUniverInstanceService as L, CanceledError as G, RichTextValue as q, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as A, LifecycleService as Q, DisposableCollection as $, LifecycleStages as ee, UniverInstanceType as pe, ILogService as D, toDisposable as b, awaitTime as Ee, InterceptorEffectEnum as we, FEventName as ve, generateRandomId as _e } from "@univerjs/core";
2
- import { RichTextEditingMutation as ke } from "@univerjs/docs";
3
- import { IRenderManagerService as m, DeviceInputEventType as te, SHEET_VIEWPORT_KEY as Ie, sheetContentViewportKeys as Pe } from "@univerjs/engine-render";
4
- import { SheetsSelectionsService as Re, COMMAND_LISTENER_SKELETON_CHANGE as Me, getSkeletonChangedEffectedRange as ye, SheetInterceptorService as Ue, INTERCEPTOR_POINT as He, InterceptCellContentPriority as xe } from "@univerjs/sheets";
5
- import { SetCellEditVisibleOperation as M, IEditorBridgeService as W, SetZoomRatioCommand as re, HoverManagerService as _, DragManagerService as H, SheetScrollManagerService as B, SheetPasteShortKeyCommand as ne, ISheetClipboardService as Se, SheetSkeletonManagerService as R, SHEET_VIEW_KEY as k, ISheetSelectionRenderService as x, ChangeZoomRatioCommand as De, SheetsScrollRenderController as Be, SetWorksheetColAutoWidthCommand as Te, SetColumnHeaderHeightCommand as Le, SetRowHeaderWidthCommand as Ae, SheetCanvasPopManagerService as ie, CellAlertManagerService as We, IMarkSelectionService as $e } from "@univerjs/sheets-ui";
6
- import { FSheetHooks as j, FWorkbook as Ce, FWorksheet as me, FPermission as be, FRange as fe } from "@univerjs/sheets/facade";
7
- import { KeyCode as T, CutCommand as oe, CopyCommand as se, PasteCommand as ae, IClipboardInterfaceService as je, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as ce, HTML_CLIPBOARD_MIME_TYPE as de, supportClipboardAPI as he, ISidebarService as Oe, IDialogService as Fe, ComponentManager as le } from "@univerjs/ui";
8
- import { filter as S, combineLatest as Ne } from "rxjs";
9
- class ze extends ue {
1
+ import { ICommandService as P, CanceledError as j, IUniverInstanceService as A, RichTextValue as O, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as W, LifecycleService as L, DisposableCollection as y, LifecycleStages as F, UniverInstanceType as ae, ILogService as D, toDisposable as b, awaitTime as ce, InterceptorEffectEnum as de, generateRandomId as he } from "@univerjs/core";
2
+ import { FUniver as te, FEventName as le } from "@univerjs/core/facade";
3
+ import { RichTextEditingMutation as ge } from "@univerjs/docs";
4
+ import { IRenderManagerService as m, DeviceInputEventType as N, SHEET_VIEWPORT_KEY as ue, sheetContentViewportKeys as ve } from "@univerjs/engine-render";
5
+ import { SheetsSelectionsService as Se, COMMAND_LISTENER_SKELETON_CHANGE as Ce, getSkeletonChangedEffectedRange as me, SheetInterceptorService as be, INTERCEPTOR_POINT as Ee, InterceptCellContentPriority as pe } from "@univerjs/sheets";
6
+ import { SetCellEditVisibleOperation as k, IEditorBridgeService as H, SetZoomRatioCommand as z, HoverManagerService as f, DragManagerService as U, SheetScrollManagerService as T, SheetPasteShortKeyCommand as V, ISheetClipboardService as re, SheetSkeletonManagerService as R, SHEET_VIEW_KEY as w, ISheetSelectionRenderService as x, ChangeZoomRatioCommand as fe, SheetsScrollRenderController as we, SetWorksheetColAutoWidthCommand as ke, SetColumnHeaderHeightCommand as Ie, SetRowHeaderWidthCommand as _e, SheetCanvasPopManagerService as Z, CellAlertManagerService as Pe, IMarkSelectionService as Re } from "@univerjs/sheets-ui";
7
+ import { FSheetHooks as $, FWorkbook as ne, FWorksheet as ie, FPermission as oe, FRange as se } from "@univerjs/sheets/facade";
8
+ import { KeyCode as B, CutCommand as K, CopyCommand as Y, PasteCommand as X, IClipboardInterfaceService as He, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as J, HTML_CLIPBOARD_MIME_TYPE as G, supportClipboardAPI as q, ISidebarService as Me, IDialogService as ye, ComponentManager as Q } from "@univerjs/ui";
9
+ import { filter as S, combineLatest as Ue } from "rxjs";
10
+ class xe extends te {
10
11
  // eslint-disable-next-line max-lines-per-function
11
12
  _initSheetUIEvent(e) {
12
- const t = e.get(P);
13
- this.disposeWithMe(t.beforeCommandExecuted((r) => {
14
- if (r.id === M.id) {
15
- if (!this._eventListend(this.Event.BeforeSheetEditStart) && !this._eventListend(this.Event.BeforeSheetEditEnd))
16
- return;
17
- const i = this.getActiveSheet();
18
- if (!i)
19
- return;
20
- const { workbook: o, worksheet: s } = i, a = e.get(W), g = e.get(L), v = r.params, { visible: l, keycode: h, eventType: C } = v, d = a.getEditLocation();
21
- if (l) {
22
- const p = {
23
- row: d.row,
24
- column: d.column,
13
+ const r = e.get(P);
14
+ this.registerEventHandler(
15
+ this.Event.BeforeSheetEditStart,
16
+ () => r.beforeCommandExecuted((t) => {
17
+ if (t.id !== k.id) return;
18
+ const n = this.getActiveSheet();
19
+ if (!n) return;
20
+ const { workbook: o, worksheet: s } = n, c = e.get(H), g = t.params, { visible: u, keycode: l, eventType: C } = g, v = c.getEditLocation();
21
+ if (u) {
22
+ const h = {
23
+ row: v.row,
24
+ column: v.column,
25
25
  eventType: C,
26
- keycode: h,
26
+ keycode: l,
27
27
  workbook: o,
28
28
  worksheet: s,
29
29
  isZenEditor: !1
30
30
  };
31
- if (this.fireEvent(this.Event.BeforeSheetEditStart, p), p.cancel)
32
- throw new G();
33
- } else {
34
- const p = {
35
- row: d.row,
36
- column: d.column,
37
- eventType: C,
38
- keycode: h,
31
+ if (this.fireEvent(this.Event.BeforeSheetEditStart, h), h.cancel)
32
+ throw new j();
33
+ }
34
+ })
35
+ ), this.registerEventHandler(
36
+ this.Event.BeforeSheetEditEnd,
37
+ () => r.beforeCommandExecuted((t) => {
38
+ if (t.id !== k.id) return;
39
+ const n = this.getActiveSheet();
40
+ if (!n) return;
41
+ const { workbook: o, worksheet: s } = n, c = e.get(H), g = e.get(A), u = t.params, { visible: l, keycode: C, eventType: v } = u, h = c.getEditLocation();
42
+ if (!l) {
43
+ const I = {
44
+ row: h.row,
45
+ column: h.column,
46
+ eventType: v,
47
+ keycode: C,
39
48
  workbook: o,
40
49
  worksheet: s,
41
50
  isZenEditor: !1,
42
- value: q.create(g.getUnit(A).getSnapshot()),
43
- isConfirm: h !== T.ESC
51
+ value: O.create(g.getUnit(W).getSnapshot()),
52
+ isConfirm: C !== B.ESC
44
53
  };
45
- if (this.fireEvent(this.Event.BeforeSheetEditEnd, p), p.cancel)
46
- throw new G();
54
+ if (this.fireEvent(this.Event.BeforeSheetEditEnd, I), I.cancel)
55
+ throw new j();
47
56
  }
48
- }
49
- if (r.id === re.id) {
50
- if (!this._eventListend(this.Event.BeforeSheetZoomChange))
51
- return;
52
- const i = this.getCommandSheetTarget(r);
53
- if (!i)
54
- return;
55
- const { workbook: o, worksheet: s } = i;
56
- this.fireEvent(this.Event.BeforeSheetZoomChange, {
57
- zoom: r.params.zoomRatio,
58
- workbook: o,
59
- worksheet: s
60
- });
61
- }
62
- })), this.disposeWithMe(t.onCommandExecuted((r) => {
63
- if (r.id === M.id) {
64
- if (!this._eventListend(this.Event.SheetEditStarted) && !this._eventListend(this.Event.SheetEditEnded))
65
- return;
66
- const i = this.getCommandSheetTarget(r);
67
- if (!i)
68
- return;
69
- const { workbook: o, worksheet: s } = i, a = e.get(W), g = r.params, { visible: v, keycode: l, eventType: h } = g, C = a.getEditLocation();
70
- if (v) {
71
- const d = {
72
- row: C.row,
73
- column: C.column,
74
- eventType: h,
57
+ })
58
+ ), this.registerEventHandler(
59
+ this.Event.SheetEditStarted,
60
+ () => r.onCommandExecuted((t) => {
61
+ if (t.id !== k.id) return;
62
+ const n = this.getCommandSheetTarget(t);
63
+ if (!n) return;
64
+ const { workbook: o, worksheet: s } = n, c = e.get(H), g = t.params, { visible: u, keycode: l, eventType: C } = g, v = c.getEditLocation();
65
+ if (u) {
66
+ const h = {
67
+ row: v.row,
68
+ column: v.column,
69
+ eventType: C,
75
70
  keycode: l,
76
71
  workbook: o,
77
72
  worksheet: s,
78
73
  isZenEditor: !1
79
74
  };
80
- this.fireEvent(this.Event.SheetEditStarted, d);
81
- } else {
82
- const d = {
83
- row: C.row,
84
- column: C.column,
85
- eventType: h,
75
+ this.fireEvent(this.Event.SheetEditStarted, h);
76
+ }
77
+ })
78
+ ), this.registerEventHandler(
79
+ this.Event.SheetEditEnded,
80
+ () => r.onCommandExecuted((t) => {
81
+ if (t.id !== k.id) return;
82
+ const n = this.getCommandSheetTarget(t);
83
+ if (!n) return;
84
+ const { workbook: o, worksheet: s } = n, c = e.get(H), g = t.params, { visible: u, keycode: l, eventType: C } = g, v = c.getEditLocation();
85
+ if (!u) {
86
+ const h = {
87
+ row: v.row,
88
+ column: v.column,
89
+ eventType: C,
86
90
  keycode: l,
87
91
  workbook: o,
88
92
  worksheet: s,
89
93
  isZenEditor: !1,
90
- isConfirm: l !== T.ESC
94
+ isConfirm: l !== B.ESC
91
95
  };
92
- this.fireEvent(this.Event.SheetEditEnded, d);
96
+ this.fireEvent(this.Event.SheetEditEnded, h);
93
97
  }
94
- }
95
- if (r.id === ke.id) {
96
- if (!this._eventListend(this.Event.SheetEditChanging))
97
- return;
98
- const i = this.getCommandSheetTarget(r);
99
- if (!i)
100
- return;
101
- const { workbook: o, worksheet: s } = i, a = e.get(W), g = e.get(L), v = r.params;
102
- if (!a.isVisible().visible) return;
103
- const { unitId: l } = v;
104
- if (l === A) {
105
- const { row: h, column: C } = a.getEditLocation(), d = {
98
+ })
99
+ ), this.registerEventHandler(
100
+ this.Event.SheetEditChanging,
101
+ () => r.onCommandExecuted((t) => {
102
+ if (t.id !== ge.id) return;
103
+ const n = this.getActiveSheet();
104
+ if (!n) return;
105
+ const { workbook: o, worksheet: s } = n, c = e.get(H), g = e.get(A), u = t.params;
106
+ if (!c.isVisible().visible) return;
107
+ const { unitId: l } = u;
108
+ if (l === W) {
109
+ const { row: C, column: v } = c.getEditLocation(), h = {
106
110
  workbook: o,
107
111
  worksheet: s,
108
- row: h,
109
- column: C,
110
- value: q.create(g.getUnit(A).getSnapshot()),
112
+ row: C,
113
+ column: v,
114
+ value: O.create(g.getUnit(W).getSnapshot()),
111
115
  isZenEditor: !1
112
116
  };
113
- this.fireEvent(this.Event.SheetEditChanging, d);
117
+ this.fireEvent(this.Event.SheetEditChanging, h);
114
118
  }
115
- }
116
- if (r.id === re.id) {
117
- if (!this._eventListend(this.Event.SheetZoomChanged))
118
- return;
119
- const i = this.getCommandSheetTarget(r);
120
- if (!i)
121
- return;
122
- const { workbook: o, worksheet: s } = i;
119
+ })
120
+ ), this.registerEventHandler(
121
+ this.Event.BeforeSheetZoomChange,
122
+ () => r.beforeCommandExecuted((t) => {
123
+ if (t.id !== z.id) return;
124
+ const n = this.getCommandSheetTarget(t);
125
+ if (!n) return;
126
+ const { workbook: o, worksheet: s } = n;
127
+ this.fireEvent(this.Event.BeforeSheetZoomChange, {
128
+ zoom: t.params.zoomRatio,
129
+ workbook: o,
130
+ worksheet: s
131
+ });
132
+ })
133
+ ), this.registerEventHandler(
134
+ this.Event.SheetZoomChanged,
135
+ () => r.onCommandExecuted((t) => {
136
+ if (t.id !== z.id) return;
137
+ const n = this.getCommandSheetTarget(t);
138
+ if (!n) return;
139
+ const { workbook: o, worksheet: s } = n;
123
140
  this.fireEvent(this.Event.SheetZoomChanged, {
124
141
  zoom: s.getZoom(),
125
142
  workbook: o,
126
143
  worksheet: s
127
144
  });
128
- }
129
- })), this._initObserverListener(e);
145
+ })
146
+ );
130
147
  }
131
- /**
132
- * @ignore
133
- */
134
148
  // eslint-disable-next-line max-lines-per-function
135
149
  _initObserverListener(e) {
136
- const r = e.get(L).getFocusedUnit(), i = r == null ? void 0 : r.getUnitId(), o = e.get(m);
137
- if (i) {
138
- const l = e.get(Q), h = new $();
139
- this.disposeWithMe(l.lifecycle$.subscribe((C) => {
140
- var I, y, u, f, E, O, F, N, z, V, Z, K, Y, X, J;
141
- if (C < ee.Rendered) return;
142
- h.dispose();
143
- const d = e.get(_), p = e.get(H);
144
- d && (h.add(
145
- (I = d.currentClickedCell$) == null ? void 0 : I.pipe(S((n) => !!n)).subscribe((n) => {
146
- if (!this._eventListend(this.Event.CellClicked)) return;
147
- const c = this.getSheetTarget(n.location.unitId, n.location.subUnitId);
148
- c && this.fireEvent(this.Event.CellClicked, {
149
- ...c,
150
- ...n,
151
- row: n.location.row,
152
- column: n.location.col
150
+ const t = e.get(A).getFocusedUnit(), n = t == null ? void 0 : t.getUnitId(), o = e.get(m);
151
+ if (n) {
152
+ const l = e.get(L), C = new y();
153
+ this.disposeWithMe(l.lifecycle$.subscribe((v) => {
154
+ if (v < F.Rendered) return;
155
+ C.dispose();
156
+ const h = e.get(f), I = e.get(U);
157
+ h && (this.registerEventHandler(
158
+ this.Event.CellClicked,
159
+ () => {
160
+ var d;
161
+ return (d = h.currentClickedCell$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
162
+ const a = this.getSheetTarget(i.location.unitId, i.location.subUnitId);
163
+ a && this.fireEvent(this.Event.CellClicked, {
164
+ ...a,
165
+ ...i,
166
+ row: i.location.row,
167
+ column: i.location.col
168
+ });
153
169
  });
154
- })
155
- ), h.add(
156
- (y = d.currentRichText$) == null ? void 0 : y.pipe(S((n) => !!n)).subscribe((n) => {
157
- if (!this._eventListend(this.Event.CellHover)) return;
158
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
159
- c && this.fireEvent(this.Event.CellHover, {
160
- ...c,
161
- ...n,
162
- row: n.row,
163
- column: n.col
170
+ }
171
+ ), this.registerEventHandler(
172
+ this.Event.CellHover,
173
+ () => {
174
+ var d;
175
+ return (d = h.currentRichText$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
176
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
177
+ a && this.fireEvent(this.Event.CellHover, {
178
+ ...a,
179
+ ...i,
180
+ row: i.row,
181
+ column: i.col
182
+ });
164
183
  });
165
- })
166
- ), h.add(
167
- (u = d.currentPointerDownCell$) == null ? void 0 : u.pipe(S((n) => !!n)).subscribe((n) => {
168
- if (!this._eventListend(this.Event.CellPointerDown)) return;
169
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
170
- c && this.fireEvent(this.Event.CellPointerDown, {
171
- ...c,
172
- ...n,
173
- row: n.row,
174
- column: n.col
184
+ }
185
+ ), this.registerEventHandler(
186
+ this.Event.CellPointerDown,
187
+ () => {
188
+ var d;
189
+ return (d = h.currentPointerDownCell$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
190
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
191
+ a && this.fireEvent(this.Event.CellPointerDown, {
192
+ ...a,
193
+ ...i,
194
+ row: i.row,
195
+ column: i.col
196
+ });
175
197
  });
176
- })
177
- ), h.add(
178
- (f = d.currentPointerUpCell$) == null ? void 0 : f.pipe(S((n) => !!n)).subscribe((n) => {
179
- if (!this._eventListend(this.Event.CellPointerUp)) return;
180
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
181
- c && this.fireEvent(this.Event.CellPointerUp, {
182
- ...c,
183
- ...n,
184
- row: n.row,
185
- column: n.col
198
+ }
199
+ ), this.registerEventHandler(
200
+ this.Event.CellPointerUp,
201
+ () => {
202
+ var d;
203
+ return (d = h.currentPointerUpCell$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
204
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
205
+ a && this.fireEvent(this.Event.CellPointerUp, {
206
+ ...a,
207
+ ...i,
208
+ row: i.row,
209
+ column: i.col
210
+ });
186
211
  });
187
- })
188
- ), h.add(
189
- (E = d.currentCellPosWithEvent$) == null ? void 0 : E.pipe(S((n) => !!n)).subscribe((n) => {
190
- if (!this._eventListend(this.Event.CellPointerMove)) return;
191
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
192
- c && this.fireEvent(this.Event.CellPointerMove, {
193
- ...c,
194
- ...n,
195
- row: n.row,
196
- column: n.col
212
+ }
213
+ ), this.registerEventHandler(
214
+ this.Event.CellPointerMove,
215
+ () => {
216
+ var d;
217
+ return (d = h.currentCellPosWithEvent$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
218
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
219
+ a && this.fireEvent(this.Event.CellPointerMove, {
220
+ ...a,
221
+ ...i,
222
+ row: i.row,
223
+ column: i.col
224
+ });
197
225
  });
198
- })
199
- ), h.add(
200
- (O = p.currentCell$) == null ? void 0 : O.pipe(S((n) => !!n)).subscribe((n) => {
201
- if (!this._eventListend(this.Event.DragOver)) return;
202
- const c = this.getSheetTarget(n.location.unitId, n.location.subUnitId);
203
- c && this.fireEvent(this.Event.DragOver, {
204
- ...c,
205
- ...n,
206
- row: n.location.row,
207
- column: n.location.col
226
+ }
227
+ ), this.registerEventHandler(
228
+ this.Event.DragOver,
229
+ () => {
230
+ var d;
231
+ return (d = I.currentCell$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
232
+ const a = this.getSheetTarget(i.location.unitId, i.location.subUnitId);
233
+ a && this.fireEvent(this.Event.DragOver, {
234
+ ...a,
235
+ ...i,
236
+ row: i.location.row,
237
+ column: i.location.col
238
+ });
208
239
  });
209
- })
210
- ), h.add(
211
- (F = p.endCell$) == null ? void 0 : F.pipe(S((n) => !!n)).subscribe((n) => {
212
- if (!this._eventListend(this.Event.Drop)) return;
213
- const c = this.getSheetTarget(n.location.unitId, n.location.subUnitId);
214
- c && this.fireEvent(this.Event.Drop, {
215
- ...c,
216
- ...n,
217
- row: n.location.row,
218
- column: n.location.col
240
+ }
241
+ ), this.registerEventHandler(
242
+ this.Event.Drop,
243
+ () => {
244
+ var d;
245
+ return (d = I.endCell$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
246
+ const a = this.getSheetTarget(i.location.unitId, i.location.subUnitId);
247
+ a && this.fireEvent(this.Event.Drop, {
248
+ ...a,
249
+ ...i,
250
+ row: i.location.row,
251
+ column: i.location.col
252
+ });
219
253
  });
220
- })
221
- ), h.add(
222
- (N = d.currentRowHeaderClick$) == null ? void 0 : N.pipe(S((n) => !!n)).subscribe((n) => {
223
- if (!this._eventListend(this.Event.RowHeaderClick)) return;
224
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
225
- c && this.fireEvent(this.Event.RowHeaderClick, {
226
- ...c,
227
- row: n.index
254
+ }
255
+ ), this.registerEventHandler(
256
+ this.Event.RowHeaderClick,
257
+ () => {
258
+ var d;
259
+ return (d = h.currentRowHeaderClick$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
260
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
261
+ a && this.fireEvent(this.Event.RowHeaderClick, {
262
+ ...a,
263
+ row: i.index
264
+ });
228
265
  });
229
- })
230
- ), h.add(
231
- (z = d.currentRowHeaderPointerDown$) == null ? void 0 : z.pipe(S((n) => !!n)).subscribe((n) => {
232
- if (!this._eventListend(this.Event.RowHeaderPointerDown)) return;
233
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
234
- c && this.fireEvent(this.Event.RowHeaderPointerDown, {
235
- ...c,
236
- row: n.index
266
+ }
267
+ ), this.registerEventHandler(
268
+ this.Event.RowHeaderPointerDown,
269
+ () => {
270
+ var d;
271
+ return (d = h.currentRowHeaderPointerDown$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
272
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
273
+ a && this.fireEvent(this.Event.RowHeaderPointerDown, {
274
+ ...a,
275
+ row: i.index
276
+ });
237
277
  });
238
- })
239
- ), h.add(
240
- (V = d.currentRowHeaderPointerUp$) == null ? void 0 : V.pipe(S((n) => !!n)).subscribe((n) => {
241
- if (!this._eventListend(this.Event.RowHeaderPointerUp)) return;
242
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
243
- c && this.fireEvent(this.Event.RowHeaderPointerUp, {
244
- ...c,
245
- row: n.index
278
+ }
279
+ ), this.registerEventHandler(
280
+ this.Event.RowHeaderPointerUp,
281
+ () => {
282
+ var d;
283
+ return (d = h.currentRowHeaderPointerUp$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
284
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
285
+ a && this.fireEvent(this.Event.RowHeaderPointerUp, {
286
+ ...a,
287
+ row: i.index
288
+ });
246
289
  });
247
- })
248
- ), h.add(
249
- (Z = d.currentHoveredRowHeader$) == null ? void 0 : Z.pipe(S((n) => !!n)).subscribe((n) => {
250
- if (!this._eventListend(this.Event.RowHeaderHover)) return;
251
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
252
- c && this.fireEvent(this.Event.RowHeaderHover, {
253
- ...c,
254
- row: n.index
290
+ }
291
+ ), this.registerEventHandler(
292
+ this.Event.RowHeaderHover,
293
+ () => {
294
+ var d;
295
+ return (d = h.currentHoveredRowHeader$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
296
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
297
+ a && this.fireEvent(this.Event.RowHeaderHover, {
298
+ ...a,
299
+ row: i.index
300
+ });
255
301
  });
256
- })
257
- ), h.add(
258
- (K = d.currentColHeaderClick$) == null ? void 0 : K.pipe(S((n) => !!n)).subscribe((n) => {
259
- if (!this._eventListend(this.Event.ColumnHeaderClick)) return;
260
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
261
- c && this.fireEvent(this.Event.ColumnHeaderClick, {
262
- ...c,
263
- column: n.index
302
+ }
303
+ ), this.registerEventHandler(
304
+ this.Event.ColumnHeaderClick,
305
+ () => {
306
+ var d;
307
+ return (d = h.currentColHeaderClick$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
308
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
309
+ a && this.fireEvent(this.Event.ColumnHeaderClick, {
310
+ ...a,
311
+ column: i.index
312
+ });
264
313
  });
265
- })
266
- ), h.add(
267
- (Y = d.currentColHeaderPointerDown$) == null ? void 0 : Y.pipe(S((n) => !!n)).subscribe((n) => {
268
- if (!this._eventListend(this.Event.ColumnHeaderPointerDown)) return;
269
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
270
- c && this.fireEvent(this.Event.ColumnHeaderPointerDown, {
271
- ...c,
272
- column: n.index
314
+ }
315
+ ), this.registerEventHandler(
316
+ this.Event.ColumnHeaderPointerDown,
317
+ () => {
318
+ var d;
319
+ return (d = h.currentColHeaderPointerDown$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
320
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
321
+ a && this.fireEvent(this.Event.ColumnHeaderPointerDown, {
322
+ ...a,
323
+ column: i.index
324
+ });
273
325
  });
274
- })
275
- ), h.add(
276
- (X = d.currentColHeaderPointerUp$) == null ? void 0 : X.pipe(S((n) => !!n)).subscribe((n) => {
277
- if (!this._eventListend(this.Event.ColumnHeaderPointerUp)) return;
278
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
279
- c && this.fireEvent(this.Event.ColumnHeaderPointerUp, {
280
- ...c,
281
- column: n.index
326
+ }
327
+ ), this.registerEventHandler(
328
+ this.Event.ColumnHeaderPointerUp,
329
+ () => {
330
+ var d;
331
+ return (d = h.currentColHeaderPointerUp$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
332
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
333
+ a && this.fireEvent(this.Event.ColumnHeaderPointerUp, {
334
+ ...a,
335
+ column: i.index
336
+ });
282
337
  });
283
- })
284
- ), h.add(
285
- (J = d.currentHoveredColHeader$) == null ? void 0 : J.pipe(S((n) => !!n)).subscribe((n) => {
286
- if (!this._eventListend(this.Event.ColumnHeaderHover)) return;
287
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
288
- c && this.fireEvent(this.Event.ColumnHeaderHover, {
289
- ...c,
290
- column: n.index
338
+ }
339
+ ), this.registerEventHandler(
340
+ this.Event.ColumnHeaderHover,
341
+ () => {
342
+ var d;
343
+ return (d = h.currentHoveredColHeader$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
344
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
345
+ a && this.fireEvent(this.Event.ColumnHeaderHover, {
346
+ ...a,
347
+ column: i.index
348
+ });
291
349
  });
292
- })
350
+ }
293
351
  ));
294
- })), this.disposeWithMe(h);
352
+ })), this.disposeWithMe(C);
295
353
  }
296
354
  const s = /* @__PURE__ */ new Map();
297
- let a;
298
- const g = e.get(Q), v = Ne([
355
+ let c;
356
+ const g = e.get(L), u = Ue([
299
357
  o.created$,
300
358
  g.lifecycle$
301
359
  ]);
302
- this.disposeWithMe(v.subscribe(([l, h]) => {
303
- var y;
304
- if (l.type === pe.UNIVER_SHEET && (a = l), h <= ee.Rendered) return;
305
- const C = new $();
306
- if (!a) return;
307
- const d = this.getWorkbook(a.unitId);
308
- if (!d) return;
309
- s.get(a.unitId) && ((y = s.get(a.unitId)) == null || y.dispose()), s.set(a.unitId, C);
310
- const p = a.with(B);
311
- C.add(p.validViewportScrollInfo$.subscribe((u) => {
312
- u && this._eventListend(this.Event.Scroll) && this.fireEvent(this.Event.Scroll, {
313
- workbook: d,
314
- worksheet: d.getActiveSheet(),
315
- ...u
316
- });
317
- }));
318
- const I = a.with(Re);
319
- C.add(I.selectionMoveStart$.subscribe((u) => {
320
- var f;
321
- this._eventListend(this.Event.SelectionMoveStart) && this.fireEvent(this.Event.SelectionMoveStart, {
322
- workbook: d,
323
- worksheet: d.getActiveSheet(),
324
- selections: (f = u == null ? void 0 : u.map((E) => E.range)) != null ? f : []
325
- });
326
- })), C.add(I.selectionMoving$.subscribe((u) => {
327
- var f;
328
- this._eventListend(this.Event.SelectionMoving) && this.fireEvent(this.Event.SelectionMoving, {
329
- workbook: d,
330
- worksheet: d.getActiveSheet(),
331
- selections: (f = u == null ? void 0 : u.map((E) => E.range)) != null ? f : []
332
- });
333
- })), C.add(I.selectionMoveEnd$.subscribe((u) => {
334
- var f;
335
- this._eventListend(this.Event.SelectionMoveEnd) && this.fireEvent(this.Event.SelectionMoveEnd, {
336
- workbook: d,
337
- worksheet: d.getActiveSheet(),
338
- selections: (f = u == null ? void 0 : u.map((E) => E.range)) != null ? f : []
339
- });
340
- })), C.add(I.selectionChanged$.subscribe((u) => {
341
- var f;
342
- this._eventListend(this.Event.SelectionChanged) && this.fireEvent(this.Event.SelectionChanged, {
343
- workbook: d,
344
- worksheet: d.getActiveSheet(),
345
- selections: (f = u == null ? void 0 : u.map((E) => E.range)) != null ? f : []
346
- });
347
- })), a = null, this.disposeWithMe(C);
360
+ this.disposeWithMe(u.subscribe(([l, C]) => {
361
+ var i;
362
+ if (l.type === ae.UNIVER_SHEET && (c = l), C <= F.Rendered) return;
363
+ const v = new y();
364
+ if (!c) return;
365
+ const h = this.getWorkbook(c.unitId);
366
+ if (!h) return;
367
+ s.get(c.unitId) && ((i = s.get(c.unitId)) == null || i.dispose()), s.set(c.unitId, v);
368
+ const I = c.with(T), d = c.with(Se);
369
+ v.add(this.registerEventHandler(
370
+ this.Event.Scroll,
371
+ () => I.validViewportScrollInfo$.subscribe((a) => {
372
+ a && this.fireEvent(this.Event.Scroll, {
373
+ workbook: h,
374
+ worksheet: h.getActiveSheet(),
375
+ ...a
376
+ });
377
+ })
378
+ )), v.add(this.registerEventHandler(
379
+ this.Event.SelectionMoveStart,
380
+ () => d.selectionMoveStart$.subscribe((a) => {
381
+ var E;
382
+ this.fireEvent(this.Event.SelectionMoveStart, {
383
+ workbook: h,
384
+ worksheet: h.getActiveSheet(),
385
+ selections: (E = a == null ? void 0 : a.map((_) => _.range)) != null ? E : []
386
+ });
387
+ })
388
+ )), v.add(this.registerEventHandler(
389
+ this.Event.SelectionMoving,
390
+ () => d.selectionMoving$.subscribe((a) => {
391
+ var E;
392
+ this.fireEvent(this.Event.SelectionMoving, {
393
+ workbook: h,
394
+ worksheet: h.getActiveSheet(),
395
+ selections: (E = a == null ? void 0 : a.map((_) => _.range)) != null ? E : []
396
+ });
397
+ })
398
+ )), v.add(this.registerEventHandler(
399
+ this.Event.SelectionMoveEnd,
400
+ () => d.selectionMoveEnd$.subscribe((a) => {
401
+ var E;
402
+ this.fireEvent(this.Event.SelectionMoveEnd, {
403
+ workbook: h,
404
+ worksheet: h.getActiveSheet(),
405
+ selections: (E = a == null ? void 0 : a.map((_) => _.range)) != null ? E : []
406
+ });
407
+ })
408
+ )), v.add(this.registerEventHandler(
409
+ this.Event.SelectionChanged,
410
+ () => d.selectionChanged$.subscribe((a) => {
411
+ var E;
412
+ this.fireEvent(this.Event.SelectionChanged, {
413
+ workbook: h,
414
+ worksheet: h.getActiveSheet(),
415
+ selections: (E = a == null ? void 0 : a.map((_) => _.range)) != null ? E : []
416
+ });
417
+ })
418
+ )), c = null, this.disposeWithMe(v);
348
419
  })), this.disposeWithMe(o.disposed$.subscribe((l) => {
349
- var h;
350
- (h = s.get(l)) == null || h.dispose(), s.delete(l);
420
+ var C;
421
+ (C = s.get(l)) == null || C.dispose(), s.delete(l);
351
422
  })), this.disposeWithMe(() => {
352
423
  s.forEach((l) => {
353
424
  l.dispose();
@@ -357,85 +428,109 @@ class ze extends ue {
357
428
  /**
358
429
  * @ignore
359
430
  */
431
+ // eslint-disable-next-line max-lines-per-function
360
432
  _initialize(e) {
361
- this._initSheetUIEvent(e);
362
- const t = e.get(P);
363
- this.disposeWithMe(t.beforeCommandExecuted((r) => {
364
- switch (r.id) {
365
- case se.id:
366
- case oe.id:
367
- this._beforeClipboardChange();
368
- break;
369
- case ne.id:
370
- this._beforeClipboardPaste(r.params);
371
- break;
433
+ this._initSheetUIEvent(e), this._initObserverListener(e);
434
+ const r = e.get(P);
435
+ this.registerEventHandler(
436
+ this.Event.BeforeClipboardChange,
437
+ () => {
438
+ const t = new y();
439
+ return t.add(
440
+ r.beforeCommandExecuted((n) => {
441
+ switch (n.id) {
442
+ case Y.id:
443
+ case K.id:
444
+ this._beforeClipboardChange();
445
+ break;
446
+ }
447
+ })
448
+ ), t;
372
449
  }
373
- })), this.disposeWithMe(t.onCommandExecuted((r) => {
374
- if (Me.indexOf(r.id) > -1) {
375
- if (!this._eventListend(this.Event.SheetSkeletonChanged)) return;
376
- const i = this.getActiveSheet();
377
- if (!i) return;
378
- const o = ye(r).map((s) => {
379
- var a, g;
380
- return (g = (a = this.getWorkbook(s.unitId)) == null ? void 0 : a.getSheetBySheetId(s.subUnitId)) == null ? void 0 : g.getRange(s.range);
450
+ ), this.registerEventHandler(
451
+ this.Event.ClipboardChanged,
452
+ () => {
453
+ const t = new y();
454
+ return t.add(r.beforeCommandExecuted((n) => {
455
+ switch (n.id) {
456
+ case V.id:
457
+ this._beforeClipboardPaste(n.params);
458
+ break;
459
+ }
460
+ })), t.add(
461
+ r.beforeCommandExecuted(async (n) => {
462
+ switch (n.id) {
463
+ case X.id:
464
+ await this._beforeClipboardPasteAsync();
465
+ break;
466
+ }
467
+ })
468
+ ), t;
469
+ }
470
+ ), this.disposeWithMe(r.onCommandExecuted((t) => {
471
+ if (Ce.indexOf(t.id) > -1) {
472
+ const n = this.getActiveSheet();
473
+ if (!n) return;
474
+ const o = me(t, n.worksheet.getMaxColumns()).map((s) => {
475
+ var c, g;
476
+ return (g = (c = this.getWorkbook(s.unitId)) == null ? void 0 : c.getSheetBySheetId(s.subUnitId)) == null ? void 0 : g.getRange(s.range);
381
477
  }).filter(Boolean);
382
478
  if (!o.length) return;
383
479
  this.fireEvent(this.Event.SheetSkeletonChanged, {
384
- workbook: i.workbook,
385
- worksheet: i.worksheet,
386
- payload: r,
387
- skeleton: i.worksheet.getSkeleton(),
480
+ workbook: n.workbook,
481
+ worksheet: n.worksheet,
482
+ payload: t,
483
+ skeleton: n.worksheet.getSkeleton(),
388
484
  effectedRanges: o
389
485
  });
390
- return;
391
- }
392
- switch (r.id) {
393
- case se.id:
394
- case oe.id:
395
- this._clipboardChanged();
396
- break;
397
- case ne.id:
398
- this._clipboardPaste();
399
- break;
400
- case ae.id:
401
- this._clipboardPasteAsync();
402
- break;
403
486
  }
404
- })), this.disposeWithMe(t.beforeCommandExecuted(async (r) => {
405
- switch (r.id) {
406
- case ae.id:
407
- await this._beforeClipboardPasteAsync();
408
- break;
409
- }
410
- }));
487
+ })), this.registerEventHandler(
488
+ this.Event.ClipboardChanged,
489
+ () => r.beforeCommandExecuted((t) => {
490
+ switch (t.id) {
491
+ case Y.id:
492
+ case K.id:
493
+ this._clipboardChanged();
494
+ break;
495
+ }
496
+ })
497
+ ), this.registerEventHandler(
498
+ this.Event.ClipboardPasted,
499
+ () => r.beforeCommandExecuted((t) => {
500
+ switch (t.id) {
501
+ case V.id:
502
+ this._clipboardPaste(t.params);
503
+ break;
504
+ case X.id:
505
+ this._clipboardPasteAsync();
506
+ break;
507
+ }
508
+ })
509
+ );
411
510
  }
412
511
  _generateClipboardCopyParam() {
413
- const e = this.getActiveWorkbook(), t = e == null ? void 0 : e.getActiveSheet(), r = e == null ? void 0 : e.getActiveRange();
414
- if (!e || !t || !r)
512
+ const e = this.getActiveWorkbook(), r = e == null ? void 0 : e.getActiveSheet(), t = e == null ? void 0 : e.getActiveRange();
513
+ if (!e || !r || !t)
415
514
  return;
416
- const o = this._injector.get(Se).generateCopyContent(e.getId(), t.getSheetId(), r.getRange());
515
+ const o = this._injector.get(re).generateCopyContent(e.getId(), r.getSheetId(), t.getRange());
417
516
  if (!o)
418
517
  return;
419
- const { html: s, plain: a } = o;
518
+ const { html: s, plain: c } = o;
420
519
  return {
421
520
  workbook: e,
422
- worksheet: t,
423
- text: a,
521
+ worksheet: r,
522
+ text: c,
424
523
  html: s,
425
- fromSheet: t,
426
- fromRange: r
524
+ fromSheet: r,
525
+ fromRange: t
427
526
  };
428
527
  }
429
528
  _beforeClipboardChange() {
430
- if (!this.hasEventCallback(this.Event.BeforeClipboardChange))
431
- return;
432
529
  const e = this._generateClipboardCopyParam();
433
530
  if (e && (this.fireEvent(this.Event.BeforeClipboardChange, e), e.cancel))
434
531
  throw new Error("Before clipboard change is canceled");
435
532
  }
436
533
  _clipboardChanged() {
437
- if (!this.hasEventCallback(this.Event.ClipboardChanged))
438
- return;
439
534
  const e = this._generateClipboardCopyParam();
440
535
  if (e && (this.fireEvent(this.Event.ClipboardChanged, e), e.cancel))
441
536
  throw new Error("Clipboard changed is canceled");
@@ -443,49 +538,43 @@ class ze extends ue {
443
538
  _generateClipboardPasteParam(e) {
444
539
  if (!e)
445
540
  return;
446
- const { htmlContent: t, textContent: r } = e, i = this.getActiveWorkbook(), o = i == null ? void 0 : i.getActiveSheet();
447
- return !i || !o ? void 0 : {
448
- workbook: i,
541
+ const { htmlContent: r, textContent: t } = e, n = this.getActiveWorkbook(), o = n == null ? void 0 : n.getActiveSheet();
542
+ return !n || !o ? void 0 : {
543
+ workbook: n,
449
544
  worksheet: o,
450
- text: r,
451
- html: t
545
+ text: t,
546
+ html: r
452
547
  };
453
548
  }
454
549
  async _generateClipboardPasteParamAsync() {
455
- const e = this.getActiveWorkbook(), t = e == null ? void 0 : e.getActiveSheet();
456
- if (!e || !t)
550
+ const e = this.getActiveWorkbook(), r = e == null ? void 0 : e.getActiveSheet();
551
+ if (!e || !r)
457
552
  return;
458
- const o = (await this._injector.get(je).read())[0];
553
+ const o = (await this._injector.get(He).read())[0];
459
554
  let s;
460
555
  if (o) {
461
- const a = o.types, g = a.indexOf(ce) !== -1 ? await o.getType(ce).then((l) => l && l.text()) : "", v = a.indexOf(de) !== -1 ? await o.getType(de).then((l) => l && l.text()) : "";
556
+ const c = o.types, g = c.indexOf(J) !== -1 ? await o.getType(J).then((l) => l && l.text()) : "", u = c.indexOf(G) !== -1 ? await o.getType(G).then((l) => l && l.text()) : "";
462
557
  s = {
463
558
  workbook: e,
464
- worksheet: t,
559
+ worksheet: r,
465
560
  text: g,
466
- html: v
561
+ html: u
467
562
  };
468
563
  }
469
564
  return s;
470
565
  }
471
566
  _beforeClipboardPaste(e) {
472
- if (!this.hasEventCallback(this.Event.BeforeClipboardPaste))
473
- return;
474
- const t = this._generateClipboardPasteParam(e);
475
- if (t && (this.fireEvent(this.Event.BeforeClipboardPaste, t), t.cancel))
567
+ const r = this._generateClipboardPasteParam(e);
568
+ if (r && (this.fireEvent(this.Event.BeforeClipboardPaste, r), r.cancel))
476
569
  throw new Error("Before clipboard paste is canceled");
477
570
  }
478
571
  _clipboardPaste(e) {
479
- if (!this.hasEventCallback(this.Event.BeforeClipboardPaste))
480
- return;
481
- const t = this._generateClipboardPasteParam(e);
482
- if (t && (this.fireEvent(this.Event.BeforeClipboardPaste, t), t.cancel))
572
+ const r = this._generateClipboardPasteParam(e);
573
+ if (r && (this.fireEvent(this.Event.ClipboardPasted, r), r.cancel))
483
574
  throw new Error("Clipboard pasted is canceled");
484
575
  }
485
576
  async _beforeClipboardPasteAsync() {
486
- if (!this.hasEventCallback(this.Event.BeforeClipboardPaste))
487
- return;
488
- if (!he()) {
577
+ if (!q()) {
489
578
  this._injector.get(D).warn("[Facade]: The navigator object only supports the browser environment");
490
579
  return;
491
580
  }
@@ -494,9 +583,7 @@ class ze extends ue {
494
583
  throw new Error("Before clipboard paste is canceled");
495
584
  }
496
585
  async _clipboardPasteAsync() {
497
- if (!this.hasEventCallback(this.Event.ClipboardPasted))
498
- return;
499
- if (!he()) {
586
+ if (!q()) {
500
587
  this._injector.get(D).warn("[Facade]: The navigator object only supports the browser environment");
501
588
  return;
502
589
  }
@@ -505,40 +592,40 @@ class ze extends ue {
505
592
  throw new Error("Clipboard pasted is canceled");
506
593
  }
507
594
  customizeColumnHeader(e) {
508
- var v, l;
509
- const t = this.getActiveWorkbook();
510
- if (!t) {
595
+ var u, l;
596
+ const r = this.getActiveWorkbook();
597
+ if (!r) {
511
598
  console.error("WorkBook not exist");
512
599
  return;
513
600
  }
514
- const r = t == null ? void 0 : t.getId(), i = this._injector.get(m), o = t.getActiveSheet(), s = o.getSheetId(), a = i.getRenderById(r);
515
- a && ((v = e.headerStyle) != null && v.size) && (a.with(R).setColumnHeaderSize(a, s, (l = e.headerStyle) == null ? void 0 : l.size), o == null || o.refreshCanvas()), this._getSheetRenderComponent(r, k.COLUMN).setCustomHeader(e), o == null || o.refreshCanvas();
601
+ const t = r == null ? void 0 : r.getId(), n = this._injector.get(m), o = r.getActiveSheet(), s = o.getSheetId(), c = n.getRenderById(t);
602
+ c && ((u = e.headerStyle) != null && u.size) && (c.with(R).setColumnHeaderSize(c, s, (l = e.headerStyle) == null ? void 0 : l.size), o == null || o.refreshCanvas()), this._getSheetRenderComponent(t, w.COLUMN).setCustomHeader(e), o == null || o.refreshCanvas();
516
603
  }
517
604
  customizeRowHeader(e) {
518
- const t = this.getActiveWorkbook();
519
- if (!t) {
605
+ const r = this.getActiveWorkbook();
606
+ if (!r) {
520
607
  console.error("WorkBook not exist");
521
608
  return;
522
609
  }
523
- const r = t == null ? void 0 : t.getId();
524
- this._getSheetRenderComponent(r, k.ROW).setCustomHeader(e);
610
+ const t = r == null ? void 0 : r.getId();
611
+ this._getSheetRenderComponent(t, w.ROW).setCustomHeader(e);
525
612
  }
526
- registerSheetRowHeaderExtension(e, ...t) {
527
- const r = this._getSheetRenderComponent(e, k.ROW), i = r.register(...t);
613
+ registerSheetRowHeaderExtension(e, ...r) {
614
+ const t = this._getSheetRenderComponent(e, w.ROW), n = t.register(...r);
528
615
  return b(() => {
529
- i.dispose(), r.makeDirty(!0);
616
+ n.dispose(), t.makeDirty(!0);
530
617
  });
531
618
  }
532
- registerSheetColumnHeaderExtension(e, ...t) {
533
- const r = this._getSheetRenderComponent(e, k.COLUMN), i = r.register(...t);
619
+ registerSheetColumnHeaderExtension(e, ...r) {
620
+ const t = this._getSheetRenderComponent(e, w.COLUMN), n = t.register(...r);
534
621
  return b(() => {
535
- i.dispose(), r.makeDirty(!0);
622
+ n.dispose(), t.makeDirty(!0);
536
623
  });
537
624
  }
538
- registerSheetMainExtension(e, ...t) {
539
- const r = this._getSheetRenderComponent(e, k.MAIN), i = r.register(...t);
625
+ registerSheetMainExtension(e, ...r) {
626
+ const t = this._getSheetRenderComponent(e, w.MAIN), n = t.register(...r);
540
627
  return b(() => {
541
- i.dispose(), r.makeDirty(!0);
628
+ n.dispose(), t.makeDirty(!0);
542
629
  });
543
630
  }
544
631
  /**
@@ -548,11 +635,11 @@ class ze extends ue {
548
635
  * @param {SHEET_VIEW_KEY} viewKey The view key of the spreadsheet.
549
636
  * @returns {Nullable<RenderComponentType>} The render component.
550
637
  */
551
- _getSheetRenderComponent(e, t) {
552
- const i = this._injector.get(m).getRenderById(e);
553
- if (!i)
638
+ _getSheetRenderComponent(e, r) {
639
+ const n = this._injector.get(m).getRenderById(e);
640
+ if (!n)
554
641
  throw new Error(`Render Unit with unitId ${e} not found`);
555
- const { components: o } = i, s = o.get(t);
642
+ const { components: o } = n, s = o.get(r);
556
643
  if (!s)
557
644
  throw new Error("Render component not found");
558
645
  return s;
@@ -562,100 +649,100 @@ class ze extends ue {
562
649
  * @returns {FSheetHooks} FSheetHooks instance
563
650
  */
564
651
  getSheetHooks() {
565
- return this._injector.createInstance(j);
652
+ return this._injector.createInstance($);
566
653
  }
567
654
  }
568
- ue.extend(ze);
569
- class Ve extends Ce {
655
+ te.extend(xe);
656
+ class De extends ne {
570
657
  openSiderbar(e) {
571
- return this._logDeprecation("openSiderbar"), this._injector.get(Oe).open(e);
658
+ return this._logDeprecation("openSiderbar"), this._injector.get(Me).open(e);
572
659
  }
573
660
  openDialog(e) {
574
661
  this._logDeprecation("openDialog");
575
- const r = this._injector.get(Fe).open({
662
+ const t = this._injector.get(ye).open({
576
663
  ...e,
577
664
  onClose: () => {
578
- r.dispose();
665
+ t.dispose();
579
666
  }
580
667
  });
581
- return r;
668
+ return t;
582
669
  }
583
670
  _logDeprecation(e) {
584
671
  this._injector.get(D).warn("[FWorkbook]", `${e} is deprecated. Please use the function of the same name on "FUniver".`);
585
672
  }
586
673
  generateCellParams(e) {
587
- const t = this.getActiveSheet();
674
+ const r = this.getActiveSheet();
588
675
  return {
589
676
  row: e.row,
590
677
  column: e.col,
591
678
  workbook: this,
592
- worksheet: t
679
+ worksheet: r
593
680
  };
594
681
  }
595
682
  onCellClick(e) {
596
- const t = this._injector.get(_);
683
+ const r = this._injector.get(f);
597
684
  return b(
598
- t.currentClickedCell$.pipe(S((r) => !!r)).subscribe((r) => {
599
- e(r);
685
+ r.currentClickedCell$.pipe(S((t) => !!t)).subscribe((t) => {
686
+ e(t);
600
687
  })
601
688
  );
602
689
  }
603
690
  onCellHover(e) {
604
- const t = this._injector.get(_);
691
+ const r = this._injector.get(f);
605
692
  return b(
606
- t.currentRichText$.pipe(S((r) => !!r)).subscribe(e)
693
+ r.currentRichText$.pipe(S((t) => !!t)).subscribe(e)
607
694
  );
608
695
  }
609
696
  onCellPointerDown(e) {
610
- const t = this._injector.get(_);
697
+ const r = this._injector.get(f);
611
698
  return b(
612
- t.currentPointerDownCell$.subscribe(e)
699
+ r.currentPointerDownCell$.subscribe(e)
613
700
  );
614
701
  }
615
702
  onCellPointerUp(e) {
616
- const t = this._injector.get(_);
703
+ const r = this._injector.get(f);
617
704
  return b(
618
- t.currentPointerUpCell$.subscribe(e)
705
+ r.currentPointerUpCell$.subscribe(e)
619
706
  );
620
707
  }
621
708
  onCellPointerMove(e) {
622
- const t = this._injector.get(_);
709
+ const r = this._injector.get(f);
623
710
  return b(
624
- t.currentCellPosWithEvent$.pipe(S((r) => !!r)).subscribe((r) => {
625
- e(r, r.event);
711
+ r.currentCellPosWithEvent$.pipe(S((t) => !!t)).subscribe((t) => {
712
+ e(t, t.event);
626
713
  })
627
714
  );
628
715
  }
629
716
  onDragOver(e) {
630
- const t = this._injector.get(H);
717
+ const r = this._injector.get(U);
631
718
  return b(
632
- t.currentCell$.pipe(S((r) => !!r)).subscribe((r) => {
633
- e(r);
719
+ r.currentCell$.pipe(S((t) => !!t)).subscribe((t) => {
720
+ e(t);
634
721
  })
635
722
  );
636
723
  }
637
724
  onDrop(e) {
638
- const t = this._injector.get(H);
725
+ const r = this._injector.get(U);
639
726
  return b(
640
- t.endCell$.pipe(S((r) => !!r)).subscribe((r) => {
641
- e(r);
727
+ r.endCell$.pipe(S((t) => !!t)).subscribe((t) => {
728
+ e(t);
642
729
  })
643
730
  );
644
731
  }
645
732
  startEditing() {
646
- return this._injector.get(P).syncExecuteCommand(M.id, {
647
- eventType: te.Dblclick,
733
+ return this._injector.get(P).syncExecuteCommand(k.id, {
734
+ eventType: N.Dblclick,
648
735
  unitId: this._workbook.getUnitId(),
649
736
  visible: !0
650
737
  });
651
738
  }
652
739
  async endEditing(e) {
653
- return this._injector.get(P).syncExecuteCommand(M.id, {
654
- eventType: te.Keyboard,
655
- keycode: e ? T.ENTER : T.ESC,
740
+ return this._injector.get(P).syncExecuteCommand(k.id, {
741
+ eventType: N.Keyboard,
742
+ keycode: e ? B.ENTER : B.ESC,
656
743
  visible: !1,
657
744
  unitId: this._workbook.getUnitId()
658
- }), await Ee(0), !0;
745
+ }), await ce(0), !0;
659
746
  }
660
747
  endEditingAsync(e = !0) {
661
748
  return this.endEditing(e);
@@ -670,40 +757,40 @@ class Ve extends Ce {
670
757
  * ```
671
758
  */
672
759
  getScrollStateBySheetId(e) {
673
- const t = this._workbook.getUnitId(), i = this._injector.get(m).getRenderById(t);
674
- return i ? i.with(B).getScrollStateByParam({ unitId: t, sheetId: e }) : null;
760
+ const r = this._workbook.getUnitId(), n = this._injector.get(m).getRenderById(r);
761
+ return n ? n.with(T).getScrollStateByParam({ unitId: r, sheetId: e }) : null;
675
762
  }
676
763
  disableSelection() {
677
- const e = this._workbook.getUnitId(), r = this._injector.get(m).getRenderById(e);
678
- return r && r.with(x).disableSelection(), this;
764
+ const e = this._workbook.getUnitId(), t = this._injector.get(m).getRenderById(e);
765
+ return t && t.with(x).disableSelection(), this;
679
766
  }
680
767
  enableSelection() {
681
- const e = this._workbook.getUnitId(), r = this._injector.get(m).getRenderById(e);
682
- return r && r.with(x).enableSelection(), this;
768
+ const e = this._workbook.getUnitId(), t = this._injector.get(m).getRenderById(e);
769
+ return t && t.with(x).enableSelection(), this;
683
770
  }
684
771
  transparentSelection() {
685
- const e = this._workbook.getUnitId(), r = this._injector.get(m).getRenderById(e);
686
- return r && r.with(x).transparentSelection(), this;
772
+ const e = this._workbook.getUnitId(), t = this._injector.get(m).getRenderById(e);
773
+ return t && t.with(x).transparentSelection(), this;
687
774
  }
688
775
  showSelection() {
689
- const e = this._workbook.getUnitId(), r = this._injector.get(m).getRenderById(e);
690
- return r && r.with(x).showSelection(), this;
776
+ const e = this._workbook.getUnitId(), t = this._injector.get(m).getRenderById(e);
777
+ return t && t.with(x).showSelection(), this;
691
778
  }
692
779
  }
693
- Ce.extend(Ve);
694
- class Ze extends me {
780
+ ne.extend(De);
781
+ class Te extends ie {
695
782
  refreshCanvas() {
696
- const e = this._injector.get(m), t = this._fWorkbook.id, r = e.getRenderById(t);
697
- if (!r)
698
- throw new Error(`Render Unit with unitId ${t} not found`);
699
- r.with(R).reCalculate();
700
- const i = r.mainComponent;
701
- if (!i)
783
+ const e = this._injector.get(m), r = this._fWorkbook.id, t = e.getRenderById(r);
784
+ if (!t)
785
+ throw new Error(`Render Unit with unitId ${r} not found`);
786
+ t.with(R).reCalculate();
787
+ const n = t.mainComponent;
788
+ if (!n)
702
789
  throw new Error("Main component not found");
703
- return i.makeDirty(), this;
790
+ return n.makeDirty(), this;
704
791
  }
705
792
  zoom(e) {
706
- return this._injector.get(P).syncExecuteCommand(De.id, {
793
+ return this._injector.get(P).syncExecuteCommand(fe.id, {
707
794
  unitId: this._workbook.getUnitId(),
708
795
  subUnitId: this._worksheet.getSheetId(),
709
796
  zoomRatio: e
@@ -713,26 +800,26 @@ class Ze extends me {
713
800
  return this._worksheet.getZoomRatio();
714
801
  }
715
802
  getVisibleRange() {
716
- const e = this._workbook.getUnitId(), r = this._injector.get(m).getRenderById(e);
717
- let i = {
803
+ const e = this._workbook.getUnitId(), t = this._injector.get(m).getRenderById(e);
804
+ let n = {
718
805
  startColumn: 0,
719
806
  startRow: 0,
720
807
  endColumn: 0,
721
808
  endRow: 0
722
809
  };
723
- if (!r) return i;
724
- const s = r.with(R).getCurrentSkeleton();
725
- if (!s) return i;
726
- const a = s == null ? void 0 : s.getVisibleRanges();
727
- if (!a) return i;
728
- i = s.getVisibleRangeByViewport(Ie.VIEW_MAIN);
729
- for (const [g, v] of a)
730
- Pe.indexOf(g) !== -1 && (i.startColumn = Math.min(i.startColumn, v.startColumn), i.startRow = Math.min(i.startRow, v.startRow), i.endColumn = Math.max(i.endColumn, v.endColumn), i.endRow = Math.max(i.endRow, v.endRow));
731
- return i;
732
- }
733
- scrollToCell(e, t) {
734
- const r = this._workbook.getUnitId(), o = this._injector.get(m).getRenderById(r);
735
- return o && (o == null ? void 0 : o.with(Be)).scrollToCell(e, t), this;
810
+ if (!t) return n;
811
+ const s = t.with(R).getCurrentSkeleton();
812
+ if (!s) return n;
813
+ const c = s == null ? void 0 : s.getVisibleRanges();
814
+ if (!c) return n;
815
+ n = s.getVisibleRangeByViewport(ue.VIEW_MAIN);
816
+ for (const [g, u] of c)
817
+ ve.indexOf(g) !== -1 && (n.startColumn = Math.min(n.startColumn, u.startColumn), n.startRow = Math.min(n.startRow, u.startRow), n.endColumn = Math.max(n.endColumn, u.endColumn), n.endRow = Math.max(n.endRow, u.endRow));
818
+ return n;
819
+ }
820
+ scrollToCell(e, r) {
821
+ const t = this._workbook.getUnitId(), o = this._injector.get(m).getRenderById(t);
822
+ return o && (o == null ? void 0 : o.with(we)).scrollToCell(e, r), this;
736
823
  }
737
824
  getScrollState() {
738
825
  const e = {
@@ -740,15 +827,15 @@ class Ze extends me {
740
827
  offsetY: 0,
741
828
  sheetViewStartColumn: 0,
742
829
  sheetViewStartRow: 0
743
- }, t = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), o = this._injector.get(m).getRenderById(t);
744
- return o && o.with(B).getScrollStateByParam({ unitId: t, sheetId: r }) || e;
830
+ }, r = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), o = this._injector.get(m).getRenderById(r);
831
+ return o && o.with(T).getScrollStateByParam({ unitId: r, sheetId: t }) || e;
745
832
  }
746
833
  onScroll(e) {
747
834
  var o;
748
- const t = this._workbook.getUnitId(), i = (o = this._injector.get(m).getRenderById(t)) == null ? void 0 : o.with(B);
749
- if (i) {
750
- const s = i.validViewportScrollInfo$.subscribe((a) => {
751
- e(a);
835
+ const r = this._workbook.getUnitId(), n = (o = this._injector.get(m).getRenderById(r)) == null ? void 0 : o.with(T);
836
+ if (n) {
837
+ const s = n.validViewportScrollInfo$.subscribe((c) => {
838
+ e(c);
752
839
  });
753
840
  return b(s);
754
841
  }
@@ -756,53 +843,53 @@ class Ze extends me {
756
843
  });
757
844
  }
758
845
  getSkeleton() {
759
- var t, r;
760
- const e = (t = this._injector.get(m).getRenderById(this._workbook.getUnitId())) == null ? void 0 : t.with(R);
761
- return (r = e == null ? void 0 : e.getWorksheetSkeleton(this._worksheet.getSheetId())) == null ? void 0 : r.skeleton;
846
+ var r, t;
847
+ const e = (r = this._injector.get(m).getRenderById(this._workbook.getUnitId())) == null ? void 0 : r.with(R);
848
+ return (t = e == null ? void 0 : e.getWorksheetSkeleton(this._worksheet.getSheetId())) == null ? void 0 : t.skeleton;
762
849
  }
763
- setColumnAutoWidth(e, t) {
764
- const r = this._workbook.getUnitId(), i = this._worksheet.getSheetId(), o = [
850
+ setColumnAutoWidth(e, r) {
851
+ const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), o = [
765
852
  {
766
853
  startColumn: e,
767
- endColumn: e + t - 1,
854
+ endColumn: e + r - 1,
768
855
  startRow: 0,
769
856
  endRow: this._worksheet.getRowCount() - 1
770
857
  }
771
858
  ];
772
- return this._commandService.syncExecuteCommand(Te.id, {
773
- unitId: r,
774
- subUnitId: i,
859
+ return this._commandService.syncExecuteCommand(ke.id, {
860
+ unitId: t,
861
+ subUnitId: n,
775
862
  ranges: o
776
863
  }), this;
777
864
  }
778
865
  customizeColumnHeader(e) {
779
- var g, v;
780
- const t = this, r = this._fWorkbook.getId(), i = this._injector.get(m), o = t.getSheetId(), s = i.getRenderById(r);
781
- s && ((g = e.headerStyle) != null && g.size) && (s.with(R).setColumnHeaderSize(s, o, (v = e.headerStyle) == null ? void 0 : v.size), t == null || t.refreshCanvas());
782
- const a = this._getSheetRenderComponent(r, k.COLUMN);
783
- a && (a.setCustomHeader(e), t == null || t.refreshCanvas());
866
+ var g, u;
867
+ const r = this, t = this._fWorkbook.getId(), n = this._injector.get(m), o = r.getSheetId(), s = n.getRenderById(t);
868
+ s && ((g = e.headerStyle) != null && g.size) && (s.with(R).setColumnHeaderSize(s, o, (u = e.headerStyle) == null ? void 0 : u.size), r == null || r.refreshCanvas());
869
+ const c = this._getSheetRenderComponent(t, w.COLUMN);
870
+ c && (c.setCustomHeader(e), r == null || r.refreshCanvas());
784
871
  }
785
872
  customizeRowHeader(e) {
786
- const t = this._fWorkbook.getId();
787
- this._getSheetRenderComponent(t, k.ROW).setCustomHeader(e);
873
+ const r = this._fWorkbook.getId();
874
+ this._getSheetRenderComponent(r, w.ROW).setCustomHeader(e);
788
875
  }
789
876
  setColumnHeaderHeight(e) {
790
- const t = this, r = this._fWorkbook.getId(), i = t.getSheetId();
791
- return this._commandService.executeCommand(Le.id, {
792
- unitId: r,
793
- subUnitId: i,
877
+ const r = this, t = this._fWorkbook.getId(), n = r.getSheetId();
878
+ return this._commandService.executeCommand(Ie.id, {
879
+ unitId: t,
880
+ subUnitId: n,
794
881
  size: e
795
- }), t == null || t.refreshCanvas(), this;
882
+ }), r == null || r.refreshCanvas(), this;
796
883
  }
797
884
  setRowHeaderWidth(e) {
798
- const t = this, r = this._fWorkbook.getId(), i = t.getSheetId();
799
- this._commandService.executeCommand(Ae.id, {
800
- unitId: r,
801
- subUnitId: i,
885
+ const r = this, t = this._fWorkbook.getId(), n = r.getSheetId();
886
+ this._commandService.executeCommand(_e.id, {
887
+ unitId: t,
888
+ subUnitId: n,
802
889
  size: e
803
890
  });
804
- const o = this._getSheetRenderComponent(r, k.ROW);
805
- return o && o.setCustomHeader({ headerStyle: { size: e } }), t == null || t.refreshCanvas(), this;
891
+ const o = this._getSheetRenderComponent(t, w.ROW);
892
+ return o && o.setCustomHeader({ headerStyle: { size: e } }), r == null || r.refreshCanvas(), this;
806
893
  }
807
894
  /**
808
895
  * Get sheet render component from render by unitId and view key.
@@ -811,64 +898,64 @@ class Ze extends me {
811
898
  * @param {SHEET_VIEW_KEY} viewKey The view key of the spreadsheet.
812
899
  * @returns {Nullable<RenderComponentType>} The render component.
813
900
  */
814
- _getSheetRenderComponent(e, t) {
815
- const i = this._injector.get(m).getRenderById(e);
816
- if (!i)
901
+ _getSheetRenderComponent(e, r) {
902
+ const n = this._injector.get(m).getRenderById(e);
903
+ if (!n)
817
904
  throw new Error(`Render Unit with unitId ${e} not found`);
818
- const { components: o } = i, s = o.get(t);
905
+ const { components: o } = n, s = o.get(r);
819
906
  if (!s)
820
907
  throw new Error("Render component not found");
821
908
  return s;
822
909
  }
823
910
  }
824
- me.extend(Ze);
825
- class Ke extends be {
911
+ ie.extend(Te);
912
+ class Be extends oe {
826
913
  setPermissionDialogVisible(e) {
827
914
  this._permissionService.setShowComponents(e);
828
915
  }
829
916
  }
830
- be.extend(Ke);
831
- class Ye extends j {
917
+ oe.extend(Be);
918
+ class Ae extends $ {
832
919
  onCellPointerMove(e) {
833
- return b(this._injector.get(_).currentPosition$.subscribe(e));
920
+ return b(this._injector.get(f).currentPosition$.subscribe(e));
834
921
  }
835
922
  onCellPointerOver(e) {
836
- return b(this._injector.get(_).currentCell$.subscribe(e));
923
+ return b(this._injector.get(f).currentCell$.subscribe(e));
837
924
  }
838
925
  onCellDragOver(e) {
839
- return b(this._injector.get(H).currentCell$.subscribe(e));
926
+ return b(this._injector.get(U).currentCell$.subscribe(e));
840
927
  }
841
928
  onCellDrop(e) {
842
- return b(this._injector.get(H).endCell$.subscribe(e));
929
+ return b(this._injector.get(U).endCell$.subscribe(e));
843
930
  }
844
- onCellRender(e, t = we.Style, r = xe.DATA_VALIDATION) {
845
- return this._injector.get(Ue).intercept(He.CELL_CONTENT, {
846
- effect: t,
847
- handler: (i, o, s) => s({
848
- ...i,
931
+ onCellRender(e, r = de.Style, t = pe.DATA_VALIDATION) {
932
+ return this._injector.get(be).intercept(Ee.CELL_CONTENT, {
933
+ effect: r,
934
+ handler: (n, o, s) => s({
935
+ ...n,
849
936
  customRender: [
850
- ...(i == null ? void 0 : i.customRender) || [],
937
+ ...(n == null ? void 0 : n.customRender) || [],
851
938
  ...e || []
852
939
  ]
853
940
  }),
854
- priority: r
941
+ priority: t
855
942
  });
856
943
  }
857
944
  onBeforeCellEdit(e) {
858
- return this._injector.get(P).beforeCommandExecuted((t) => {
859
- const r = t.params;
860
- t.id === M.id && r.visible && e(r);
945
+ return this._injector.get(P).beforeCommandExecuted((r) => {
946
+ const t = r.params;
947
+ r.id === k.id && t.visible && e(t);
861
948
  });
862
949
  }
863
950
  onAfterCellEdit(e) {
864
- return this._injector.get(P).onCommandExecuted((t) => {
865
- const r = t.params;
866
- t.id === M.id && !r.visible && e(r);
951
+ return this._injector.get(P).onCommandExecuted((r) => {
952
+ const t = r.params;
953
+ r.id === k.id && !t.visible && e(t);
867
954
  });
868
955
  }
869
956
  }
870
- j.extend(Ye);
871
- const U = {
957
+ $.extend(Ae);
958
+ const M = {
872
959
  CellClicked: "CellClicked",
873
960
  CellPointerDown: "CellPointerDown",
874
961
  CellPointerUp: "CellPointerUp",
@@ -882,7 +969,7 @@ const U = {
882
969
  SelectionMoveEnd: "SelectionMoveEnd",
883
970
  SelectionChanged: "SelectionChanged"
884
971
  };
885
- class Xe extends ve {
972
+ class We {
886
973
  get BeforeClipboardChange() {
887
974
  return "BeforeClipboardChange";
888
975
  }
@@ -911,19 +998,19 @@ class Xe extends ve {
911
998
  return "SheetEditEnded";
912
999
  }
913
1000
  get CellClicked() {
914
- return U.CellClicked;
1001
+ return M.CellClicked;
915
1002
  }
916
1003
  get CellHover() {
917
- return U.CellHover;
1004
+ return M.CellHover;
918
1005
  }
919
1006
  get CellPointerDown() {
920
- return U.CellPointerDown;
1007
+ return M.CellPointerDown;
921
1008
  }
922
1009
  get CellPointerUp() {
923
- return U.CellPointerUp;
1010
+ return M.CellPointerUp;
924
1011
  }
925
1012
  get CellPointerMove() {
926
- return U.CellPointerMove;
1013
+ return M.CellPointerMove;
927
1014
  }
928
1015
  get DragOver() {
929
1016
  return "DragOver";
@@ -973,43 +1060,49 @@ class Xe extends ve {
973
1060
  get SheetSkeletonChanged() {
974
1061
  return "SheetSkeletonChanged";
975
1062
  }
1063
+ get BeforeSheetZoomChange() {
1064
+ return "BeforeSheetZoomChange";
1065
+ }
1066
+ get SheetZoomChanged() {
1067
+ return "SheetZoomChanged";
1068
+ }
976
1069
  }
977
- ve.extend(Xe);
978
- class Je extends fe {
1070
+ le.extend(We);
1071
+ class $e extends se {
979
1072
  getCell() {
980
- var a;
981
- const e = this._injector.get(m), t = this._injector.get(D), r = this._workbook.getUnitId(), i = this._worksheet.getSheetId(), o = e.getRenderById(r), s = (a = o == null ? void 0 : o.with(R).getWorksheetSkeleton(i)) == null ? void 0 : a.skeleton;
1073
+ var c;
1074
+ const e = this._injector.get(m), r = this._injector.get(D), t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), o = e.getRenderById(t), s = (c = o == null ? void 0 : o.with(R).getSkeletonParam(n)) == null ? void 0 : c.skeleton;
982
1075
  if (!s)
983
- throw t.error("[Facade]: `FRange.getCell` can only be called in current worksheet"), new Error("`FRange.getCell` can only be called in current worksheet");
1076
+ throw r.error("[Facade]: `FRange.getCell` can only be called in current worksheet"), new Error("`FRange.getCell` can only be called in current worksheet");
984
1077
  return s.getCellWithCoordByIndex(this._range.startRow, this._range.startColumn);
985
1078
  }
986
1079
  getCellRect() {
987
- const { startX: e, startY: t, endX: r, endY: i } = this.getCell(), o = { x: e, y: t, width: r - e, height: i - t, top: t, left: e, bottom: i, right: r };
1080
+ const { startX: e, startY: r, endX: t, endY: n } = this.getCell(), o = { x: e, y: r, width: t - e, height: n - r, top: r, left: e, bottom: n, right: t };
988
1081
  return { ...o, toJSON: () => JSON.stringify(o) };
989
1082
  }
990
1083
  generateHTML() {
991
- var t;
992
- const e = this._injector.get(Se).generateCopyContent(
1084
+ var r;
1085
+ const e = this._injector.get(re).generateCopyContent(
993
1086
  this._workbook.getUnitId(),
994
1087
  this._worksheet.getSheetId(),
995
1088
  this._range
996
1089
  );
997
- return (t = e == null ? void 0 : e.html) != null ? t : "";
1090
+ return (r = e == null ? void 0 : e.html) != null ? r : "";
998
1091
  }
999
1092
  attachPopup(e) {
1000
- var s, a, g;
1001
- e.direction = (s = e.direction) != null ? s : "horizontal", e.extraProps = (a = e.extraProps) != null ? a : {}, e.offset = (g = e.offset) != null ? g : [0, 0];
1002
- const { key: t, disposableCollection: r } = ge(e, this._injector.get(le)), o = this._injector.get(ie).attachPopupToCell(
1093
+ var s, c, g;
1094
+ e.direction = (s = e.direction) != null ? s : "horizontal", e.extraProps = (c = e.extraProps) != null ? c : {}, e.offset = (g = e.offset) != null ? g : [0, 0];
1095
+ const { key: r, disposableCollection: t } = ee(e, this._injector.get(Q)), o = this._injector.get(Z).attachPopupToCell(
1003
1096
  this._range.startRow,
1004
1097
  this._range.startColumn,
1005
- { ...e, componentKey: t },
1098
+ { ...e, componentKey: r },
1006
1099
  this.getUnitId(),
1007
1100
  this._worksheet.getSheetId()
1008
1101
  );
1009
- return o ? (r.add(o), r) : (r.dispose(), null);
1102
+ return o ? (t.add(o), t) : (t.dispose(), null);
1010
1103
  }
1011
1104
  attachAlertPopup(e) {
1012
- const t = this._injector.get(We), r = {
1105
+ const r = this._injector.get(Pe), t = {
1013
1106
  workbook: this._workbook,
1014
1107
  worksheet: this._worksheet,
1015
1108
  row: this._range.startRow,
@@ -1017,12 +1110,12 @@ class Je extends fe {
1017
1110
  unitId: this.getUnitId(),
1018
1111
  subUnitId: this._worksheet.getSheetId()
1019
1112
  };
1020
- return t.showAlert({
1113
+ return r.showAlert({
1021
1114
  ...e,
1022
- location: r
1115
+ location: t
1023
1116
  }), {
1024
1117
  dispose: () => {
1025
- t.removeAlert(e.key);
1118
+ r.removeAlert(e.key);
1026
1119
  }
1027
1120
  };
1028
1121
  }
@@ -1039,35 +1132,35 @@ class Je extends fe {
1039
1132
  });
1040
1133
  */
1041
1134
  attachRangePopup(e) {
1042
- var s, a, g;
1043
- e.direction = (s = e.direction) != null ? s : "top-center", e.extraProps = (a = e.extraProps) != null ? a : {}, e.offset = (g = e.offset) != null ? g : [0, 0];
1044
- const { key: t, disposableCollection: r } = ge(e, this._injector.get(le)), o = this._injector.get(ie).attachRangePopup(
1135
+ var s, c, g;
1136
+ e.direction = (s = e.direction) != null ? s : "top-center", e.extraProps = (c = e.extraProps) != null ? c : {}, e.offset = (g = e.offset) != null ? g : [0, 0];
1137
+ const { key: r, disposableCollection: t } = ee(e, this._injector.get(Q)), o = this._injector.get(Z).attachRangePopup(
1045
1138
  this._range,
1046
- { ...e, componentKey: t },
1139
+ { ...e, componentKey: r },
1047
1140
  this.getUnitId(),
1048
1141
  this._worksheet.getSheetId()
1049
1142
  );
1050
- return o ? (r.add(o), r) : (r.dispose(), null);
1143
+ return o ? (t.add(o), t) : (t.dispose(), null);
1051
1144
  }
1052
- highlight(e, t) {
1053
- const r = this._injector.get($e), i = r.addShape({ range: this._range, style: e, primary: t });
1054
- if (!i)
1145
+ highlight(e, r) {
1146
+ const t = this._injector.get(Re), n = t.addShape({ range: this._range, style: e, primary: r });
1147
+ if (!n)
1055
1148
  throw new Error("Failed to highlight current range");
1056
1149
  return b(() => {
1057
- r.removeShape(i);
1150
+ t.removeShape(n);
1058
1151
  });
1059
1152
  }
1060
1153
  }
1061
- fe.extend(Je);
1062
- function ge(w, e) {
1063
- const { componentKey: t, isVue3: r } = w;
1064
- let i;
1065
- const o = new $();
1066
- return typeof t == "string" ? i = t : (i = `External_${_e(6)}`, o.add(e.register(i, t, { framework: r ? "vue3" : "react" }))), {
1067
- key: i,
1154
+ se.extend($e);
1155
+ function ee(p, e) {
1156
+ const { componentKey: r, isVue3: t } = p;
1157
+ let n;
1158
+ const o = new y();
1159
+ return typeof r == "string" ? n = r : (n = `External_${he(6)}`, o.add(e.register(n, r, { framework: t ? "vue3" : "react" }))), {
1160
+ key: n,
1068
1161
  disposableCollection: o
1069
1162
  };
1070
1163
  }
1071
1164
  export {
1072
- ge as transformComponentKey
1165
+ ee as transformComponentKey
1073
1166
  };