@univerjs/sheets-ui 0.5.2 → 0.5.3-nightly.202501041605

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,11 +1,139 @@
1
- import { FUniver as b, toDisposable as i, ILogService as x, ICommandService as h, awaitTime as j, InterceptorEffectEnum as U, DisposableCollection as P, generateRandomId as D } from "@univerjs/core";
2
- import { IRenderManagerService as c, DeviceInputEventType as _, SHEET_VIEWPORT_KEY as B, sheetContentViewportKeys as T } from "@univerjs/engine-render";
3
- import { SHEET_VIEW_KEY as l, HoverManagerService as d, SetCellEditVisibleOperation as m, SheetScrollManagerService as v, ISheetSelectionRenderService as S, SheetSkeletonManagerService as C, ChangeZoomRatioCommand as W, SheetsScrollRenderController as F, DragManagerService as k, ISheetClipboardService as O, SheetCanvasPopManagerService as A, CellAlertManagerService as H, IMarkSelectionService as $ } from "@univerjs/sheets-ui";
4
- import { FSheetHooks as I, FWorkbook as R, FWorksheet as M, FPermission as f, FRange as y } from "@univerjs/sheets/facade";
5
- import { ISidebarService as V, IDialogService as N, KeyCode as w, ComponentManager as K } from "@univerjs/ui";
6
- import { filter as p } from "rxjs";
7
- import { SheetInterceptorService as L, INTERCEPTOR_POINT as Y, InterceptCellContentPriority as z } from "@univerjs/sheets";
8
- class Z extends b {
1
+ import { FUniver as U, ICommandService as g, ILogService as b, toDisposable as s, awaitTime as H, InterceptorEffectEnum as N, FEventName as A, DisposableCollection as $, generateRandomId as V } from "@univerjs/core";
2
+ import { IRenderManagerService as a, DeviceInputEventType as w, SHEET_VIEWPORT_KEY as L, sheetContentViewportKeys as K } from "@univerjs/engine-render";
3
+ import { SheetPasteShortKeyCommand as k, ISheetClipboardService as T, SHEET_VIEW_KEY as u, HoverManagerService as h, SetCellEditVisibleOperation as v, SheetScrollManagerService as _, ISheetSelectionRenderService as m, SheetSkeletonManagerService as f, ChangeZoomRatioCommand as Y, SheetsScrollRenderController as z, DragManagerService as E, SheetCanvasPopManagerService as X, CellAlertManagerService as Z, IMarkSelectionService as J } from "@univerjs/sheets-ui";
4
+ import { FSheetHooks as I, FWorkbook as D, FWorksheet as W, FPermission as F, FRange as O } from "@univerjs/sheets/facade";
5
+ import { CutCommand as P, CopyCommand as y, PasteCommand as R, IClipboardInterfaceService as q, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as M, HTML_CLIPBOARD_MIME_TYPE as x, supportClipboardAPI as j, ISidebarService as G, IDialogService as Q, KeyCode as B, ComponentManager as ee } from "@univerjs/ui";
6
+ import { filter as S } from "rxjs";
7
+ import { SheetInterceptorService as te, INTERCEPTOR_POINT as re, InterceptCellContentPriority as ne } from "@univerjs/sheets";
8
+ class oe extends U {
9
+ _initialize(e) {
10
+ const t = e.get(g);
11
+ this.disposeWithMe(t.beforeCommandExecuted((r) => {
12
+ switch (r.id) {
13
+ case y.id:
14
+ case P.id:
15
+ this._beforeClipboardChange();
16
+ break;
17
+ case k.id:
18
+ this._beforeClipboardPaste(r.params);
19
+ break;
20
+ }
21
+ })), this.disposeWithMe(t.onCommandExecuted((r) => {
22
+ switch (r.id) {
23
+ case y.id:
24
+ case P.id:
25
+ this._clipboardChanged();
26
+ break;
27
+ case k.id:
28
+ this._clipboardPaste();
29
+ break;
30
+ case R.id:
31
+ this._clipboardPasteAsync();
32
+ break;
33
+ }
34
+ })), this.disposeWithMe(t.beforeCommandExecuted(async (r) => {
35
+ switch (r.id) {
36
+ case R.id:
37
+ await this._beforeClipboardPasteAsync();
38
+ break;
39
+ }
40
+ }));
41
+ }
42
+ _generateClipboardCopyParam() {
43
+ const e = this.getActiveUniverSheet(), t = e == null ? void 0 : e.getActiveSheet(), r = e == null ? void 0 : e.getActiveRange();
44
+ if (!e || !t || !r)
45
+ return;
46
+ const o = this._injector.get(T).generateCopyContent(e.getId(), t.getSheetId(), r.getRange());
47
+ if (!o)
48
+ return;
49
+ const { html: i, plain: c } = o;
50
+ return {
51
+ workbook: e,
52
+ worksheet: t,
53
+ text: c,
54
+ html: i,
55
+ fromSheet: t,
56
+ fromRange: r
57
+ };
58
+ }
59
+ _beforeClipboardChange() {
60
+ if (!this.hasEventCallback(this.Event.BeforeClipboardChange))
61
+ return;
62
+ const e = this._generateClipboardCopyParam();
63
+ if (e && (this.fireEvent(this.Event.BeforeClipboardChange, e), e.cancel))
64
+ throw new Error("Before clipboard change is canceled");
65
+ }
66
+ _clipboardChanged() {
67
+ if (!this.hasEventCallback(this.Event.ClipboardChanged))
68
+ return;
69
+ const e = this._generateClipboardCopyParam();
70
+ if (e && (this.fireEvent(this.Event.ClipboardChanged, e), e.cancel))
71
+ throw new Error("Clipboard changed is canceled");
72
+ }
73
+ _generateClipboardPasteParam(e) {
74
+ if (!e)
75
+ return;
76
+ const { htmlContent: t, textContent: r } = e, n = this.getActiveUniverSheet(), o = n == null ? void 0 : n.getActiveSheet();
77
+ return !n || !o ? void 0 : {
78
+ workbook: n,
79
+ worksheet: o,
80
+ text: r,
81
+ html: t
82
+ };
83
+ }
84
+ async _generateClipboardPasteParamAsync() {
85
+ const e = this.getActiveUniverSheet(), t = e == null ? void 0 : e.getActiveSheet();
86
+ if (!e || !t)
87
+ return;
88
+ const o = (await this._injector.get(q).read())[0];
89
+ let i;
90
+ if (o) {
91
+ const c = o.types, C = c.indexOf(M) !== -1 ? await o.getType(M).then((p) => p && p.text()) : "", l = c.indexOf(x) !== -1 ? await o.getType(x).then((p) => p && p.text()) : "";
92
+ i = {
93
+ workbook: e,
94
+ worksheet: t,
95
+ text: C,
96
+ html: l
97
+ };
98
+ }
99
+ return i;
100
+ }
101
+ _beforeClipboardPaste(e) {
102
+ if (!this.hasEventCallback(this.Event.BeforeClipboardPaste))
103
+ return;
104
+ const t = this._generateClipboardPasteParam(e);
105
+ if (t && (this.fireEvent(this.Event.BeforeClipboardPaste, t), t.cancel))
106
+ throw new Error("Before clipboard paste is canceled");
107
+ }
108
+ _clipboardPaste(e) {
109
+ if (!this.hasEventCallback(this.Event.BeforeClipboardPaste))
110
+ return;
111
+ const t = this._generateClipboardPasteParam(e);
112
+ if (t && (this.fireEvent(this.Event.BeforeClipboardPaste, t), t.cancel))
113
+ throw new Error("Clipboard pasted is canceled");
114
+ }
115
+ async _beforeClipboardPasteAsync() {
116
+ if (!this.hasEventCallback(this.Event.BeforeClipboardPaste))
117
+ return;
118
+ if (!j()) {
119
+ this._injector.get(b).warn("[Facade]: The navigator object only supports the browser environment");
120
+ return;
121
+ }
122
+ const e = await this._generateClipboardPasteParamAsync();
123
+ if (e && (this.fireEvent(this.Event.BeforeClipboardPaste, e), e.cancel))
124
+ throw new Error("Before clipboard paste is canceled");
125
+ }
126
+ async _clipboardPasteAsync() {
127
+ if (!this.hasEventCallback(this.Event.ClipboardPasted))
128
+ return;
129
+ if (!j()) {
130
+ this._injector.get(b).warn("[Facade]: The navigator object only supports the browser environment");
131
+ return;
132
+ }
133
+ const e = await this._generateClipboardPasteParamAsync();
134
+ if (e && (this.fireEvent(this.Event.ClipboardPasted, e), e.cancel))
135
+ throw new Error("Clipboard pasted is canceled");
136
+ }
9
137
  customizeColumnHeader(e) {
10
138
  const t = this.getActiveWorkbook();
11
139
  if (!t) {
@@ -13,7 +141,7 @@ class Z extends b {
13
141
  return;
14
142
  }
15
143
  const r = t == null ? void 0 : t.getId();
16
- this._getSheetRenderComponent(r, l.COLUMN).setCustomHeader(e);
144
+ this._getSheetRenderComponent(r, u.COLUMN).setCustomHeader(e);
17
145
  }
18
146
  customizeRowHeader(e) {
19
147
  const t = this.getActiveWorkbook();
@@ -22,23 +150,23 @@ class Z extends b {
22
150
  return;
23
151
  }
24
152
  const r = t == null ? void 0 : t.getId();
25
- this._getSheetRenderComponent(r, l.ROW).setCustomHeader(e);
153
+ this._getSheetRenderComponent(r, u.ROW).setCustomHeader(e);
26
154
  }
27
155
  registerSheetRowHeaderExtension(e, ...t) {
28
- const r = this._getSheetRenderComponent(e, l.ROW), n = r.register(...t);
29
- return i(() => {
156
+ const r = this._getSheetRenderComponent(e, u.ROW), n = r.register(...t);
157
+ return s(() => {
30
158
  n.dispose(), r.makeDirty(!0);
31
159
  });
32
160
  }
33
161
  registerSheetColumnHeaderExtension(e, ...t) {
34
- const r = this._getSheetRenderComponent(e, l.COLUMN), n = r.register(...t);
35
- return i(() => {
162
+ const r = this._getSheetRenderComponent(e, u.COLUMN), n = r.register(...t);
163
+ return s(() => {
36
164
  n.dispose(), r.makeDirty(!0);
37
165
  });
38
166
  }
39
167
  registerSheetMainExtension(e, ...t) {
40
- const r = this._getSheetRenderComponent(e, l.MAIN), n = r.register(...t);
41
- return i(() => {
168
+ const r = this._getSheetRenderComponent(e, u.MAIN), n = r.register(...t);
169
+ return s(() => {
42
170
  n.dispose(), r.makeDirty(!0);
43
171
  });
44
172
  }
@@ -52,13 +180,13 @@ class Z extends b {
52
180
  * @returns {Nullable<RenderComponentType>} The render component.
53
181
  */
54
182
  _getSheetRenderComponent(e, t) {
55
- const n = this._injector.get(c).getRenderById(e);
183
+ const n = this._injector.get(a).getRenderById(e);
56
184
  if (!n)
57
185
  throw new Error(`Render Unit with unitId ${e} not found`);
58
- const { components: o } = n, s = o.get(t);
59
- if (!s)
186
+ const { components: o } = n, i = o.get(t);
187
+ if (!i)
60
188
  throw new Error("Render component not found");
61
- return s;
189
+ return i;
62
190
  }
63
191
  /**
64
192
  * Get sheet hooks.
@@ -69,14 +197,14 @@ class Z extends b {
69
197
  return this._injector.createInstance(I);
70
198
  }
71
199
  }
72
- b.extend(Z);
73
- class J extends R {
200
+ U.extend(oe);
201
+ class ie extends D {
74
202
  openSiderbar(e) {
75
- return this._logDeprecation("openSiderbar"), this._injector.get(V).open(e);
203
+ return this._logDeprecation("openSiderbar"), this._injector.get(G).open(e);
76
204
  }
77
205
  openDialog(e) {
78
206
  this._logDeprecation("openDialog");
79
- const r = this._injector.get(N).open({
207
+ const r = this._injector.get(Q).open({
80
208
  ...e,
81
209
  onClose: () => {
82
210
  r.dispose();
@@ -85,100 +213,111 @@ class J extends R {
85
213
  return r;
86
214
  }
87
215
  _logDeprecation(e) {
88
- this._injector.get(x).warn("[FWorkbook]", `${e} is deprecated. Please use the function of the same name on "FUniver".`);
216
+ this._injector.get(b).warn("[FWorkbook]", `${e} is deprecated. Please use the function of the same name on "FUniver".`);
89
217
  }
90
218
  onCellClick(e) {
91
- const t = this._injector.get(d);
92
- return i(
93
- t.currentClickedCell$.pipe(p((r) => !!r)).subscribe(e)
219
+ const t = this._injector.get(h);
220
+ return s(
221
+ t.currentClickedCell$.pipe(S((r) => !!r)).subscribe(e)
94
222
  );
95
223
  }
96
224
  onCellHover(e) {
97
- const t = this._injector.get(d);
98
- return i(
99
- t.currentRichText$.pipe(p((r) => !!r)).subscribe(e)
225
+ const t = this._injector.get(h);
226
+ return s(
227
+ t.currentRichText$.pipe(S((r) => !!r)).subscribe(e)
100
228
  );
101
229
  }
102
230
  onCellPointerDown(e) {
103
- const t = this._injector.get(d);
104
- return i(
231
+ const t = this._injector.get(h);
232
+ return s(
105
233
  t.currentPointerDownCell$.subscribe(e)
106
234
  );
107
235
  }
108
236
  onCellPointerUp(e) {
109
- const t = this._injector.get(d);
110
- return i(
237
+ const t = this._injector.get(h);
238
+ return s(
111
239
  t.currentPointerUpCell$.subscribe(e)
112
240
  );
113
241
  }
114
242
  onPointerMove(e) {
115
- const t = this._injector.get(d);
116
- return i(
117
- t.currentCellPosWithEvent$.pipe(p((r) => !!r)).subscribe((r) => {
243
+ const t = this._injector.get(h);
244
+ return s(
245
+ t.currentCellPosWithEvent$.pipe(S((r) => !!r)).subscribe((r) => {
118
246
  e(r, r.event.buttons);
119
247
  })
120
248
  );
121
249
  }
122
250
  startEditing() {
123
- return this._injector.get(h).syncExecuteCommand(m.id, {
124
- eventType: _.Dblclick,
251
+ return this._injector.get(g).syncExecuteCommand(v.id, {
252
+ eventType: w.Dblclick,
125
253
  unitId: this._workbook.getUnitId(),
126
254
  visible: !0
127
255
  });
128
256
  }
129
257
  async endEditing(e) {
130
- return this._injector.get(h).syncExecuteCommand(m.id, {
131
- eventType: _.Keyboard,
132
- keycode: e ? w.ENTER : w.ESC,
258
+ return this._injector.get(g).syncExecuteCommand(v.id, {
259
+ eventType: w.Keyboard,
260
+ keycode: e ? B.ENTER : B.ESC,
133
261
  visible: !1,
134
262
  unitId: this._workbook.getUnitId()
135
- }), await j(0), !0;
263
+ }), await H(0), !0;
136
264
  }
265
+ endEditingAsync(e = !0) {
266
+ return this.endEditing(e);
267
+ }
268
+ /**
269
+ * Get scroll state of specified sheet.
270
+ * @returns {IScrollState} scroll state
271
+ * @example
272
+ * ``` ts
273
+ * univerAPI.getActiveWorkbook().getScrollStateBySheetId($sheetId)
274
+ * ```
275
+ */
137
276
  getScrollStateBySheetId(e) {
138
- const t = this._workbook.getUnitId(), n = this._injector.get(c).getRenderById(t);
139
- return n ? n.with(v).getScrollStateByParam({ unitId: t, sheetId: e }) : null;
277
+ const t = this._workbook.getUnitId(), n = this._injector.get(a).getRenderById(t);
278
+ return n ? n.with(_).getScrollStateByParam({ unitId: t, sheetId: e }) : null;
140
279
  }
141
280
  disableSelection() {
142
- const e = this._workbook.getUnitId(), r = this._injector.get(c).getRenderById(e);
143
- r && r.with(S).disableSelection();
281
+ const e = this._workbook.getUnitId(), r = this._injector.get(a).getRenderById(e);
282
+ r && r.with(m).disableSelection();
144
283
  }
145
284
  enableSelection() {
146
- const e = this._workbook.getUnitId(), r = this._injector.get(c).getRenderById(e);
147
- r && r.with(S).enableSelection();
285
+ const e = this._workbook.getUnitId(), r = this._injector.get(a).getRenderById(e);
286
+ r && r.with(m).enableSelection();
148
287
  }
149
288
  transparentSelection() {
150
- const e = this._workbook.getUnitId(), r = this._injector.get(c).getRenderById(e);
151
- r && r.with(S).transparentSelection();
289
+ const e = this._workbook.getUnitId(), r = this._injector.get(a).getRenderById(e);
290
+ r && r.with(m).transparentSelection();
152
291
  }
153
292
  showSelection() {
154
- const e = this._workbook.getUnitId(), r = this._injector.get(c).getRenderById(e);
155
- r && r.with(S).showSelection();
293
+ const e = this._workbook.getUnitId(), r = this._injector.get(a).getRenderById(e);
294
+ r && r.with(m).showSelection();
156
295
  }
157
296
  }
158
- R.extend(J);
159
- class X extends M {
297
+ D.extend(ie);
298
+ class se extends W {
160
299
  refreshCanvas() {
161
- const e = this._injector.get(c), t = this._fWorkbook.id, r = e.getRenderById(t);
300
+ const e = this._injector.get(a), t = this._fWorkbook.id, r = e.getRenderById(t);
162
301
  if (!r)
163
302
  throw new Error(`Render Unit with unitId ${t} not found`);
164
- r.with(C).reCalculate();
303
+ r.with(f).reCalculate();
165
304
  const n = r.mainComponent;
166
305
  if (!n)
167
306
  throw new Error("Main component not found");
168
307
  n.makeDirty();
169
308
  }
170
309
  zoom(e) {
171
- return this._injector.get(h).executeCommand(W.id, {
310
+ return this._injector.get(g).syncExecuteCommand(Y.id, {
172
311
  unitId: this._workbook.getUnitId(),
173
312
  subUnitId: this._worksheet.getSheetId(),
174
313
  zoomRatio: e
175
- });
314
+ }), this;
176
315
  }
177
316
  getZoom() {
178
317
  return this._worksheet.getZoomRatio();
179
318
  }
180
319
  getVisibleRange() {
181
- const e = this._workbook.getUnitId(), r = this._injector.get(c).getRenderById(e);
320
+ const e = this._workbook.getUnitId(), r = this._injector.get(a).getRenderById(e);
182
321
  let n = {
183
322
  startColumn: 0,
184
323
  startRow: 0,
@@ -186,60 +325,60 @@ class X extends M {
186
325
  endRow: 0
187
326
  };
188
327
  if (!r) return n;
189
- const s = r.with(C).getCurrentSkeleton();
190
- if (!s) return n;
191
- const g = s == null ? void 0 : s.getVisibleRanges();
192
- if (!g) return n;
193
- n = s.getVisibleRangeByViewport(B.VIEW_MAIN);
194
- for (const [E, u] of g)
195
- T.indexOf(E) !== -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));
328
+ const i = r.with(f).getCurrentSkeleton();
329
+ if (!i) return n;
330
+ const c = i == null ? void 0 : i.getVisibleRanges();
331
+ if (!c) return n;
332
+ n = i.getVisibleRangeByViewport(L.VIEW_MAIN);
333
+ for (const [C, l] of c)
334
+ K.indexOf(C) !== -1 && (n.startColumn = Math.min(n.startColumn, l.startColumn), n.startRow = Math.min(n.startRow, l.startRow), n.endColumn = Math.max(n.endColumn, l.endColumn), n.endRow = Math.max(n.endRow, l.endRow));
196
335
  return n;
197
336
  }
198
337
  scrollToCell(e, t) {
199
- const r = this._workbook.getUnitId(), o = this._injector.get(c).getRenderById(r);
200
- o && (o == null ? void 0 : o.with(F)).scrollToCell(e, t);
338
+ const r = this._workbook.getUnitId(), o = this._injector.get(a).getRenderById(r);
339
+ o && (o == null ? void 0 : o.with(z)).scrollToCell(e, t);
201
340
  }
202
341
  getScrollState() {
203
- const e = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), n = this._injector.get(c).getRenderById(e);
204
- return n ? n.with(v).getScrollStateByParam({ unitId: e, sheetId: t }) : null;
342
+ const e = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), n = this._injector.get(a).getRenderById(e);
343
+ return n ? n.with(_).getScrollStateByParam({ unitId: e, sheetId: t }) : null;
205
344
  }
206
345
  onScroll(e) {
207
346
  var o;
208
- const t = this._workbook.getUnitId(), n = (o = this._injector.get(c).getRenderById(t)) == null ? void 0 : o.with(v);
347
+ const t = this._workbook.getUnitId(), n = (o = this._injector.get(a).getRenderById(t)) == null ? void 0 : o.with(_);
209
348
  if (n) {
210
- const s = n.validViewportScrollInfo$.subscribe((g) => {
211
- e(g);
349
+ const i = n.validViewportScrollInfo$.subscribe((c) => {
350
+ e(c);
212
351
  });
213
- return i(s);
352
+ return s(i);
214
353
  }
215
- return i(() => {
354
+ return s(() => {
216
355
  });
217
356
  }
218
357
  }
219
- M.extend(X);
220
- class q extends f {
358
+ W.extend(se);
359
+ class ae extends F {
221
360
  setPermissionDialogVisible(e) {
222
361
  this._permissionService.setShowComponents(e);
223
362
  }
224
363
  }
225
- f.extend(q);
226
- class G extends I {
364
+ F.extend(ae);
365
+ class ce extends I {
227
366
  onCellPointerMove(e) {
228
- return i(this._injector.get(d).currentPosition$.subscribe(e));
367
+ return s(this._injector.get(h).currentPosition$.subscribe(e));
229
368
  }
230
369
  onCellPointerOver(e) {
231
- return i(this._injector.get(d).currentCell$.subscribe(e));
370
+ return s(this._injector.get(h).currentCell$.subscribe(e));
232
371
  }
233
372
  onCellDragOver(e) {
234
- return i(this._injector.get(k).currentCell$.subscribe(e));
373
+ return s(this._injector.get(E).currentCell$.subscribe(e));
235
374
  }
236
375
  onCellDrop(e) {
237
- return i(this._injector.get(k).endCell$.subscribe(e));
376
+ return s(this._injector.get(E).endCell$.subscribe(e));
238
377
  }
239
- onCellRender(e, t = U.Style, r = z.DATA_VALIDATION) {
240
- return this._injector.get(L).intercept(Y.CELL_CONTENT, {
378
+ onCellRender(e, t = N.Style, r = ne.DATA_VALIDATION) {
379
+ return this._injector.get(te).intercept(re.CELL_CONTENT, {
241
380
  effect: t,
242
- handler: (n, o, s) => s({
381
+ handler: (n, o, i) => i({
243
382
  ...n,
244
383
  customRender: [
245
384
  ...(n == null ? void 0 : n.customRender) || [],
@@ -250,23 +389,38 @@ class G extends I {
250
389
  });
251
390
  }
252
391
  onBeforeCellEdit(e) {
253
- return this._injector.get(h).beforeCommandExecuted((t) => {
392
+ return this._injector.get(g).beforeCommandExecuted((t) => {
254
393
  const r = t.params;
255
- t.id === m.id && r.visible && e(r);
394
+ t.id === v.id && r.visible && e(r);
256
395
  });
257
396
  }
258
397
  onAfterCellEdit(e) {
259
- return this._injector.get(h).onCommandExecuted((t) => {
398
+ return this._injector.get(g).onCommandExecuted((t) => {
260
399
  const r = t.params;
261
- t.id === m.id && !r.visible && e(r);
400
+ t.id === v.id && !r.visible && e(r);
262
401
  });
263
402
  }
264
403
  }
265
- I.extend(G);
266
- class Q extends y {
404
+ I.extend(ce);
405
+ class de extends A {
406
+ get BeforeClipboardChange() {
407
+ return "BeforeClipboardChange";
408
+ }
409
+ get ClipboardChanged() {
410
+ return "ClipboardChanged";
411
+ }
412
+ get BeforeClipboardPaste() {
413
+ return "BeforeClipboardPaste";
414
+ }
415
+ get ClipboardPasted() {
416
+ return "ClipboardPasted";
417
+ }
418
+ }
419
+ A.extend(de);
420
+ class he extends O {
267
421
  getCell() {
268
- const e = this._injector.get(c), t = this._workbook.getUnitId(), r = this._worksheet.getSheetId();
269
- return e.getRenderById(t).with(C).getWorksheetSkeleton(r).skeleton.getCellWithCoordByIndex(this._range.startRow, this._range.startColumn);
422
+ const e = this._injector.get(a), t = this._workbook.getUnitId(), r = this._worksheet.getSheetId();
423
+ return e.getRenderById(t).with(f).getWorksheetSkeleton(r).skeleton.getCellWithCoordByIndex(this._range.startRow, this._range.startColumn);
270
424
  }
271
425
  getCellRect() {
272
426
  const { startX: e, startY: t, endX: r, endY: n } = this.getCell(), o = { x: e, y: t, width: r - e, height: n - t, top: t, left: e, bottom: n, right: r };
@@ -274,7 +428,7 @@ class Q extends y {
274
428
  }
275
429
  generateHTML() {
276
430
  var t;
277
- const e = this._injector.get(O).generateCopyContent(
431
+ const e = this._injector.get(T).generateCopyContent(
278
432
  this._workbook.getUnitId(),
279
433
  this._worksheet.getSheetId(),
280
434
  this._range
@@ -282,7 +436,7 @@ class Q extends y {
282
436
  return (t = e == null ? void 0 : e.html) != null ? t : "";
283
437
  }
284
438
  attachPopup(e) {
285
- const { key: t, disposableCollection: r } = ee(e, this._injector.get(K)), o = this._injector.get(A).attachPopupToCell(
439
+ const { key: t, disposableCollection: r } = le(e, this._injector.get(ee)), o = this._injector.get(X).attachPopupToCell(
286
440
  this._range.startRow,
287
441
  this._range.startColumn,
288
442
  { ...e, componentKey: t },
@@ -292,7 +446,7 @@ class Q extends y {
292
446
  return o ? (r.add(o), r) : (r.dispose(), null);
293
447
  }
294
448
  attachAlertPopup(e) {
295
- const t = this._injector.get(H), r = {
449
+ const t = this._injector.get(Z), r = {
296
450
  workbook: this._workbook,
297
451
  worksheet: this._worksheet,
298
452
  row: this._range.startRow,
@@ -310,24 +464,24 @@ class Q extends y {
310
464
  };
311
465
  }
312
466
  highlight(e, t) {
313
- const r = this._injector.get($), n = r.addShape({ range: this._range, style: e, primary: t });
467
+ const r = this._injector.get(J), n = r.addShape({ range: this._range, style: e, primary: t });
314
468
  if (!n)
315
469
  throw new Error("Failed to highlight current range");
316
- return i(() => {
470
+ return s(() => {
317
471
  r.removeShape(n);
318
472
  });
319
473
  }
320
474
  }
321
- y.extend(Q);
322
- function ee(a, e) {
323
- const { componentKey: t, isVue3: r } = a;
475
+ O.extend(he);
476
+ function le(d, e) {
477
+ const { componentKey: t, isVue3: r } = d;
324
478
  let n;
325
- const o = new P();
326
- return typeof t == "string" ? n = t : (n = `External_${D(6)}`, o.add(e.register(n, t, { framework: r ? "vue3" : "react" }))), {
479
+ const o = new $();
480
+ return typeof t == "string" ? n = t : (n = `External_${V(6)}`, o.add(e.register(n, t, { framework: r ? "vue3" : "react" }))), {
327
481
  key: n,
328
482
  disposableCollection: o
329
483
  };
330
484
  }
331
485
  export {
332
- ee as transformComponentKey
486
+ le as transformComponentKey
333
487
  };