@univerjs/sheets-ui 0.8.3 → 0.9.0

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,16 +1,16 @@
1
- import { ICommandService as I, CanceledError as b, IUniverInstanceService as $, RichTextValue as j, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as T, LifecycleService as ie, DisposableCollection as B, LifecycleStages as O, UniverInstanceType as oe, ILogService as U, toDisposable as C, awaitTime as se, InterceptorEffectEnum as ae, generateRandomId as ce } from "@univerjs/core";
1
+ import { ICommandService as _, CanceledError as E, IUniverInstanceService as j, RichTextValue as W, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as T, LifecycleService as ie, DisposableCollection as B, LifecycleStages as O, UniverInstanceType as oe, ILogService as U, toDisposable as m, awaitTime as se, InterceptorEffectEnum as ae, generateRandomId as ce } from "@univerjs/core";
2
2
  import { FUniver as q, FEventName as de } from "@univerjs/core/facade";
3
3
  import { RichTextEditingMutation as he } from "@univerjs/docs";
4
- import { IRenderManagerService as S, DeviceInputEventType as z, 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 Ce, InterceptCellContentPriority as me, SheetInterceptorService as Ee, INTERCEPTOR_POINT as be } from "@univerjs/sheets";
6
- import { SetCellEditVisibleOperation as f, IEditorBridgeService as R, SetZoomRatioCommand as A, HoverManagerService as p, DragManagerService as M, SheetScrollManagerService as x, SheetPasteShortKeyCommand as L, ISheetClipboardService as Q, SheetSkeletonManagerService as _, SHEET_VIEW_KEY as w, ISheetSelectionRenderService as y, SheetsScrollRenderController as pe, SetWorksheetColAutoWidthCommand as we, 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 W, FWorkbook as ee, FWorksheet as te, FPermission as re, FRange as ne } from "@univerjs/sheets/facade";
4
+ import { IRenderManagerService as v, DeviceInputEventType as z, 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 A, HoverManagerService as p, DragManagerService as M, SheetScrollManagerService as x, SheetPasteShortKeyCommand as L, 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 $, FWorkbook as ee, FWorksheet as te, FPermission as re, FRange as ne } 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 {
11
11
  // eslint-disable-next-line max-lines-per-function
12
12
  _initSheetUIEvent(e) {
13
- const r = e.get(I);
13
+ const r = e.get(_);
14
14
  this.registerEventHandler(
15
15
  this.Event.BeforeSheetEditStart,
16
16
  () => r.beforeCommandExecuted((t) => {
@@ -29,7 +29,7 @@ class Ue extends q {
29
29
  isZenEditor: !1
30
30
  };
31
31
  if (this.fireEvent(this.Event.BeforeSheetEditStart, c), c.cancel)
32
- throw new b();
32
+ throw new E();
33
33
  }
34
34
  })
35
35
  ), this.registerEventHandler(
@@ -38,7 +38,7 @@ 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($), h = t.params, { visible: g, keycode: a, eventType: n } = h, c = d.getEditLocation();
41
+ const { workbook: o, worksheet: s } = i, d = e.get(R), l = e.get(j), h = t.params, { visible: g, keycode: a, eventType: n } = h, c = d.getEditLocation();
42
42
  if (!g) {
43
43
  const P = {
44
44
  row: c.row,
@@ -48,11 +48,11 @@ class Ue extends q {
48
48
  workbook: o,
49
49
  worksheet: s,
50
50
  isZenEditor: !1,
51
- value: j.create(l.getUnit(T).getSnapshot()),
51
+ value: W.create(l.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 b();
55
+ throw new E();
56
56
  }
57
57
  })
58
58
  ), this.registerEventHandler(
@@ -102,7 +102,7 @@ class Ue extends q {
102
102
  if (t.id !== he.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($), h = t.params;
105
+ const { workbook: o, worksheet: s } = i, d = e.get(R), l = e.get(j), h = t.params;
106
106
  if (!d.isVisible().visible) return;
107
107
  const { unitId: g } = h;
108
108
  if (g === T) {
@@ -111,7 +111,7 @@ class Ue extends q {
111
111
  worksheet: s,
112
112
  row: a,
113
113
  column: n,
114
- value: j.create(l.getUnit(T).getSnapshot()),
114
+ value: W.create(l.getUnit(T).getSnapshot()),
115
115
  isZenEditor: !1
116
116
  };
117
117
  this.fireEvent(this.Event.SheetEditChanging, c);
@@ -129,7 +129,7 @@ class Ue extends q {
129
129
  worksheet: s
130
130
  };
131
131
  if (this.fireEvent(this.Event.BeforeSheetZoomChange, d), d.cancel)
132
- throw new b();
132
+ throw new E();
133
133
  })
134
134
  ), this.registerEventHandler(
135
135
  this.Event.SheetZoomChanged,
@@ -148,7 +148,7 @@ 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(S), t = e.get(ie), i = new B();
151
+ const r = e.get(v), t = e.get(ie), i = new B();
152
152
  this.disposeWithMe(t.lifecycle$.subscribe((l) => {
153
153
  if (l !== O.Rendered) return;
154
154
  i.dispose();
@@ -364,51 +364,51 @@ class Ue extends q {
364
364
  const n = s.with(x), c = s.with(ue);
365
365
  g.add(this.registerEventHandler(
366
366
  this.Event.Scroll,
367
- () => n.validViewportScrollInfo$.subscribe((v) => {
368
- v && this.fireEvent(this.Event.Scroll, {
367
+ () => n.validViewportScrollInfo$.subscribe((S) => {
368
+ S && this.fireEvent(this.Event.Scroll, {
369
369
  workbook: a,
370
370
  worksheet: a.getActiveSheet(),
371
- ...v
371
+ ...S
372
372
  });
373
373
  })
374
374
  )), g.add(this.registerEventHandler(
375
375
  this.Event.SelectionMoveStart,
376
- () => c.selectionMoveStart$.subscribe((v) => {
377
- var m;
376
+ () => c.selectionMoveStart$.subscribe((S) => {
377
+ var C;
378
378
  this.fireEvent(this.Event.SelectionMoveStart, {
379
379
  workbook: a,
380
380
  worksheet: a.getActiveSheet(),
381
- selections: (m = v == null ? void 0 : v.map((k) => k.range)) != null ? m : []
381
+ selections: (C = S == null ? void 0 : S.map((k) => k.range)) != null ? C : []
382
382
  });
383
383
  })
384
384
  )), g.add(this.registerEventHandler(
385
385
  this.Event.SelectionMoving,
386
- () => c.selectionMoving$.subscribe((v) => {
387
- var m;
386
+ () => c.selectionMoving$.subscribe((S) => {
387
+ var C;
388
388
  this.fireEvent(this.Event.SelectionMoving, {
389
389
  workbook: a,
390
390
  worksheet: a.getActiveSheet(),
391
- selections: (m = v == null ? void 0 : v.map((k) => k.range)) != null ? m : []
391
+ selections: (C = S == null ? void 0 : S.map((k) => k.range)) != null ? C : []
392
392
  });
393
393
  })
394
394
  )), g.add(this.registerEventHandler(
395
395
  this.Event.SelectionMoveEnd,
396
- () => c.selectionMoveEnd$.subscribe((v) => {
397
- var m;
396
+ () => c.selectionMoveEnd$.subscribe((S) => {
397
+ var C;
398
398
  this.fireEvent(this.Event.SelectionMoveEnd, {
399
399
  workbook: a,
400
400
  worksheet: a.getActiveSheet(),
401
- selections: (m = v == null ? void 0 : v.map((k) => k.range)) != null ? m : []
401
+ selections: (C = S == null ? void 0 : S.map((k) => k.range)) != null ? C : []
402
402
  });
403
403
  })
404
404
  )), g.add(this.registerEventHandler(
405
405
  this.Event.SelectionChanged,
406
- () => c.selectionChanged$.subscribe((v) => {
407
- var m;
406
+ () => c.selectionChanged$.subscribe((S) => {
407
+ var C;
408
408
  this.fireEvent(this.Event.SelectionChanged, {
409
409
  workbook: a,
410
410
  worksheet: a.getActiveSheet(),
411
- selections: (m = v == null ? void 0 : v.map((k) => k.range)) != null ? m : []
411
+ selections: (C = S == null ? void 0 : S.map((k) => k.range)) != null ? C : []
412
412
  });
413
413
  })
414
414
  )), s = null, this.disposeWithMe(g);
@@ -426,7 +426,7 @@ class Ue extends q {
426
426
  */
427
427
  _initialize(e) {
428
428
  this._initSheetUIEvent(e), this._initObserverListener(e);
429
- const r = e.get(I);
429
+ const r = e.get(_);
430
430
  this.registerEventHandler(
431
431
  this.Event.BeforeClipboardChange,
432
432
  () => r.beforeCommandExecuted((t) => {
@@ -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 b();
516
+ throw new E();
517
517
  }
518
518
  _clipboardChanged() {
519
519
  const e = this._generateClipboardCopyParam();
@@ -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 b();
553
+ throw new E();
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 b();
558
+ throw new E();
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 b();
567
+ throw new E();
568
568
  }
569
569
  async _clipboardPasteAsync() {
570
570
  if (!X()) {
@@ -573,7 +573,7 @@ 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 b();
576
+ throw new E();
577
577
  }
578
578
  customizeColumnHeader(e) {
579
579
  var h, g;
@@ -582,8 +582,8 @@ class Ue extends q {
582
582
  console.error("WorkBook not exist");
583
583
  return;
584
584
  }
585
- const t = r == null ? void 0 : r.getId(), i = this._injector.get(S), o = r.getActiveSheet(), s = o.getSheetId(), d = i.getRenderById(t);
586
- d && ((h = e.headerStyle) != null && h.size) && (d.with(_).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();
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();
587
587
  }
588
588
  customizeRowHeader(e) {
589
589
  const r = this.getActiveWorkbook();
@@ -596,19 +596,19 @@ class Ue extends q {
596
596
  }
597
597
  registerSheetRowHeaderExtension(e, ...r) {
598
598
  const t = this._getSheetRenderComponent(e, w.ROW), i = t.register(...r);
599
- return C(() => {
599
+ return m(() => {
600
600
  i.dispose(), t.makeDirty(!0);
601
601
  });
602
602
  }
603
603
  registerSheetColumnHeaderExtension(e, ...r) {
604
604
  const t = this._getSheetRenderComponent(e, w.COLUMN), i = t.register(...r);
605
- return C(() => {
605
+ return m(() => {
606
606
  i.dispose(), t.makeDirty(!0);
607
607
  });
608
608
  }
609
609
  registerSheetMainExtension(e, ...r) {
610
610
  const t = this._getSheetRenderComponent(e, w.MAIN), i = t.register(...r);
611
- return C(() => {
611
+ return m(() => {
612
612
  i.dispose(), t.makeDirty(!0);
613
613
  });
614
614
  }
@@ -620,7 +620,7 @@ class Ue extends q {
620
620
  * @returns {Nullable<RenderComponentType>} The render component.
621
621
  */
622
622
  _getSheetRenderComponent(e, r) {
623
- const i = this._injector.get(S).getRenderById(e);
623
+ const i = this._injector.get(v).getRenderById(e);
624
624
  if (!i)
625
625
  throw new Error(`Render Unit with unitId ${e} not found`);
626
626
  const { components: o } = i, s = o.get(r);
@@ -633,7 +633,7 @@ class Ue extends q {
633
633
  * @returns {FSheetHooks} FSheetHooks instance
634
634
  */
635
635
  getSheetHooks() {
636
- return this._injector.createInstance(W);
636
+ return this._injector.createInstance($);
637
637
  }
638
638
  }
639
639
  q.extend(Ue);
@@ -651,6 +651,30 @@ class xe extends ee {
651
651
  });
652
652
  return t;
653
653
  }
654
+ customizeColumnHeader(e) {
655
+ const r = this._workbook.getUnitId();
656
+ this._getSheetRenderComponent(r, w.COLUMN).setCustomHeader(e);
657
+ }
658
+ customizeRowHeader(e) {
659
+ const r = this._workbook.getUnitId();
660
+ this._getSheetRenderComponent(r, w.ROW).setCustomHeader(e);
661
+ }
662
+ /**
663
+ * Get sheet render component from render by unitId and view key.
664
+ * @private
665
+ * @param {string} unitId The unit id of the spreadsheet.
666
+ * @param {SHEET_VIEW_KEY} viewKey The view key of the spreadsheet.
667
+ * @returns {Nullable<RenderComponentType>} The render component.
668
+ */
669
+ _getSheetRenderComponent(e, r) {
670
+ const i = this._injector.get(v).getRenderById(e);
671
+ if (!i)
672
+ throw new Error(`Render Unit with unitId ${e} not found`);
673
+ const { components: o } = i, s = o.get(r);
674
+ if (!s)
675
+ throw new Error("Render component not found");
676
+ return s;
677
+ }
654
678
  _logDeprecation(e) {
655
679
  this._injector.get(U).warn("[FWorkbook]", `${e} is deprecated. Please use the function of the same name on "FUniver".`);
656
680
  }
@@ -665,7 +689,7 @@ class xe extends ee {
665
689
  }
666
690
  onCellClick(e) {
667
691
  const r = this._injector.get(p);
668
- return C(
692
+ return m(
669
693
  r.currentClickedCell$.pipe(u((t) => !!t)).subscribe((t) => {
670
694
  e(t);
671
695
  })
@@ -673,25 +697,25 @@ class xe extends ee {
673
697
  }
674
698
  onCellHover(e) {
675
699
  const r = this._injector.get(p);
676
- return C(
700
+ return m(
677
701
  r.currentRichText$.pipe(u((t) => !!t)).subscribe(e)
678
702
  );
679
703
  }
680
704
  onCellPointerDown(e) {
681
705
  const r = this._injector.get(p);
682
- return C(
706
+ return m(
683
707
  r.currentPointerDownCell$.subscribe(e)
684
708
  );
685
709
  }
686
710
  onCellPointerUp(e) {
687
711
  const r = this._injector.get(p);
688
- return C(
712
+ return m(
689
713
  r.currentPointerUpCell$.subscribe(e)
690
714
  );
691
715
  }
692
716
  onCellPointerMove(e) {
693
717
  const r = this._injector.get(p);
694
- return C(
718
+ return m(
695
719
  r.currentCellPosWithEvent$.pipe(u((t) => !!t)).subscribe((t) => {
696
720
  e(t, t.event);
697
721
  })
@@ -699,7 +723,7 @@ class xe extends ee {
699
723
  }
700
724
  onDragOver(e) {
701
725
  const r = this._injector.get(M);
702
- return C(
726
+ return m(
703
727
  r.currentCell$.pipe(u((t) => !!t)).subscribe((t) => {
704
728
  e(t);
705
729
  })
@@ -707,21 +731,21 @@ class xe extends ee {
707
731
  }
708
732
  onDrop(e) {
709
733
  const r = this._injector.get(M);
710
- return C(
734
+ return m(
711
735
  r.endCell$.pipe(u((t) => !!t)).subscribe((t) => {
712
736
  e(t);
713
737
  })
714
738
  );
715
739
  }
716
740
  startEditing() {
717
- return this._injector.get(I).syncExecuteCommand(f.id, {
741
+ return this._injector.get(_).syncExecuteCommand(f.id, {
718
742
  eventType: z.Dblclick,
719
743
  unitId: this._workbook.getUnitId(),
720
744
  visible: !0
721
745
  });
722
746
  }
723
747
  async endEditing(e) {
724
- return this._injector.get(I).syncExecuteCommand(f.id, {
748
+ return this._injector.get(_).syncExecuteCommand(f.id, {
725
749
  eventType: z.Keyboard,
726
750
  keycode: e ? D.ENTER : D.ESC,
727
751
  visible: !1,
@@ -744,40 +768,40 @@ class xe extends ee {
744
768
  * ```
745
769
  */
746
770
  getScrollStateBySheetId(e) {
747
- const r = this._workbook.getUnitId(), i = this._injector.get(S).getRenderById(r);
771
+ const r = this._workbook.getUnitId(), i = this._injector.get(v).getRenderById(r);
748
772
  return i ? i.with(x).getScrollStateByParam({ unitId: r, sheetId: e }) : null;
749
773
  }
750
774
  disableSelection() {
751
- const e = this._workbook.getUnitId(), t = this._injector.get(S).getRenderById(e);
775
+ const e = this._workbook.getUnitId(), t = this._injector.get(v).getRenderById(e);
752
776
  return t && t.with(y).disableSelection(), this;
753
777
  }
754
778
  enableSelection() {
755
- const e = this._workbook.getUnitId(), t = this._injector.get(S).getRenderById(e);
779
+ const e = this._workbook.getUnitId(), t = this._injector.get(v).getRenderById(e);
756
780
  return t && t.with(y).enableSelection(), this;
757
781
  }
758
782
  transparentSelection() {
759
- const e = this._workbook.getUnitId(), t = this._injector.get(S).getRenderById(e);
783
+ const e = this._workbook.getUnitId(), t = this._injector.get(v).getRenderById(e);
760
784
  return t && t.with(y).transparentSelection(), this;
761
785
  }
762
786
  showSelection() {
763
- const e = this._workbook.getUnitId(), t = this._injector.get(S).getRenderById(e);
787
+ const e = this._workbook.getUnitId(), t = this._injector.get(v).getRenderById(e);
764
788
  return t && t.with(y).showSelection(), this;
765
789
  }
766
790
  }
767
791
  ee.extend(xe);
768
792
  class De extends te {
769
793
  refreshCanvas() {
770
- const e = this._injector.get(S), r = this._fWorkbook.id, t = e.getRenderById(r);
794
+ const e = this._injector.get(v), r = this._fWorkbook.id, t = e.getRenderById(r);
771
795
  if (!t)
772
796
  throw new Error(`Render Unit with unitId ${r} not found`);
773
- t.with(_).reCalculate();
797
+ t.with(I).reCalculate();
774
798
  const i = t.mainComponent;
775
799
  if (!i)
776
800
  throw new Error("Main component not found");
777
801
  return i.makeDirty(), this;
778
802
  }
779
803
  zoom(e) {
780
- const r = this._injector.get(I), t = Math.min(Math.max(e, 0.1), 4);
804
+ const r = this._injector.get(_), t = Math.min(Math.max(e, 0.1), 4);
781
805
  return r.executeCommand(A.id, {
782
806
  unitId: this._workbook.getUnitId(),
783
807
  subUnitId: this._worksheet.getSheetId(),
@@ -788,7 +812,7 @@ class De extends te {
788
812
  return this._worksheet.getZoomRatio();
789
813
  }
790
814
  getVisibleRange() {
791
- const e = this._workbook.getUnitId(), t = this._injector.get(S).getRenderById(e);
815
+ const e = this._workbook.getUnitId(), t = this._injector.get(v).getRenderById(e);
792
816
  let i = {
793
817
  startColumn: 0,
794
818
  startRow: 0,
@@ -796,7 +820,7 @@ class De extends te {
796
820
  endRow: 0
797
821
  };
798
822
  if (!t) return i;
799
- const s = t.with(_).getCurrentSkeleton();
823
+ const s = t.with(I).getCurrentSkeleton();
800
824
  if (!s) return i;
801
825
  const d = s == null ? void 0 : s.getVisibleRanges();
802
826
  if (!d) return i;
@@ -806,8 +830,8 @@ class De extends te {
806
830
  return i;
807
831
  }
808
832
  scrollToCell(e, r) {
809
- const t = this._workbook.getUnitId(), o = this._injector.get(S).getRenderById(t);
810
- return o && (o == null ? void 0 : o.with(pe)).scrollToCell(e, r), this;
833
+ const t = this._workbook.getUnitId(), o = this._injector.get(v).getRenderById(t);
834
+ return o && (o == null ? void 0 : o.with(Ee)).scrollToCell(e, r), this;
811
835
  }
812
836
  getScrollState() {
813
837
  const e = {
@@ -815,24 +839,24 @@ class De extends te {
815
839
  offsetY: 0,
816
840
  sheetViewStartColumn: 0,
817
841
  sheetViewStartRow: 0
818
- }, r = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), o = this._injector.get(S).getRenderById(r);
842
+ }, r = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), o = this._injector.get(v).getRenderById(r);
819
843
  return o && o.with(x).getScrollStateByParam({ unitId: r, sheetId: t }) || e;
820
844
  }
821
845
  onScroll(e) {
822
846
  var o;
823
- const r = this._workbook.getUnitId(), i = (o = this._injector.get(S).getRenderById(r)) == null ? void 0 : o.with(x);
847
+ const r = this._workbook.getUnitId(), i = (o = this._injector.get(v).getRenderById(r)) == null ? void 0 : o.with(x);
824
848
  if (i) {
825
849
  const s = i.validViewportScrollInfo$.subscribe((d) => {
826
850
  e(d);
827
851
  });
828
- return C(s);
852
+ return m(s);
829
853
  }
830
- return C(() => {
854
+ return m(() => {
831
855
  });
832
856
  }
833
857
  getSkeleton() {
834
858
  var r, t;
835
- const e = (r = this._injector.get(S).getRenderById(this._workbook.getUnitId())) == null ? void 0 : r.with(_);
859
+ const e = (r = this._injector.get(v).getRenderById(this._workbook.getUnitId())) == null ? void 0 : r.with(I);
836
860
  return (t = e == null ? void 0 : e.getWorksheetSkeleton(this._worksheet.getSheetId())) == null ? void 0 : t.skeleton;
837
861
  }
838
862
  autoResizeColumn(e) {
@@ -847,7 +871,7 @@ class De extends te {
847
871
  endRow: this._worksheet.getRowCount() - 1
848
872
  }
849
873
  ];
850
- return this._commandService.syncExecuteCommand(we.id, {
874
+ return this._commandService.syncExecuteCommand(pe.id, {
851
875
  unitId: t,
852
876
  subUnitId: i,
853
877
  ranges: o
@@ -865,40 +889,37 @@ class De extends te {
865
889
  endColumn: this._worksheet.getColumnCount() - 1
866
890
  }
867
891
  ];
868
- return this._commandService.syncExecuteCommand(Ce.id, {
892
+ return this._commandService.syncExecuteCommand(me.id, {
869
893
  unitId: t,
870
894
  subUnitId: i,
871
895
  ranges: o
872
896
  }), this;
873
897
  }
874
898
  customizeColumnHeader(e) {
875
- var l, h;
876
- const r = this, t = this._fWorkbook.getId(), i = this._injector.get(S), o = r.getSheetId(), s = i.getRenderById(t);
877
- s && ((l = e.headerStyle) != null && l.size) && (s.with(_).setColumnHeaderSize(s, o, (h = e.headerStyle) == null ? void 0 : h.size), r == null || r.refreshCanvas());
878
- const d = this._getSheetRenderComponent(t, w.COLUMN);
879
- d && (d.setCustomHeader(e), r == null || r.refreshCanvas());
899
+ var d, l;
900
+ const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), o = this._injector.get(v).getRenderById(r);
901
+ 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);
880
902
  }
881
903
  customizeRowHeader(e) {
882
- const r = this._fWorkbook.getId();
883
- this._getSheetRenderComponent(r, w.ROW).setCustomHeader(e);
904
+ var d, l;
905
+ const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), o = this._injector.get(v).getRenderById(r);
906
+ 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);
884
907
  }
885
908
  setColumnHeaderHeight(e) {
886
- const r = this, t = this._fWorkbook.getId(), i = r.getSheetId();
909
+ const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId();
887
910
  return this._commandService.executeCommand(fe.id, {
888
- unitId: t,
889
- subUnitId: i,
911
+ unitId: r,
912
+ subUnitId: t,
890
913
  size: e
891
- }), r == null || r.refreshCanvas(), this;
914
+ }), this;
892
915
  }
893
916
  setRowHeaderWidth(e) {
894
- const r = this, t = this._fWorkbook.getId(), i = r.getSheetId();
895
- this._commandService.executeCommand(ke.id, {
896
- unitId: t,
897
- subUnitId: i,
917
+ const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId();
918
+ return this._commandService.executeCommand(ke.id, {
919
+ unitId: r,
920
+ subUnitId: t,
898
921
  size: e
899
- });
900
- const o = this._getSheetRenderComponent(t, w.ROW);
901
- return o && o.setCustomHeader({ headerStyle: { size: e } }), r == null || r.refreshCanvas(), this;
922
+ }), this;
902
923
  }
903
924
  /**
904
925
  * Get sheet render component from render by unitId and view key.
@@ -908,7 +929,7 @@ class De extends te {
908
929
  * @returns {Nullable<RenderComponentType>} The render component.
909
930
  */
910
931
  _getSheetRenderComponent(e, r) {
911
- const i = this._injector.get(S).getRenderById(e);
932
+ const i = this._injector.get(v).getRenderById(e);
912
933
  if (!i)
913
934
  throw new Error(`Render Unit with unitId ${e} not found`);
914
935
  const { components: o } = i, s = o.get(r);
@@ -924,40 +945,40 @@ class Te extends re {
924
945
  }
925
946
  }
926
947
  re.extend(Te);
927
- class Be extends W {
948
+ class Be extends $ {
928
949
  onCellPointerMove(e) {
929
- return C(this._injector.get(p).currentPosition$.subscribe(e));
950
+ return m(this._injector.get(p).currentPosition$.subscribe(e));
930
951
  }
931
952
  onCellPointerOver(e) {
932
- return C(this._injector.get(p).currentCell$.subscribe(e));
953
+ return m(this._injector.get(p).currentCell$.subscribe(e));
933
954
  }
934
955
  onCellDragOver(e) {
935
- return C(this._injector.get(M).currentCell$.subscribe(e));
956
+ return m(this._injector.get(M).currentCell$.subscribe(e));
936
957
  }
937
958
  onCellDrop(e) {
938
- return C(this._injector.get(M).endCell$.subscribe(e));
959
+ return m(this._injector.get(M).endCell$.subscribe(e));
939
960
  }
940
- onCellRender(e, r = ae.Style, t = me.DATA_VALIDATION) {
941
- return this._injector.get(Ee).intercept(be.CELL_CONTENT, {
961
+ onCellRender(e, r = ae.Style, t = Ce.DATA_VALIDATION) {
962
+ return this._injector.get(we).intercept(be.CELL_CONTENT, {
942
963
  effect: r,
943
964
  handler: (i, o, s) => (i && !i.customRender && e && (i.customRender = [...e]), s(i)),
944
965
  priority: t
945
966
  });
946
967
  }
947
968
  onBeforeCellEdit(e) {
948
- return this._injector.get(I).beforeCommandExecuted((r) => {
969
+ return this._injector.get(_).beforeCommandExecuted((r) => {
949
970
  const t = r.params;
950
971
  r.id === f.id && t.visible && e(t);
951
972
  });
952
973
  }
953
974
  onAfterCellEdit(e) {
954
- return this._injector.get(I).onCommandExecuted((r) => {
975
+ return this._injector.get(_).onCommandExecuted((r) => {
955
976
  const t = r.params;
956
977
  r.id === f.id && !t.visible && e(t);
957
978
  });
958
979
  }
959
980
  }
960
- W.extend(Be);
981
+ $.extend(Be);
961
982
  const H = {
962
983
  CellClicked: "CellClicked",
963
984
  CellPointerDown: "CellPointerDown",
@@ -1064,10 +1085,10 @@ class Ae {
1064
1085
  }
1065
1086
  }
1066
1087
  de.extend(Ae);
1067
- class We extends ne {
1088
+ class $e extends ne {
1068
1089
  getCell() {
1069
1090
  var d;
1070
- const e = this._injector.get(S), 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(_).getSkeletonParam(i)) == null ? void 0 : d.skeleton;
1091
+ 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;
1071
1092
  if (!s)
1072
1093
  throw r.error("[Facade]: `FRange.getCell` can only be called in current worksheet"), new Error("`FRange.getCell` can only be called in current worksheet");
1073
1094
  return s.getCellWithCoordByIndex(this._range.startRow, this._range.startColumn);
@@ -1142,7 +1163,7 @@ class We extends ne {
1142
1163
  const t = this._injector.get(_e), i = t.addShape({ range: this._range, style: e, primary: r });
1143
1164
  if (!i)
1144
1165
  throw new Error("Failed to highlight current range");
1145
- return C(() => {
1166
+ return m(() => {
1146
1167
  t.removeShape(i);
1147
1168
  });
1148
1169
  }
@@ -1150,9 +1171,9 @@ class We extends ne {
1150
1171
  return this._injector.get(Pe).showDropdown(e);
1151
1172
  }
1152
1173
  }
1153
- ne.extend(We);
1154
- function G(E, e) {
1155
- const { componentKey: r, isVue3: t } = E;
1174
+ ne.extend($e);
1175
+ function G(b, e) {
1176
+ const { componentKey: r, isVue3: t } = b;
1156
1177
  let i;
1157
1178
  const o = new B();
1158
1179
  return typeof r == "string" ? i = r : (i = `External_${ce(6)}`, o.add(e.register(i, r, { framework: t ? "vue3" : "react" }))), {