@univerjs/sheets-ui 0.5.1 → 0.5.2-nightly.202412281605

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/lib/cjs/facade.js +1 -1
  2. package/lib/cjs/index.js +52 -30
  3. package/lib/es/facade.js +180 -237
  4. package/lib/es/index.js +20005 -19632
  5. package/lib/index.css +1 -1
  6. package/lib/types/commands/commands/__tests__/create-sheet-skeleton-test-bed.d.ts +22 -0
  7. package/lib/types/commands/commands/__tests__/sheet-skeleton.spec.d.ts +16 -0
  8. package/lib/types/commands/commands/add-worksheet-merge.command.d.ts +2 -1
  9. package/lib/types/commands/commands/auto-fill.command.d.ts +2 -2
  10. package/lib/types/commands/commands/set-selection.command.d.ts +2 -2
  11. package/lib/types/controllers/auto-fill.controller.d.ts +0 -3
  12. package/lib/types/controllers/clipboard/clipboard.controller.d.ts +0 -4
  13. package/lib/types/controllers/clipboard/utils.d.ts +4 -0
  14. package/lib/types/controllers/editor/editing.render-controller.d.ts +1 -1
  15. package/lib/types/controllers/hover-render.controller.d.ts +1 -1
  16. package/lib/types/controllers/move-range.controller.d.ts +1 -1
  17. package/lib/types/controllers/render-controllers/scroll.render-controller.d.ts +10 -3
  18. package/lib/types/facade/f-workbook.d.ts +67 -3
  19. package/lib/types/facade/f-worksheet.d.ts +63 -0
  20. package/lib/types/index.d.ts +61 -66
  21. package/lib/types/services/auto-fill/auto-fill.service.d.ts +7 -6
  22. package/lib/types/services/cell-alert-manager.service.d.ts +3 -3
  23. package/lib/types/services/clipboard/__tests__/clipboard-test-bed.d.ts +1 -0
  24. package/lib/types/services/clipboard/clipboard.service.d.ts +5 -3
  25. package/lib/types/services/clipboard/copy-content-cache.d.ts +1 -0
  26. package/lib/types/services/clipboard/html-to-usm/utils.d.ts +1 -0
  27. package/lib/types/services/clipboard/type.d.ts +1 -0
  28. package/lib/types/services/hover-manager.service.d.ts +27 -3
  29. package/lib/types/services/mark-selection/mark-selection.service.d.ts +3 -1
  30. package/lib/types/services/scroll-manager.service.d.ts +5 -6
  31. package/lib/types/services/selection/base-selection-render.service.d.ts +21 -9
  32. package/lib/types/services/selection/mobile-selection-render.service.d.ts +1 -1
  33. package/lib/types/services/selection/selection-control.d.ts +20 -6
  34. package/lib/types/services/selection/selection-render-model.d.ts +0 -1
  35. package/lib/types/services/selection/selection-render.service.d.ts +12 -3
  36. package/lib/types/services/selection/selection-shape-extension.d.ts +1 -1
  37. package/lib/types/services/shortcut-experience.service.d.ts +0 -1
  38. package/lib/types/services/utils/doc-skeleton-util.d.ts +1 -1
  39. package/lib/types/services/utils/drawing-position-util.d.ts +35 -0
  40. package/lib/types/views/defined-name/component-name.d.ts +0 -1
  41. package/lib/types/views/permission/panel-detail/PermissionDetailMainPart.d.ts +1 -0
  42. package/lib/umd/facade.js +1 -1
  43. package/lib/umd/index.js +50 -28
  44. package/package.json +16 -15
  45. package/LICENSE +0 -176
