@univerjs/sheets-ui 0.6.1 → 0.6.2-nightly.202503031606

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