@univerjs/sheets-ui 0.6.1-nightly.202502221605 → 0.6.1-nightly.202502241606

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