@univerjs/sheets-ui 0.10.11 → 0.10.12-nightly.202510221114

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,10 +1,10 @@
1
- import { ICommandService as _, CanceledError as E, IUniverInstanceService as W, RichTextValue as O, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as T, LifecycleService as ie, DisposableCollection as A, LifecycleStages as z, UniverInstanceType as oe, ILogService as U, toDisposable as m, awaitTime as se, InterceptorEffectEnum as ae, generateRandomId as ce } from "@univerjs/core";
2
- import { FUniver as q, FEventName as de } from "@univerjs/core/facade";
3
- import { RichTextEditingMutation as he } from "@univerjs/docs";
4
- import { IRenderManagerService as v, DeviceInputEventType as L, SHEET_VIEWPORT_KEY as le, sheetContentViewportKeys as ge } from "@univerjs/engine-render";
5
- import { SheetsSelectionsService as ue, COMMAND_LISTENER_SKELETON_CHANGE as ve, getSkeletonChangedEffectedRange as Se, SetWorksheetRowIsAutoHeightCommand as me, InterceptCellContentPriority as Ce, SheetInterceptorService as we, INTERCEPTOR_POINT as be } from "@univerjs/sheets";
6
- import { SetCellEditVisibleOperation as f, IEditorBridgeService as R, SetZoomRatioCommand as $, HoverManagerService as p, DragManagerService as M, SheetScrollManagerService as x, SheetPasteShortKeyCommand as B, ISheetClipboardService as Q, SheetSkeletonManagerService as I, SHEET_VIEW_KEY as w, ISheetSelectionRenderService as y, SheetsScrollRenderController as Ee, SetWorksheetColAutoWidthCommand as pe, SetColumnHeaderHeightCommand as fe, SetRowHeaderWidthCommand as ke, SheetCanvasPopManagerService as N, CellAlertManagerService as Ie, IMarkSelectionService as _e, ISheetCellDropdownManagerService as Pe } from "@univerjs/sheets-ui";
7
- import { FSheetHooks as j, FWorkbook as ee, FWorksheet as te, FPermission as re, FRange as ne } from "@univerjs/sheets/facade";
1
+ import { ICommandService as _, CanceledError as p, IUniverInstanceService as W, RichTextValue as O, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as T, LifecycleService as oe, DisposableCollection as A, LifecycleStages as z, UniverInstanceType as se, ILogService as U, toDisposable as m, awaitTime as ae, InterceptorEffectEnum as ce, generateRandomId as de } from "@univerjs/core";
2
+ import { FUniver as q, FEventName as he } from "@univerjs/core/facade";
3
+ import { RichTextEditingMutation as ge } from "@univerjs/docs";
4
+ import { IRenderManagerService as v, DeviceInputEventType as L, SHEET_VIEWPORT_KEY as le, sheetContentViewportKeys as ue } from "@univerjs/engine-render";
5
+ import { SheetsSelectionsService as ve, COMMAND_LISTENER_SKELETON_CHANGE as Se, getSkeletonChangedEffectedRange as me, SetWorksheetRowIsAutoHeightCommand as Ce, InterceptCellContentPriority as we, SheetInterceptorService as Ee, INTERCEPTOR_POINT as pe } from "@univerjs/sheets";
6
+ import { SetCellEditVisibleOperation as f, IEditorBridgeService as R, SetZoomRatioCommand as j, HoverManagerService as b, DragManagerService as M, SheetScrollManagerService as x, SheetPasteShortKeyCommand as B, ISheetClipboardService as Q, SheetSkeletonManagerService as I, SHEET_VIEW_KEY as w, ISheetSelectionRenderService as y, IMarkSelectionService as ee, SheetsScrollRenderController as be, SetWorksheetColAutoWidthCommand as fe, SetColumnHeaderHeightCommand as ke, SetRowHeaderWidthCommand as Ie, SheetCanvasPopManagerService as N, CellAlertManagerService as _e, ISheetCellDropdownManagerService as Pe } from "@univerjs/sheets-ui";
7
+ import { FSheetHooks as $, FWorkbook as te, FWorksheet as re, FPermission as ne, FRange as ie } from "@univerjs/sheets/facade";
8
8
  import { KeyCode as D, CutCommand as F, CopyCommand as V, PasteCommand as Z, IClipboardInterfaceService as Re, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as K, HTML_CLIPBOARD_MIME_TYPE as Y, supportClipboardAPI as X, ISidebarService as He, IDialogService as Me, ComponentManager as J } from "@univerjs/ui";
9
9
  import { filter as u, combineLatest as ye } from "rxjs";