package/lib/es/facade.js CHANGED
@@ -1,22 +1,19 @@
1
- var D = Object.defineProperty;
2
- var U = (s, e, t) => e in s ? D(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
- var a = (s, e, t) => U(s, typeof e != "symbol" ? e + "" : e, t);
4
- import { FUniver as y, toDisposable as c, ILogService as $, ICommandService as g, awaitTime as O, Inject as W, Injector as B, Disposable as T, InterceptorEffectEnum as F, DisposableCollection as A, generateRandomId as H } from "@univerjs/core";
5
- import { IRenderManagerService as p, DeviceInputEventType as v, SpreadsheetSkeleton as N } from "@univerjs/engine-render";
6
- import { FSheetHooks as C, FWorkbook as R, FWorksheet as M, FPermission as E, FRange as P } from "@univerjs/sheets/facade";
7
- import { SHEET_VIEW_KEY as d, HoverManagerService as S, SetCellEditVisibleOperation as k, DragManagerService as f, SheetSkeletonManagerService as L, ISheetClipboardService as Y, SheetCanvasPopManagerService as K, CellAlertManagerService as X, IMarkSelectionService as V } from "@univerjs/sheets-ui";
8
- import { ISidebarService as z, IDialogService as J, KeyCode as b, ComponentManager as q } from "@univerjs/ui";
9
- import { filter as w, BehaviorSubject as x } from "rxjs";
10
- import { SheetInterceptorService as G, INTERCEPTOR_POINT as Q, InterceptCellContentPriority as Z } from "@univerjs/sheets";
11
- class ee extends y {
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 {
12
9
  customizeColumnHeader(e) {
13
10
  const t = this.getActiveWorkbook();
14
11
  if (!t) {
15
12
  console.error("WorkBook not exist");
16
13
  return;
17
14
  }
18
- const n = t == null ? void 0 : t.getId();
19
- this._getSheetRenderComponent(n, d.COLUMN).setCustomHeader(e);
15
+ const r = t == null ? void 0 : t.getId();
16
+ this._getSheetRenderComponent(r, l.COLUMN).setCustomHeader(e);
20
17
  }
21
18
  customizeRowHeader(e) {
22
19
  const t = this.getActiveWorkbook();
@@ -24,25 +21,25 @@ class ee extends y {
24
21
  console.error("WorkBook not exist");
25
22
  return;
26
23
  }
27
- const n = t == null ? void 0 : t.getId();
28
- this._getSheetRenderComponent(n, d.ROW).setCustomHeader(e);
24
+ const r = t == null ? void 0 : t.getId();
25
+ this._getSheetRenderComponent(r, l.ROW).setCustomHeader(e);
29
26
  }
30
27
  registerSheetRowHeaderExtension(e, ...t) {
31
- const n = this._getSheetRenderComponent(e, d.ROW), r = n.register(...t);
32
- return c(() => {
33
- r.dispose(), n.makeDirty(!0);
28
+ const r = this._getSheetRenderComponent(e, l.ROW), n = r.register(...t);
29
+ return i(() => {
30
+ n.dispose(), r.makeDirty(!0);
34
31
  });
35
32
  }
36
33
  registerSheetColumnHeaderExtension(e, ...t) {
37
- const n = this._getSheetRenderComponent(e, d.COLUMN), r = n.register(...t);
38
- return c(() => {
39
- r.dispose(), n.makeDirty(!0);
34
+ const r = this._getSheetRenderComponent(e, l.COLUMN), n = r.register(...t);
35
+ return i(() => {
36
+ n.dispose(), r.makeDirty(!0);
40
37
  });
41
38
  }
42
39
  registerSheetMainExtension(e, ...t) {
43
- const n = this._getSheetRenderComponent(e, d.MAIN), r = n.register(...t);
44
- return c(() => {
45
- r.dispose(), n.makeDirty(!0);
40
+ const r = this._getSheetRenderComponent(e, l.MAIN), n = r.register(...t);
41
+ return i(() => {
42
+ n.dispose(), r.makeDirty(!0);
46
43
  });
47
44
  }
48
45
  /**
@@ -55,13 +52,13 @@ class ee extends y {
55
52
  * @returns {Nullable<RenderComponentType>} The render component.
56
53
  */
57
54
  _getSheetRenderComponent(e, t) {
58
- const r = this._injector.get(p).getRenderById(e);
59
- if (!r)
55
+ const n = this._injector.get(c).getRenderById(e);
56
+ if (!n)
60
57
  throw new Error(`Render Unit with unitId ${e} not found`);
61
- const { components: o } = r, i = o.get(t);
62
- if (!i)
58
+ const { components: o } = n, s = o.get(t);
59
+ if (!s)
63
60
  throw new Error("Render component not found");
64
- return i;
61
+ return s;
65
62
  }
66
63
  /**
67
64
  * Get sheet hooks.
@@ -69,269 +66,215 @@ class ee extends y {
69
66
  * @returns {FSheetHooks} FSheetHooks instance
70
67
  */
71
68
  getSheetHooks() {
72
- return this._injector.createInstance(C);
69
+ return this._injector.createInstance(I);
73
70
  }
74
71
  }
75
- y.extend(ee);
76
- class te extends R {
72
+ b.extend(Z);
73
+ class J extends R {
77
74
  openSiderbar(e) {
78
- return this._logDeprecation("openSiderbar"), this._injector.get(z).open(e);
75
+ return this._logDeprecation("openSiderbar"), this._injector.get(V).open(e);
79
76
  }
80
77
  openDialog(e) {
81
78
  this._logDeprecation("openDialog");
82
- const n = this._injector.get(J).open({
79
+ const r = this._injector.get(N).open({
83
80
  ...e,
84
81
  onClose: () => {
85
- n.dispose();
82
+ r.dispose();
86
83
  }
87
84
  });
88
- return n;
85
+ return r;
89
86
  }
90
87
  _logDeprecation(e) {
91
- this._injector.get($).warn("[FWorkbook]", `${e} is deprecated. Please use the function of the same name on "FUniver".`);
88
+ this._injector.get(x).warn("[FWorkbook]", `${e} is deprecated. Please use the function of the same name on "FUniver".`);
92
89
  }
93
90
  onCellClick(e) {
94
- const t = this._injector.get(S);
95
- return c(
96
- t.currentClickedCell$.pipe(w((n) => !!n)).subscribe(e)
91
+ const t = this._injector.get(d);
92
+ return i(
93
+ t.currentClickedCell$.pipe(p((r) => !!r)).subscribe(e)
97
94
  );
98
95
  }
99
96
  onCellHover(e) {
100
- const t = this._injector.get(S);
101
- return c(
102
- t.currentRichText$.pipe(w((n) => !!n)).subscribe(e)
97
+ const t = this._injector.get(d);
98
+ return i(
99
+ t.currentRichText$.pipe(p((r) => !!r)).subscribe(e)
100
+ );
101
+ }
102
+ onCellPointerDown(e) {
103
+ const t = this._injector.get(d);
104
+ return i(
105
+ t.currentPointerDownCell$.subscribe(e)
106
+ );
107
+ }
108
+ onCellPointerUp(e) {
109
+ const t = this._injector.get(d);
110
+ return i(
111
+ t.currentPointerUpCell$.subscribe(e)
112
+ );
113
+ }
114
+ onPointerMove(e) {
115
+ const t = this._injector.get(d);
116
+ return i(
117
+ t.currentCellPosWithEvent$.pipe(p((r) => !!r)).subscribe((r) => {
118
+ e(r, r.event.buttons);
119
+ })
103
120
  );
104
121
  }
105
122
  startEditing() {
106
- return this._injector.get(g).syncExecuteCommand(k.id, {
107
- eventType: v.Dblclick,
123
+ return this._injector.get(h).syncExecuteCommand(m.id, {
124
+ eventType: _.Dblclick,
108
125
  unitId: this._workbook.getUnitId(),
109
126
  visible: !0
110
127
  });
111
128
  }
112
129
  async endEditing(e) {
113
- return this._injector.get(g).syncExecuteCommand(k.id, {
114
- eventType: v.Keyboard,
115
- keycode: e ? b.ENTER : b.ESC,
130
+ return this._injector.get(h).syncExecuteCommand(m.id, {
131
+ eventType: _.Keyboard,
132
+ keycode: e ? w.ENTER : w.ESC,
116
133
  visible: !1,
117
134
  unitId: this._workbook.getUnitId()
118
- }), await O(0), !0;
119
- }
120
- }
121
- R.extend(te);
122
- function ne(s, e) {
123
- const { startRow: t, startColumn: n, endRow: r, endColumn: o, rangeType: i } = e, I = r < t ? r : t, u = r < t ? t : r, _ = o < n ? o : n, j = o < n ? n : o, h = s.getNoMergeCellPositionByIndex(I, _), l = s.getNoMergeCellPositionByIndex(u, j);
124
- return {
125
- startRow: t,
126
- startColumn: n,
127
- endRow: r,
128
- endColumn: o,
129
- rangeType: i,
130
- startY: (h == null ? void 0 : h.startY) || 0,
131
- endY: (l == null ? void 0 : l.endY) || 0,
132
- startX: (h == null ? void 0 : h.startX) || 0,
133
- endX: (l == null ? void 0 : l.endX) || 0
134
- };
135
- }
136
- var re = Object.defineProperty, oe = Object.getOwnPropertyDescriptor, se = (s, e, t, n) => {
137
- for (var r = n > 1 ? void 0 : n ? oe(e, t) : e, o = s.length - 1, i; o >= 0; o--)
138
- (i = s[o]) && (r = (n ? i(e, t, r) : i(r)) || r);
139
- return n && r && re(e, t, r), r;
140
- }, ie = (s, e) => (t, n) => e(t, n, s);
141
- let m = class extends T {
142
- constructor(e, t) {
143
- super();
144
- a(this, "_currentSkeletonSearchParam", {
145
- sheetId: ""
146
- });
147
- a(this, "_sheetSkeletonParam", []);
148
- a(this, "_currentSkeleton$", new x(null));
149
- a(this, "currentSkeleton$", this._currentSkeleton$.asObservable());
150
- /**
151
- * CurrentSkeletonBefore for pre-triggered logic during registration
152
- */
153
- a(this, "_currentSkeletonBefore$", new x(null));
154
- a(this, "currentSkeletonBefore$", this._currentSkeletonBefore$.asObservable());
155
- this._context = e, this._injector = t, this.disposeWithMe(() => {
156
- this._currentSkeletonBefore$.complete(), this._currentSkeleton$.complete(), this._sheetSkeletonParam = [];
157
- }), this._initRemoveSheet();
158
- }
159
- _initRemoveSheet() {
160
- this.disposeWithMe(this._context.unit.sheetDisposed$.subscribe((e) => {
161
- this.disposeSkeleton({
162
- sheetId: e.getSheetId()
163
- });
164
- }));
135
+ }), await j(0), !0;
165
136
  }
166
- getCurrentSkeleton() {
167
- var e;
168
- return (e = this.getCurrent()) == null ? void 0 : e.skeleton;
137
+ 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;
169
140
  }
170
- getCurrent() {
171
- return this._getSkeleton(this._currentSkeletonSearchParam);
141
+ disableSelection() {
142
+ const e = this._workbook.getUnitId(), r = this._injector.get(c).getRenderById(e);
143
+ r && r.with(S).disableSelection();
172
144
  }
173
- getWorksheetSkeleton(e) {
174
- return this._getSkeleton({ sheetId: e });
175
- }
176
- /**
177
- * unitId is never read?
178
- */
179
- getUnitSkeleton(e, t) {
180
- const n = this._getSkeleton({ sheetId: t });
181
- return n != null && (n.unitId = e), n;
182
- }
183
- setCurrent(e) {
184
- this._setCurrent(e);
185
- }
186
- _setCurrent(e) {
187
- const t = this._getSkeleton(e), n = this._context.unitId;
188
- if (t != null)
189
- this._reCalculate(t);
190
- else {
191
- const { sheetId: i } = e, u = this._context.unit.getSheetBySheetId(e.sheetId);
192
- if (u == null)
193
- return;
194
- const _ = this._buildSkeleton(u);
195
- this._sheetSkeletonParam.push({
196
- unitId: n,
197
- sheetId: i,
198
- skeleton: _,
199
- dirty: !1
200
- });
201
- }
202
- this._currentSkeletonSearchParam = e;
203
- const r = this._currentSkeletonSearchParam.sheetId, o = this.getUnitSkeleton(n, r);
204
- this._currentSkeletonBefore$.next(o), this._currentSkeleton$.next(o);
145
+ enableSelection() {
146
+ const e = this._workbook.getUnitId(), r = this._injector.get(c).getRenderById(e);
147
+ r && r.with(S).enableSelection();
205
148
  }
206
- reCalculate() {
207
- const e = this.getCurrent();
208
- e != null && this._reCalculate(e);
149
+ transparentSelection() {
150
+ const e = this._workbook.getUnitId(), r = this._injector.get(c).getRenderById(e);
151
+ r && r.with(S).transparentSelection();
209
152
  }
210
- _reCalculate(e) {
211
- e.dirty && (e.skeleton.makeDirty(!0), e.dirty = !1), e.skeleton.calculate();
153
+ showSelection() {
154
+ const e = this._workbook.getUnitId(), r = this._injector.get(c).getRenderById(e);
155
+ r && r.with(S).showSelection();
212
156
  }
213
- /**
214
- * Make param dirty, if param is dirty, then the skeleton will be makeDirty in _reCalculate()
215
- * @param searchParm
216
- * @param state
217
- */
218
- makeDirty(e, t = !0) {
219
- const n = this._getSkeleton(e);
220
- n != null && (n.dirty = t);
221
- }
222
- getOrCreateSkeleton(e) {
223
- const t = this._getSkeleton(e);
224
- if (t)
225
- return t.skeleton;
226
- const r = this._context.unit.getSheetBySheetId(e.sheetId);
227
- if (!r)
228
- return;
229
- const o = this._buildSkeleton(r);
230
- return this._sheetSkeletonParam.push({
231
- unitId: this._context.unitId,
232
- sheetId: e.sheetId,
233
- skeleton: o,
234
- dirty: !1
235
- }), o;
236
- }
237
- disposeSkeleton(e) {
238
- const t = this._sheetSkeletonParam.findIndex((n) => n.sheetId === e.sheetId);
239
- t > -1 && (this._sheetSkeletonParam[t].skeleton.dispose(), this._sheetSkeletonParam.splice(t, 1));
240
- }
241
- /** @deprecated Use function `attachRangeWithCoord` instead. */
242
- attachRangeWithCoord(e) {
243
- const t = this.getCurrentSkeleton();
244
- return t ? ne(t, e) : null;
245
- }
246
- _getSkeleton(e) {
247
- const t = this._sheetSkeletonParam.find((n) => n.sheetId === e.sheetId);
248
- return t != null && (t.commandId = e.commandId), t;
249
- }
250
- _buildSkeleton(e) {
251
- const t = e.getConfig();
252
- return this._injector.createInstance(
253
- N,
254
- e,
255
- t,
256
- e.getCellMatrix(),
257
- this._context.unit.getStyles()
258
- );
259
- }
260
- };
261
- m = se([
262
- ie(1, W(B))
263
- ], m);
264
- class ce extends M {
157
+ }
158
+ R.extend(J);
159
+ class X extends M {
265
160
  refreshCanvas() {
266
- const e = this._injector.get(p), t = this._fWorkbook.id, n = e.getRenderById(t);
267
- if (!n)
268
- throw new Error(`Render Unit with unitId ${t} not found`);
269
- n.with(m).reCalculate();
270
- const r = n.mainComponent;
161
+ const e = this._injector.get(c), t = this._fWorkbook.id, r = e.getRenderById(t);
271
162
  if (!r)
163
+ throw new Error(`Render Unit with unitId ${t} not found`);
164
+ r.with(C).reCalculate();
165
+ const n = r.mainComponent;
166
+ if (!n)
272
167
  throw new Error("Main component not found");
273
- r.makeDirty();
168
+ n.makeDirty();
169
+ }
170
+ zoom(e) {
171
+ return this._injector.get(h).executeCommand(W.id, {
172
+ unitId: this._workbook.getUnitId(),
173
+ subUnitId: this._worksheet.getSheetId(),
174
+ zoomRatio: e
175
+ });
176
+ }
177
+ getZoom() {
178
+ return this._worksheet.getZoomRatio();
179
+ }
180
+ getVisibleRange() {
181
+ const e = this._workbook.getUnitId(), r = this._injector.get(c).getRenderById(e);
182
+ let n = {
183
+ startColumn: 0,
184
+ startRow: 0,
185
+ endColumn: 0,
186
+ endRow: 0
187
+ };
188
+ 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));
196
+ return n;
197
+ }
198
+ 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);
201
+ }
202
+ 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;
205
+ }
206
+ onScroll(e) {
207
+ var o;
208
+ const t = this._workbook.getUnitId(), n = (o = this._injector.get(c).getRenderById(t)) == null ? void 0 : o.with(v);
209
+ if (n) {
210
+ const s = n.validViewportScrollInfo$.subscribe((g) => {
211
+ e(g);
212
+ });
213
+ return i(s);
214
+ }
215
+ return i(() => {
216
+ });
274
217
  }
275
218
  }
276
- M.extend(ce);
277
- class ae extends E {
219
+ M.extend(X);
220
+ class q extends f {
278
221
  setPermissionDialogVisible(e) {
279
222
  this._permissionService.setShowComponents(e);
280
223
  }
281
224
  }
282
- E.extend(ae);
283
- class he extends C {
225
+ f.extend(q);
226
+ class G extends I {
284
227
  onCellPointerMove(e) {
285
- return c(this._injector.get(S).currentPosition$.subscribe(e));
228
+ return i(this._injector.get(d).currentPosition$.subscribe(e));
286
229
  }
287
230
  onCellPointerOver(e) {
288
- return c(this._injector.get(S).currentCell$.subscribe(e));
231
+ return i(this._injector.get(d).currentCell$.subscribe(e));
289
232
  }
290
233
  onCellDragOver(e) {
291
- return c(this._injector.get(f).currentCell$.subscribe(e));
234
+ return i(this._injector.get(k).currentCell$.subscribe(e));
292
235
  }
293
236
  onCellDrop(e) {
294
- return c(this._injector.get(f).endCell$.subscribe(e));
237
+ return i(this._injector.get(k).endCell$.subscribe(e));
295
238
  }
296
- onCellRender(e, t = F.Style, n = Z.DATA_VALIDATION) {
297
- return this._injector.get(G).intercept(Q.CELL_CONTENT, {
239
+ onCellRender(e, t = U.Style, r = z.DATA_VALIDATION) {
240
+ return this._injector.get(L).intercept(Y.CELL_CONTENT, {
298
241
  effect: t,
299
- handler: (r, o, i) => i({
300
- ...r,
242
+ handler: (n, o, s) => s({
243
+ ...n,
301
244
  customRender: [
302
- ...(r == null ? void 0 : r.customRender) || [],
245
+ ...(n == null ? void 0 : n.customRender) || [],
303
246
  ...e || []
304
247
  ]
305
248
  }),
306
- priority: n
249
+ priority: r
307
250
  });
308
251
  }
309
252
  onBeforeCellEdit(e) {
310
- return this._injector.get(g).beforeCommandExecuted((t) => {
311
- const n = t.params;
312
- t.id === k.id && n.visible && e(n);
253
+ return this._injector.get(h).beforeCommandExecuted((t) => {
254
+ const r = t.params;
255
+ t.id === m.id && r.visible && e(r);
313
256
  });
314
257
  }
315
258
  onAfterCellEdit(e) {
316
- return this._injector.get(g).onCommandExecuted((t) => {
317
- const n = t.params;
318
- t.id === k.id && !n.visible && e(n);
259
+ return this._injector.get(h).onCommandExecuted((t) => {
260
+ const r = t.params;
261
+ t.id === m.id && !r.visible && e(r);
319
262
  });
320
263
  }
321
264
  }
322
- C.extend(he);
323
- class le extends P {
265
+ I.extend(G);
266
+ class Q extends y {
324
267
  getCell() {
325
- const e = this._injector.get(p), t = this._workbook.getUnitId(), n = this._worksheet.getSheetId();
326
- return e.getRenderById(t).with(L).getWorksheetSkeleton(n).skeleton.getCellWithCoordByIndex(this._range.startRow, this._range.startColumn);
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);
327
270
  }
328
271
  getCellRect() {
329
- const { startX: e, startY: t, endX: n, endY: r } = this.getCell(), o = { x: e, y: t, width: n - e, height: r - t, top: t, left: e, bottom: r, right: n };
272
+ 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 };
330
273
  return { ...o, toJSON: () => JSON.stringify(o) };
331
274
  }
332
275
  generateHTML() {
333
276
  var t;
334
- const e = this._injector.get(Y).generateCopyContent(
277
+ const e = this._injector.get(O).generateCopyContent(
335
278
  this._workbook.getUnitId(),
336
279
  this._worksheet.getSheetId(),
337
280
  this._range
@@ -339,17 +282,17 @@ class le extends P {
339
282
  return (t = e == null ? void 0 : e.html) != null ? t : "";
340
283
  }
341
284
  attachPopup(e) {
342
- const { key: t, disposableCollection: n } = de(e, this._injector.get(q)), o = this._injector.get(K).attachPopupToCell(
285
+ const { key: t, disposableCollection: r } = ee(e, this._injector.get(K)), o = this._injector.get(A).attachPopupToCell(
343
286
  this._range.startRow,
344
287
  this._range.startColumn,
345
288
  { ...e, componentKey: t },
346
289
  this.getUnitId(),
347
290
  this._worksheet.getSheetId()
348
291
  );
349
- return o ? (n.add(o), n) : (n.dispose(), null);
292
+ return o ? (r.add(o), r) : (r.dispose(), null);
350
293
  }
351
294
  attachAlertPopup(e) {
352
- const t = this._injector.get(X), n = {
295
+ const t = this._injector.get(H), r = {
353
296
  workbook: this._workbook,
354
297
  worksheet: this._worksheet,
355
298
  row: this._range.startRow,
@@ -359,7 +302,7 @@ class le extends P {
359
302
  };
360
303
  return t.showAlert({
361
304
  ...e,
362
- location: n
305
+ location: r
363
306
  }), {
364
307
  dispose: () => {
365
308
  t.removeAlert(e.key);
@@ -367,24 +310,24 @@ class le extends P {
367
310
  };
368
311
  }
369
312
  highlight(e, t) {
370
- const n = this._injector.get(V), r = n.addShape({ range: this._range, style: e, primary: t });
371
- if (!r)
313
+ const r = this._injector.get($), n = r.addShape({ range: this._range, style: e, primary: t });
314
+ if (!n)
372
315
  throw new Error("Failed to highlight current range");
373
- return c(() => {
374
- n.removeShape(r);
316
+ return i(() => {
317
+ r.removeShape(n);
375
318
  });
376
319
  }
377
320
  }
378
- P.extend(le);
379
- function de(s, e) {
380
- const { componentKey: t, isVue3: n } = s;
381
- let r;
382
- const o = new A();
383
- return typeof t == "string" ? r = t : (r = `External_${H(6)}`, o.add(e.register(r, t, { framework: n ? "vue3" : "react" }))), {
384
- key: r,
321
+ y.extend(Q);
322
+ function ee(a, e) {
323
+ const { componentKey: t, isVue3: r } = a;
324
+ 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" }))), {
327
+ key: n,
385
328
  disposableCollection: o
386
329
  };
387
330
  }
388
331
  export {
389
- de as transformComponentKey
332
+ ee as transformComponentKey
390
333
  };