@univerjs/sheets-ui 0.6.0-nightly.202502101606 → 0.6.0-nightly.202502111606

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