10
10
  class Ue extends q {
@@ -17,19 +17,19 @@ class Ue extends q {
17
17
  if (t.id !== f.id) return;
18
18
  const i = this.getActiveSheet();
19
19
  if (!i) return;
20
- const { workbook: o, worksheet: s } = i, d = e.get(R), l = t.params, { visible: h, keycode: g, eventType: a } = l, n = d.getEditLocation();
21
- if (h) {
20
+ const { workbook: o, worksheet: s } = i, d = e.get(R), h = t.params, { visible: g, keycode: l, eventType: a } = h, n = d.getEditLocation();
21
+ if (g) {
22
22
  const c = {
23
23
  row: n.row,
24
24
  column: n.column,
25
25
  eventType: a,
26
- keycode: g,
26
+ keycode: l,
27
27
  workbook: o,
28
28
  worksheet: s,
29
29
  isZenEditor: !1
30
30
  };
31
31
  if (this.fireEvent(this.Event.BeforeSheetEditStart, c), c.cancel)
32
- throw new E();
32
+ throw new p();
33
33
  }
34
34
  })
35
35
  ), this.registerEventHandler(
@@ -38,8 +38,8 @@ class Ue extends q {
38
38
  if (t.id !== f.id) return;
39
39
  const i = this.getActiveSheet();
40
40
  if (!i) return;
41
- const { workbook: o, worksheet: s } = i, d = e.get(R), l = e.get(W), h = t.params, { visible: g, keycode: a, eventType: n } = h, c = d.getEditLocation();
42
- if (!g) {
41
+ const { workbook: o, worksheet: s } = i, d = e.get(R), h = e.get(W), g = t.params, { visible: l, keycode: a, eventType: n } = g, c = d.getEditLocation();
42
+ if (!l) {
43
43
  const P = {
44
44
  row: c.row,
45
45
  column: c.column,
@@ -48,11 +48,11 @@ class Ue extends q {
48
48
  workbook: o,
49
49
  worksheet: s,
50
50
  isZenEditor: !1,
51
- value: O.create(l.getUnit(T).getSnapshot()),
51
+ value: O.create(h.getUnit(T).getSnapshot()),
52
52
  isConfirm: a !== D.ESC
53
53
  };
54
54
  if (this.fireEvent(this.Event.BeforeSheetEditEnd, P), P.cancel)
55
- throw new E();
55
+ throw new p();
56
56
  }
57
57
  })
58
58
  ), this.registerEventHandler(
@@ -61,13 +61,13 @@ class Ue extends q {
61
61
  if (t.id !== f.id) return;
62
62
  const i = this.getCommandSheetTarget(t);
63
63
  if (!i) return;
64
- const { workbook: o, worksheet: s } = i, d = e.get(R), l = t.params, { visible: h, keycode: g, eventType: a } = l, n = d.getEditLocation();
65
- if (h) {
64
+ const { workbook: o, worksheet: s } = i, d = e.get(R), h = t.params, { visible: g, keycode: l, eventType: a } = h, n = d.getEditLocation();
65
+ if (g) {
66
66
  const c = {
67
67
  row: n.row,
68
68
  column: n.column,
69
69
  eventType: a,
70
- keycode: g,
70
+ keycode: l,
71
71
  workbook: o,
72
72
  worksheet: s,
73
73
  isZenEditor: !1
@@ -81,17 +81,17 @@ class Ue extends q {
81
81
  if (t.id !== f.id) return;
82
82
  const i = this.getCommandSheetTarget(t);
83
83
  if (!i) return;
84
- const { workbook: o, worksheet: s } = i, d = e.get(R), l = t.params, { visible: h, keycode: g, eventType: a } = l, n = d.getEditLocation();
85
- if (!h) {
84
+ const { workbook: o, worksheet: s } = i, d = e.get(R), h = t.params, { visible: g, keycode: l, eventType: a } = h, n = d.getEditLocation();
85
+ if (!g) {
86
86
  const c = {
87
87
  row: n.row,
88
88
  column: n.column,
89
89
  eventType: a,
90
- keycode: g,
90
+ keycode: l,
91
91
  workbook: o,
92
92
  worksheet: s,
93
93
  isZenEditor: !1,
94
- isConfirm: g !== D.ESC
94
+ isConfirm: l !== D.ESC
95
95
  };
96
96
  this.fireEvent(this.Event.SheetEditEnded, c);
97
97
  }
@@ -99,19 +99,19 @@ class Ue extends q {
99
99
  ), this.registerEventHandler(
100
100
  this.Event.SheetEditChanging,
101
101
  () => r.onCommandExecuted((t) => {
102
- if (t.id !== he.id) return;
102
+ if (t.id !== ge.id) return;
103
103
  const i = this.getActiveSheet();
104
104
  if (!i) return;
105
- const { workbook: o, worksheet: s } = i, d = e.get(R), l = e.get(W), h = t.params;
105
+ const { workbook: o, worksheet: s } = i, d = e.get(R), h = e.get(W), g = t.params;
106
106
  if (!d.isVisible().visible) return;
107
- const { unitId: g } = h;
108
- if (g === T) {
107
+ const { unitId: l } = g;
108
+ if (l === T) {
109
109
  const { row: a, column: n } = d.getEditLocation(), c = {
110
110
  workbook: o,
111
111
  worksheet: s,
112
112
  row: a,
113
113
  column: n,
114
- value: O.create(l.getUnit(T).getSnapshot()),
114
+ value: O.create(h.getUnit(T).getSnapshot()),
115
115
  isZenEditor: !1
116
116
  };
117
117
  this.fireEvent(this.Event.SheetEditChanging, c);
@@ -120,7 +120,7 @@ class Ue extends q {
120
120
  ), this.registerEventHandler(
121
121
  this.Event.BeforeSheetZoomChange,
122
122
  () => r.beforeCommandExecuted((t) => {
123
- if (t.id !== $.id) return;
123
+ if (t.id !== j.id) return;
124
124
  const i = this.getCommandSheetTarget(t);
125
125
  if (!i) return;
126
126
  const { workbook: o, worksheet: s } = i, d = {
@@ -129,12 +129,12 @@ class Ue extends q {
129
129
  worksheet: s
130
130
  };
131
131
  if (this.fireEvent(this.Event.BeforeSheetZoomChange, d), d.cancel)
132
- throw new E();
132
+ throw new p();
133
133
  })
134
134
  ), this.registerEventHandler(
135
135
  this.Event.SheetZoomChanged,
136
136
  () => r.onCommandExecuted((t) => {
137
- if (t.id !== $.id) return;
137
+ if (t.id !== j.id) return;
138
138
  const i = this.getCommandSheetTarget(t);
139
139
  if (!i) return;
140
140
  const { workbook: o, worksheet: s } = i;
@@ -148,16 +148,16 @@ class Ue extends q {
148
148
  }
149
149
  // eslint-disable-next-line max-lines-per-function
150
150
  _initObserverListener(e) {
151
- const r = e.get(v), t = e.get(ie), i = new A();
152
- this.disposeWithMe(t.lifecycle$.subscribe((l) => {
153
- if (l !== z.Rendered) return;
151
+ const r = e.get(v), t = e.get(oe), i = new A();
152
+ this.disposeWithMe(t.lifecycle$.subscribe((h) => {
153
+ if (h !== z.Rendered) return;
154
154
  i.dispose();
155
- const h = e.get(p), g = e.get(M);
156
- h && (this.registerEventHandler(
155
+ const g = e.get(b), l = e.get(M);
156
+ g && (this.registerEventHandler(
157
157
  this.Event.CellClicked,
158
158
  () => {
159
159
  var a;
160
- return (a = h.currentClickedCell$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
160
+ return (a = g.currentClickedCell$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
161
161
  const c = this.getSheetTarget(n.location.unitId, n.location.subUnitId);
162
162
  c && this.fireEvent(this.Event.CellClicked, {
163
163
  ...c,
@@ -171,7 +171,7 @@ class Ue extends q {
171
171
  this.Event.CellHover,
172
172
  () => {
173
173
  var a;
174
- return (a = h.currentRichText$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
174
+ return (a = g.currentRichText$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
175
175
  const c = this.getSheetTarget(n.unitId, n.subUnitId);
176
176
  c && this.fireEvent(this.Event.CellHover, {
177
177
  ...c,
@@ -185,7 +185,7 @@ class Ue extends q {
185
185
  this.Event.CellPointerDown,
186
186
  () => {
187
187
  var a;
188
- return (a = h.currentPointerDownCell$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
188
+ return (a = g.currentPointerDownCell$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
189
189
  const c = this.getSheetTarget(n.unitId, n.subUnitId);
190
190
  c && this.fireEvent(this.Event.CellPointerDown, {
191
191
  ...c,
@@ -199,7 +199,7 @@ class Ue extends q {
199
199
  this.Event.CellPointerUp,
200
200
  () => {
201
201
  var a;
202
- return (a = h.currentPointerUpCell$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
202
+ return (a = g.currentPointerUpCell$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
203
203
  const c = this.getSheetTarget(n.unitId, n.subUnitId);
204
204
  c && this.fireEvent(this.Event.CellPointerUp, {
205
205
  ...c,
@@ -213,7 +213,7 @@ class Ue extends q {
213
213
  this.Event.CellPointerMove,
214
214
  () => {
215
215
  var a;
216
- return (a = h.currentCellPosWithEvent$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
216
+ return (a = g.currentCellPosWithEvent$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
217
217
  const c = this.getSheetTarget(n.unitId, n.subUnitId);
218
218
  c && this.fireEvent(this.Event.CellPointerMove, {
219
219
  ...c,
@@ -227,7 +227,7 @@ class Ue extends q {
227
227
  this.Event.DragOver,
228
228
  () => {
229
229
  var a;
230
- return (a = g.currentCell$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
230
+ return (a = l.currentCell$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
231
231
  const c = this.getSheetTarget(n.location.unitId, n.location.subUnitId);
232
232
  c && this.fireEvent(this.Event.DragOver, {
233
233
  ...c,
@@ -241,7 +241,7 @@ class Ue extends q {
241
241
  this.Event.Drop,
242
242
  () => {
243
243
  var a;
244
- return (a = g.endCell$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
244
+ return (a = l.endCell$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
245
245
  const c = this.getSheetTarget(n.location.unitId, n.location.subUnitId);
246
246
  c && this.fireEvent(this.Event.Drop, {
247
247
  ...c,
@@ -255,7 +255,7 @@ class Ue extends q {
255
255
  this.Event.RowHeaderClick,
256
256
  () => {
257
257
  var a;
258
- return (a = h.currentRowHeaderClick$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
258
+ return (a = g.currentRowHeaderClick$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
259
259
  const c = this.getSheetTarget(n.unitId, n.subUnitId);
260
260
  c && this.fireEvent(this.Event.RowHeaderClick, {
261
261
  ...c,
@@ -267,7 +267,7 @@ class Ue extends q {
267
267
  this.Event.RowHeaderPointerDown,
268
268
  () => {
269
269
  var a;
270
- return (a = h.currentRowHeaderPointerDown$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
270
+ return (a = g.currentRowHeaderPointerDown$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
271
271
  const c = this.getSheetTarget(n.unitId, n.subUnitId);
272
272
  c && this.fireEvent(this.Event.RowHeaderPointerDown, {
273
273
  ...c,
@@ -279,7 +279,7 @@ class Ue extends q {
279
279
  this.Event.RowHeaderPointerUp,
280
280
  () => {
281
281
  var a;
282
- return (a = h.currentRowHeaderPointerUp$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
282
+ return (a = g.currentRowHeaderPointerUp$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
283
283
  const c = this.getSheetTarget(n.unitId, n.subUnitId);
284
284
  c && this.fireEvent(this.Event.RowHeaderPointerUp, {
285
285
  ...c,
@@ -291,7 +291,7 @@ class Ue extends q {
291
291
  this.Event.RowHeaderHover,
292
292
  () => {
293
293
  var a;
294
- return (a = h.currentHoveredRowHeader$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
294
+ return (a = g.currentHoveredRowHeader$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
295
295
  const c = this.getSheetTarget(n.unitId, n.subUnitId);
296
296
  c && this.fireEvent(this.Event.RowHeaderHover, {
297
297
  ...c,
@@ -303,7 +303,7 @@ class Ue extends q {
303
303
  this.Event.ColumnHeaderClick,
304
304
  () => {
305
305
  var a;
306
- return (a = h.currentColHeaderClick$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
306
+ return (a = g.currentColHeaderClick$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
307
307
  const c = this.getSheetTarget(n.unitId, n.subUnitId);
308
308
  c && this.fireEvent(this.Event.ColumnHeaderClick, {
309
309
  ...c,
@@ -315,7 +315,7 @@ class Ue extends q {
315
315
  this.Event.ColumnHeaderPointerDown,
316
316
  () => {
317
317
  var a;
318
- return (a = h.currentColHeaderPointerDown$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
318
+ return (a = g.currentColHeaderPointerDown$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
319
319
  const c = this.getSheetTarget(n.unitId, n.subUnitId);
320
320
  c && this.fireEvent(this.Event.ColumnHeaderPointerDown, {
321
321
  ...c,
@@ -327,7 +327,7 @@ class Ue extends q {
327
327
  this.Event.ColumnHeaderPointerUp,
328
328
  () => {
329
329
  var a;
330
- return (a = h.currentColHeaderPointerUp$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
330
+ return (a = g.currentColHeaderPointerUp$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
331
331
  const c = this.getSheetTarget(n.unitId, n.subUnitId);
332
332
  c && this.fireEvent(this.Event.ColumnHeaderPointerUp, {
333
333
  ...c,
@@ -339,7 +339,7 @@ class Ue extends q {
339
339
  this.Event.ColumnHeaderHover,
340
340
  () => {
341
341
  var a;
342
- return (a = h.currentHoveredColHeader$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
342
+ return (a = g.currentHoveredColHeader$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
343
343
  const c = this.getSheetTarget(n.unitId, n.subUnitId);
344
344
  c && this.fireEvent(this.Event.ColumnHeaderHover, {
345
345
  ...c,
@@ -355,14 +355,14 @@ class Ue extends q {
355
355
  r.created$,
356
356
  t.lifecycle$
357
357
  ]);
358
- this.disposeWithMe(d.subscribe(([l, h]) => {
358
+ this.disposeWithMe(d.subscribe(([h, g]) => {
359
359
  var P;
360
- if (l.type === oe.UNIVER_SHEET && (s = l), h <= z.Rendered || !s) return;
361
- const g = new A(), a = this.getWorkbook(s.unitId);
360
+ if (h.type === se.UNIVER_SHEET && (s = h), g <= z.Rendered || !s) return;
361
+ const l = new A(), a = this.getWorkbook(s.unitId);
362
362
  if (!a) return;
363
- o.get(s.unitId) && ((P = o.get(s.unitId)) == null || P.dispose()), o.set(s.unitId, g);
364
- const n = s.with(x), c = s.with(ue);
365
- g.add(this.registerEventHandler(
363
+ o.get(s.unitId) && ((P = o.get(s.unitId)) == null || P.dispose()), o.set(s.unitId, l);
364
+ const n = s.with(x), c = s.with(ve);
365
+ l.add(this.registerEventHandler(
366
366
  this.Event.Scroll,
367
367
  () => n.validViewportScrollInfo$.subscribe((S) => {
368
368
  S && this.fireEvent(this.Event.Scroll, {
@@ -371,7 +371,7 @@ class Ue extends q {
371
371
  ...S
372
372
  });
373
373
  })
374
- )), g.add(this.registerEventHandler(
374
+ )), l.add(this.registerEventHandler(
375
375
  this.Event.SelectionMoveStart,
376
376
  () => c.selectionMoveStart$.subscribe((S) => {
377
377
  var C;
@@ -381,7 +381,7 @@ class Ue extends q {
381
381
  selections: (C = S == null ? void 0 : S.map((k) => k.range)) != null ? C : []
382
382
  });
383
383
  })
384
- )), g.add(this.registerEventHandler(
384
+ )), l.add(this.registerEventHandler(
385
385
  this.Event.SelectionMoving,
386
386
  () => c.selectionMoving$.subscribe((S) => {
387
387
  var C;
@@ -391,7 +391,7 @@ class Ue extends q {
391
391
  selections: (C = S == null ? void 0 : S.map((k) => k.range)) != null ? C : []
392
392
  });
393
393
  })
394
- )), g.add(this.registerEventHandler(
394
+ )), l.add(this.registerEventHandler(
395
395
  this.Event.SelectionMoveEnd,
396
396
  () => c.selectionMoveEnd$.subscribe((S) => {
397
397
  var C;
@@ -401,7 +401,7 @@ class Ue extends q {
401
401
  selections: (C = S == null ? void 0 : S.map((k) => k.range)) != null ? C : []
402
402
  });
403
403
  })
404
- )), g.add(this.registerEventHandler(
404
+ )), l.add(this.registerEventHandler(
405
405
  this.Event.SelectionChanged,
406
406
  () => c.selectionChanged$.subscribe((S) => {
407
407
  var C;
@@ -411,13 +411,13 @@ class Ue extends q {
411
411
  selections: (C = S == null ? void 0 : S.map((k) => k.range)) != null ? C : []
412
412
  });
413
413
  })
414
- )), s = null, this.disposeWithMe(g);
415
- })), this.disposeWithMe(r.disposed$.subscribe((l) => {
416
- var h;
417
- (h = o.get(l)) == null || h.dispose(), o.delete(l);
414
+ )), s = null, this.disposeWithMe(l);
415
+ })), this.disposeWithMe(r.disposed$.subscribe((h) => {
416
+ var g;
417
+ (g = o.get(h)) == null || g.dispose(), o.delete(h);
418
418
  })), this.disposeWithMe(() => {
419
- o.forEach((l) => {
420
- l.dispose();
419
+ o.forEach((h) => {
420
+ h.dispose();
421
421
  });
422
422
  });
423
423
  }
@@ -474,12 +474,12 @@ class Ue extends q {
474
474
  ), this.registerEventHandler(
475
475
  this.Event.SheetSkeletonChanged,
476
476
  () => r.onCommandExecuted((t) => {
477
- if (ve.indexOf(t.id) > -1) {
477
+ if (Se.indexOf(t.id) > -1) {
478
478
  const i = this.getActiveSheet();
479
479
  if (!i) return;
480
- const o = Se(t, i.worksheet.getMaxColumns()).map((s) => {
481
- var d, l;
482
- return (l = (d = this.getWorkbook(s.unitId)) == null ? void 0 : d.getSheetBySheetId(s.subUnitId)) == null ? void 0 : l.getRange(s.range);
480
+ const o = me(t, i.worksheet.getMaxColumns()).map((s) => {
481
+ var d, h;
482
+ return (h = (d = this.getWorkbook(s.unitId)) == null ? void 0 : d.getSheetBySheetId(s.subUnitId)) == null ? void 0 : h.getRange(s.range);
483
483
  }).filter(Boolean);
484
484
  if (!o.length) return;
485
485
  this.fireEvent(this.Event.SheetSkeletonChanged, {
@@ -513,7 +513,7 @@ class Ue extends q {
513
513
  _beforeClipboardChange() {
514
514
  const e = this._generateClipboardCopyParam();
515
515
  if (e && (this.fireEvent(this.Event.BeforeClipboardChange, e), e.cancel))
516
- throw new E();
516
+ throw new p();
517
517
  }
518
518
  _clipboardChanged() {
519
519
  const e = this._generateClipboardCopyParam();
@@ -537,12 +537,12 @@ class Ue extends q {
537
537
  const o = (await this._injector.get(Re).read())[0];
538
538
  let s;
539
539
  if (o) {
540
- const d = o.types, l = d.indexOf(K) !== -1 ? await o.getType(K).then((g) => g && g.text()) : "", h = d.indexOf(Y) !== -1 ? await o.getType(Y).then((g) => g && g.text()) : "";
540
+ const d = o.types, h = d.indexOf(K) !== -1 ? await o.getType(K).then((l) => l && l.text()) : "", g = d.indexOf(Y) !== -1 ? await o.getType(Y).then((l) => l && l.text()) : "";
541
541
  s = {
542
542
  workbook: e,
543
543
  worksheet: r,
544
- text: l,
545
- html: h
544
+ text: h,
545
+ html: g
546
546
  };
547
547
  }
548
548
  return s;
@@ -550,12 +550,12 @@ class Ue extends q {
550
550
  _beforeClipboardPaste(e) {
551
551
  const r = this._generateClipboardPasteParam(e);
552
552
  if (r && (this.fireEvent(this.Event.BeforeClipboardPaste, r), r.cancel))
553
- throw new E();
553
+ throw new p();
554
554
  }
555
555
  _clipboardPaste(e) {
556
556
  const r = this._generateClipboardPasteParam(e);
557
557
  if (r && (this.fireEvent(this.Event.ClipboardPasted, r), r.cancel))
558
- throw new E();
558
+ throw new p();
559
559
  }
560
560
  async _beforeClipboardPasteAsync() {
561
561
  if (!X()) {
@@ -564,7 +564,7 @@ class Ue extends q {
564
564
  }
565
565
  const e = await this._generateClipboardPasteParamAsync();
566
566
  if (e && (this.fireEvent(this.Event.BeforeClipboardPaste, e), e.cancel))
567
- throw new E();
567
+ throw new p();
568
568
  }
569
569
  async _clipboardPasteAsync() {
570
570
  if (!X()) {
@@ -573,17 +573,17 @@ class Ue extends q {
573
573
  }
574
574
  const e = await this._generateClipboardPasteParamAsync();
575
575
  if (e && (this.fireEvent(this.Event.ClipboardPasted, e), e.cancel))
576
- throw new E();
576
+ throw new p();
577
577
  }
578
578
  customizeColumnHeader(e) {
579
- var h, g;
579
+ var g, l;
580
580
  const r = this.getActiveWorkbook();
581
581
  if (!r) {
582
582
  console.error("WorkBook not exist");
583
583
  return;
584
584
  }
585
585
  const t = r == null ? void 0 : r.getId(), i = this._injector.get(v), o = r.getActiveSheet(), s = o.getSheetId(), d = i.getRenderById(t);
586
- d && ((h = e.headerStyle) != null && h.size) && (d.with(I).setColumnHeaderSize(d, s, (g = e.headerStyle) == null ? void 0 : g.size), o == null || o.refreshCanvas()), this._getSheetRenderComponent(t, w.COLUMN).setCustomHeader(e), o == null || o.refreshCanvas();
586
+ d && ((g = e.headerStyle) != null && g.size) && (d.with(I).setColumnHeaderSize(d, s, (l = e.headerStyle) == null ? void 0 : l.size), o == null || o.refreshCanvas()), this._getSheetRenderComponent(t, w.COLUMN).setCustomHeader(e), o == null || o.refreshCanvas();
587
587
  }
588
588
  customizeRowHeader(e) {
589
589
  const r = this.getActiveWorkbook();
@@ -633,14 +633,14 @@ class Ue extends q {
633
633
  * @returns {FSheetHooks} FSheetHooks instance
634
634
  */
635
635
  getSheetHooks() {
636
- return this._injector.createInstance(j);
636
+ return this._injector.createInstance($);
637
637
  }
638
638
  pasteIntoSheet(e, r, t) {
639
639
  return this._commandService.executeCommand(B.id, { htmlContent: e, textContent: r, files: t });
640
640
  }
641
641
  }
642
642
  q.extend(Ue);
643
- class xe extends ee {
643
+ class xe extends te {
644
644
  openSiderbar(e) {
645
645
  return this._logDeprecation("openSiderbar"), this._injector.get(He).open(e);
646
646
  }
@@ -691,7 +691,7 @@ class xe extends ee {
691
691
  };
692
692
  }
693
693
  onCellClick(e) {
694
- const r = this._injector.get(p);
694
+ const r = this._injector.get(b);
695
695
  return m(
696
696
  r.currentClickedCell$.pipe(u((t) => !!t)).subscribe((t) => {
697
697
  e(t);
@@ -699,25 +699,25 @@ class xe extends ee {
699
699
  );
700
700
  }
701
701
  onCellHover(e) {
702
- const r = this._injector.get(p);
702
+ const r = this._injector.get(b);
703
703
  return m(
704
704
  r.currentRichText$.pipe(u((t) => !!t)).subscribe(e)
705
705
  );
706
706
  }
707
707
  onCellPointerDown(e) {
708
- const r = this._injector.get(p);
708
+ const r = this._injector.get(b);
709
709
  return m(
710
710
  r.currentPointerDownCell$.subscribe(e)
711
711
  );
712
712
  }
713
713
  onCellPointerUp(e) {
714
- const r = this._injector.get(p);
714
+ const r = this._injector.get(b);
715
715
  return m(
716
716
  r.currentPointerUpCell$.subscribe(e)
717
717
  );
718
718
  }
719
719
  onCellPointerMove(e) {
720
- const r = this._injector.get(p);
720
+ const r = this._injector.get(b);
721
721
  return m(
722
722
  r.currentCellPosWithEvent$.pipe(u((t) => !!t)).subscribe((t) => {
723
723
  e(t, t.event);
@@ -753,7 +753,7 @@ class xe extends ee {
753
753
  keycode: e ? D.ENTER : D.ESC,
754
754
  visible: !1,
755
755
  unitId: this._workbook.getUnitId()
756
- }), await se(0), !0;
756
+ }), await ae(0), !0;
757
757
  }
758
758
  endEditingAsync(e = !0) {
759
759
  return this.endEditing(e);
@@ -791,8 +791,8 @@ class xe extends ee {
791
791
  return t && t.with(y).showSelection(), this;
792
792
  }
793
793
  }
794
- ee.extend(xe);
795
- class De extends te {
794
+ te.extend(xe);
795
+ class De extends re {
796
796
  refreshCanvas() {
797
797
  const e = this._injector.get(v), r = this._fWorkbook.id, t = e.getRenderById(r);
798
798
  if (!t)
@@ -803,9 +803,23 @@ class De extends te {
803
803
  throw new Error("Main component not found");
804
804
  return i.makeDirty(), this;
805
805
  }
806
+ highlightRanges(e, r, t) {
807
+ const i = this._injector.get(ee), o = [];
808
+ for (const s of e) {
809
+ const d = s.getRange(), h = i.addShapeWithNoFresh({ range: d, style: r, primary: t });
810
+ h && o.push(h);
811
+ }
812
+ if (i.refreshShapes(), o.length === 0)
813
+ throw new Error("Failed to highlight current range");
814
+ return m(() => {
815
+ o.forEach((s) => {
816
+ i.removeShape(s);
817
+ });
818
+ });
819
+ }
806
820
  zoom(e) {
807
821
  const r = this._injector.get(_), t = Math.min(Math.max(e, 0.1), 4);
808
- return r.executeCommand($.id, {
822
+ return r.executeCommand(j.id, {
809
823
  unitId: this._workbook.getUnitId(),
810
824
  subUnitId: this._worksheet.getSheetId(),
811
825
  zoomRatio: t
@@ -828,13 +842,13 @@ class De extends te {
828
842
  const d = s == null ? void 0 : s.getVisibleRanges();
829
843
  if (!d) return i;
830
844
  i = s.getVisibleRangeByViewport(le.VIEW_MAIN);
831
- for (const [l, h] of d)
832
- ge.indexOf(l) !== -1 && (i.startColumn = Math.min(i.startColumn, h.startColumn), i.startRow = Math.min(i.startRow, h.startRow), i.endColumn = Math.max(i.endColumn, h.endColumn), i.endRow = Math.max(i.endRow, h.endRow));
845
+ for (const [h, g] of d)
846
+ ue.indexOf(h) !== -1 && (i.startColumn = Math.min(i.startColumn, g.startColumn), i.startRow = Math.min(i.startRow, g.startRow), i.endColumn = Math.max(i.endColumn, g.endColumn), i.endRow = Math.max(i.endRow, g.endRow));
833
847
  return i;
834
848
  }
835
- scrollToCell(e, r) {
836
- const t = this._workbook.getUnitId(), o = this._injector.get(v).getRenderById(t);
837
- return o && (o == null ? void 0 : o.with(Ee)).scrollToCell(e, r), this;
849
+ scrollToCell(e, r, t) {
850
+ const i = this._workbook.getUnitId(), s = this._injector.get(v).getRenderById(i);
851
+ return s && (s == null ? void 0 : s.with(be)).scrollToCell(e, r, t), this;
838
852
  }
839
853
  getScrollState() {
840
854
  const e = {
@@ -874,7 +888,7 @@ class De extends te {
874
888
  endRow: this._worksheet.getRowCount() - 1
875
889
  }
876
890
  ];
877
- return this._commandService.syncExecuteCommand(pe.id, {
891
+ return this._commandService.syncExecuteCommand(fe.id, {
878
892
  unitId: t,
879
893
  subUnitId: i,
880
894
  ranges: o
@@ -892,25 +906,25 @@ class De extends te {
892
906
  endColumn: this._worksheet.getColumnCount() - 1
893
907
  }
894
908
  ];
895
- return this._commandService.syncExecuteCommand(me.id, {
909
+ return this._commandService.syncExecuteCommand(Ce.id, {
896
910
  unitId: t,
897
911
  subUnitId: i,
898
912
  ranges: o
899
913
  }), this;
900
914
  }
901
915
  customizeColumnHeader(e) {
902
- var d, l;
916
+ var d, h;
903
917
  const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), o = this._injector.get(v).getRenderById(r);
904
- o && ((d = e.headerStyle) != null && d.size) && o.with(I).setColumnHeaderSize(o, t, (l = e.headerStyle) == null ? void 0 : l.size), this._getSheetRenderComponent(r, w.COLUMN).setCustomHeader(e, t);
918
+ o && ((d = e.headerStyle) != null && d.size) && o.with(I).setColumnHeaderSize(o, t, (h = e.headerStyle) == null ? void 0 : h.size), this._getSheetRenderComponent(r, w.COLUMN).setCustomHeader(e, t);
905
919
  }
906
920
  customizeRowHeader(e) {
907
- var d, l;
921
+ var d, h;
908
922
  const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), o = this._injector.get(v).getRenderById(r);
909
- o && ((d = e.headerStyle) != null && d.size) && o.with(I).setRowHeaderSize(o, t, (l = e.headerStyle) == null ? void 0 : l.size), this._getSheetRenderComponent(r, w.ROW).setCustomHeader(e, t);
923
+ o && ((d = e.headerStyle) != null && d.size) && o.with(I).setRowHeaderSize(o, t, (h = e.headerStyle) == null ? void 0 : h.size), this._getSheetRenderComponent(r, w.ROW).setCustomHeader(e, t);
910
924
  }
911
925
  setColumnHeaderHeight(e) {
912
926
  const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId();
913
- return this._commandService.executeCommand(fe.id, {
927
+ return this._commandService.executeCommand(ke.id, {
914
928
  unitId: r,
915
929
  subUnitId: t,
916
930
  size: e
@@ -918,7 +932,7 @@ class De extends te {
918
932
  }
919
933
  setRowHeaderWidth(e) {
920
934
  const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId();
921
- return this._commandService.executeCommand(ke.id, {
935
+ return this._commandService.executeCommand(Ie.id, {
922
936
  unitId: r,
923
937
  subUnitId: t,
924
938
  size: e
@@ -941,19 +955,19 @@ class De extends te {
941
955
  return s;
942
956
  }
943
957
  }
944
- te.extend(De);
945
- class Te extends re {
958
+ re.extend(De);
959
+ class Te extends ne {
946
960
  setPermissionDialogVisible(e) {
947
961
  this._permissionService.setShowComponents(e);
948
962
  }
949
963
  }
950
- re.extend(Te);
951
- class Be extends j {
964
+ ne.extend(Te);
965
+ class Be extends $ {
952
966
  onCellPointerMove(e) {
953
- return m(this._injector.get(p).currentPosition$.subscribe(e));
967
+ return m(this._injector.get(b).currentPosition$.subscribe(e));
954
968
  }
955
969
  onCellPointerOver(e) {
956
- return m(this._injector.get(p).currentCell$.subscribe(e));
970
+ return m(this._injector.get(b).currentCell$.subscribe(e));
957
971
  }
958
972
  onCellDragOver(e) {
959
973
  return m(this._injector.get(M).currentCell$.subscribe(e));
@@ -961,8 +975,8 @@ class Be extends j {
961
975
  onCellDrop(e) {
962
976
  return m(this._injector.get(M).endCell$.subscribe(e));
963
977
  }
964
- onCellRender(e, r = ae.Style, t = Ce.DATA_VALIDATION) {
965
- return this._injector.get(we).intercept(be.CELL_CONTENT, {
978
+ onCellRender(e, r = ce.Style, t = we.DATA_VALIDATION) {
979
+ return this._injector.get(Ee).intercept(pe.CELL_CONTENT, {
966
980
  effect: r,
967
981
  handler: (i, o, s) => (i && !i.customRender && e && (i.customRender = [...e]), s(i)),
968
982
  priority: t
@@ -981,7 +995,7 @@ class Be extends j {
981
995
  });
982
996
  }
983
997
  }
984
- j.extend(Be);
998
+ $.extend(Be);
985
999
  const H = {
986
1000
  CellClicked: "CellClicked",
987
1001
  CellPointerDown: "CellPointerDown",
@@ -1087,8 +1101,8 @@ class Ae {
1087
1101
  return "SheetZoomChanged";
1088
1102
  }
1089
1103
  }
1090
- de.extend(Ae);
1091
- class $e extends ne {
1104
+ he.extend(Ae);
1105
+ class je extends ie {
1092
1106
  getCell() {
1093
1107
  var d;
1094
1108
  const e = this._injector.get(v), r = this._injector.get(U), t = this._workbook.getUnitId(), i = this._worksheet.getSheetId(), o = e.getRenderById(t), s = (d = o == null ? void 0 : o.with(I).getSkeletonParam(i)) == null ? void 0 : d.skeleton;
@@ -1110,8 +1124,8 @@ class $e extends ne {
1110
1124
  return (t = r == null ? void 0 : r.html) != null ? t : "";
1111
1125
  }
1112
1126
  attachPopup(e) {
1113
- var s, d, l;
1114
- e.direction = (s = e.direction) != null ? s : "horizontal", e.extraProps = (d = e.extraProps) != null ? d : {}, e.offset = (l = e.offset) != null ? l : [0, 0];
1127
+ var s, d, h;
1128
+ e.direction = (s = e.direction) != null ? s : "horizontal", e.extraProps = (d = e.extraProps) != null ? d : {}, e.offset = (h = e.offset) != null ? h : [0, 0];
1115
1129
  const { key: r, disposableCollection: t } = G(e, this._injector.get(J)), o = this._injector.get(N).attachPopupToCell(
1116
1130
  this._range.startRow,
1117
1131
  this._range.startColumn,
@@ -1122,7 +1136,7 @@ class $e extends ne {
1122
1136
  return o ? (t.add(o), t) : (t.dispose(), null);
1123
1137
  }
1124
1138
  attachAlertPopup(e) {
1125
- const r = this._injector.get(Ie), t = {
1139
+ const r = this._injector.get(_e), t = {
1126
1140
  workbook: this._workbook,
1127
1141
  worksheet: this._worksheet,
1128
1142
  row: this._range.startRow,
@@ -1152,8 +1166,8 @@ class $e extends ne {
1152
1166
  });
1153
1167
  */
1154
1168
  attachRangePopup(e) {
1155
- var s, d, l;
1156
- e.direction = (s = e.direction) != null ? s : "top-center", e.extraProps = (d = e.extraProps) != null ? d : {}, e.offset = (l = e.offset) != null ? l : [0, 0];
1169
+ var s, d, h;
1170
+ e.direction = (s = e.direction) != null ? s : "top-center", e.extraProps = (d = e.extraProps) != null ? d : {}, e.offset = (h = e.offset) != null ? h : [0, 0];
1157
1171
  const { key: r, disposableCollection: t } = G(e, this._injector.get(J)), o = this._injector.get(N).attachRangePopup(
1158
1172
  this._range,
1159
1173
  { ...e, componentKey: r },
@@ -1163,7 +1177,7 @@ class $e extends ne {
1163
1177
  return o ? (t.add(o), t) : (t.dispose(), null);
1164
1178
  }
1165
1179
  highlight(e, r) {
1166
- const t = this._injector.get(_e), i = t.addShape({ range: this._range, style: e, primary: r });
1180
+ const t = this._injector.get(ee), i = t.addShape({ range: this._range, style: e, primary: r });
1167
1181
  if (!i)
1168
1182
  throw new Error("Failed to highlight current range");
1169
1183
  return m(() => {
@@ -1174,12 +1188,12 @@ class $e extends ne {
1174
1188
  return this._injector.get(Pe).showDropdown(e);
1175
1189
  }
1176
1190
  }
1177
- ne.extend($e);
1178
- function G(b, e) {
1179
- const { componentKey: r, isVue3: t } = b;
1191
+ ie.extend(je);
1192
+ function G(E, e) {
1193
+ const { componentKey: r, isVue3: t } = E;
1180
1194
  let i;
1181
1195
  const o = new A();
1182
- return typeof r == "string" ? i = r : (i = `External_${ce(6)}`, o.add(e.register(i, r, { framework: t ? "vue3" : "react" }))), {
1196
+ return typeof r == "string" ? i = r : (i = `External_${de(6)}`, o.add(e.register(i, r, { framework: t ? "vue3" : "react" }))), {
1183
1197
  key: i,
1184
1198
  disposableCollection: o
1185
1199
  };