@univerjs/sheets-ui 0.12.1 → 0.12.2-experimental.20251201-5b27b55

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 P, CanceledError as E, IUniverInstanceService as O, RichTextValue as z, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as D, LifecycleService as se, DisposableCollection as j, LifecycleStages as L, UniverInstanceType as ae, ILogService as U, toDisposable as m, awaitTime as ce, InterceptorEffectEnum as de, generateRandomId as he } from "@univerjs/core";
2
- import { FUniver as Q, FEventName as ge } from "@univerjs/core/facade";
3
- import { RichTextEditingMutation as le } from "@univerjs/docs";
4
- import { IRenderManagerService as v, DeviceInputEventType as N, SHEET_VIEWPORT_KEY as ue, sheetContentViewportKeys as ve } from "@univerjs/engine-render";
5
- import { SheetsSelectionsService as Se, COMMAND_LISTENER_SKELETON_CHANGE as me, getSkeletonChangedEffectedRange as Ce, SetWorksheetRowIsAutoHeightCommand as we, InterceptCellContentPriority as be, SheetInterceptorService as Ee, INTERCEPTOR_POINT as pe } from "@univerjs/sheets";
6
- import { SetCellEditVisibleOperation as k, IEditorBridgeService as p, SetZoomRatioCommand as $, HoverManagerService as f, DragManagerService as M, SheetScrollManagerService as x, SheetPasteShortKeyCommand as T, ISheetClipboardService as ee, SheetSkeletonManagerService as _, SHEET_VIEW_KEY as w, SheetPermissionRenderManagerService as A, ISheetSelectionRenderService as y, IMarkSelectionService as te, SheetsScrollRenderController as fe, SetWorksheetColAutoWidthCommand as ke, SetColumnHeaderHeightCommand as Ie, SetRowHeaderWidthCommand as _e, SheetCanvasPopManagerService as F, CellAlertManagerService as Pe, ISheetCellDropdownManagerService as Re } from "@univerjs/sheets-ui";
1
+ import { ICommandService as R, CanceledError as b, IUniverInstanceService as O, RichTextValue as F, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as D, LifecycleService as se, DisposableCollection as j, LifecycleStages as z, UniverInstanceType as ae, ILogService as U, toDisposable as m, IPermissionService as ce, awaitTime as de, InterceptorEffectEnum as he, Rectangle as ge, generateRandomId as le } from "@univerjs/core";
2
+ import { FUniver as Q, FEventName as ue } from "@univerjs/core/facade";
3
+ import { RichTextEditingMutation as ve } from "@univerjs/docs";
4
+ import { IRenderManagerService as v, DeviceInputEventType as L, SHEET_VIEWPORT_KEY as Se, sheetContentViewportKeys as me } from "@univerjs/engine-render";
5
+ import { SheetsSelectionsService as Ce, COMMAND_LISTENER_SKELETON_CHANGE as we, getSkeletonChangedEffectedRange as Ee, SetWorksheetRowIsAutoHeightCommand as be, InterceptCellContentPriority as pe, SheetInterceptorService as fe, INTERCEPTOR_POINT as ke } from "@univerjs/sheets";
6
+ import { SetCellEditVisibleOperation as k, IEditorBridgeService as p, SetZoomRatioCommand as $, HoverManagerService as f, DragManagerService as M, SheetScrollManagerService as x, SheetPasteShortKeyCommand as T, ISheetClipboardService as ee, SheetSkeletonManagerService as _, SHEET_VIEW_KEY as w, SheetPermissionRenderManagerService as A, ISheetSelectionRenderService as y, IMarkSelectionService as te, SheetsScrollRenderController as Ie, SetWorksheetColAutoWidthCommand as _e, SetColumnHeaderHeightCommand as Re, SetRowHeaderWidthCommand as Pe, SheetCanvasPopManagerService as N, CellAlertManagerService as He, ISheetCellDropdownManagerService as Me, AutoFillCommand as ye } from "@univerjs/sheets-ui";
7
7
  import { FSheetHooks as W, FWorkbook as re, FWorksheet as ne, FPermission as ie, FRange as oe } from "@univerjs/sheets/facade";
8
- import { KeyCode as B, CutCommand as V, CopyCommand as Z, PasteCommand as K, IClipboardInterfaceService as He, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as Y, HTML_CLIPBOARD_MIME_TYPE as X, supportClipboardAPI as J, ISidebarService as Me, IDialogService as ye, ComponentManager as G } from "@univerjs/ui";
9
- import { filter as u, combineLatest as Ue } from "rxjs";
10
- class xe extends Q {
8
+ import { KeyCode as B, CutCommand as V, CopyCommand as Z, PasteCommand as K, IClipboardInterfaceService as Ue, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as Y, HTML_CLIPBOARD_MIME_TYPE as X, supportClipboardAPI as J, ISidebarService as xe, IDialogService as Be, ComponentManager as G } from "@univerjs/ui";
9
+ import { filter as u, combineLatest as De } from "rxjs";
10
+ class Te extends Q {
11
11
  // eslint-disable-next-line max-lines-per-function
12
12
  _initSheetUIEvent(e) {
13
- const r = e.get(P);
13
+ const r = e.get(R);
14
14
  this.registerEventHandler(
15
15
  this.Event.BeforeSheetEditStart,
16
16
  () => r.beforeCommandExecuted((t) => {
@@ -29,7 +29,7 @@ class xe extends Q {
29
29
  isZenEditor: !1
30
30
  };
31
31
  if (this.fireEvent(this.Event.BeforeSheetEditStart, c), c.cancel)
32
- throw new E();
32
+ throw new b();
33
33
  }
34
34
  })
35
35
  ), this.registerEventHandler(
@@ -40,7 +40,7 @@ class xe extends Q {
40
40
  if (!i) return;
41
41
  const { workbook: o, worksheet: s } = i, d = e.get(p), h = e.get(O), g = t.params, { visible: l, keycode: a, eventType: n } = g, c = d.getEditLocation();
42
42
  if (!l) {
43
- const R = {
43
+ const P = {
44
44
  row: c.row,
45
45
  column: c.column,
46
46
  eventType: n,
@@ -48,11 +48,11 @@ class xe extends Q {
48
48
  workbook: o,
49
49
  worksheet: s,
50
50
  isZenEditor: !1,
51
- value: z.create(h.getUnit(D).getSnapshot()),
51
+ value: F.create(h.getUnit(D).getSnapshot()),
52
52
  isConfirm: a !== B.ESC
53
53
  };
54
- if (this.fireEvent(this.Event.BeforeSheetEditEnd, R), R.cancel)
55
- throw new E();
54
+ if (this.fireEvent(this.Event.BeforeSheetEditEnd, P), P.cancel)
55
+ throw new b();
56
56
  }
57
57
  })
58
58
  ), this.registerEventHandler(
@@ -99,7 +99,7 @@ class xe extends Q {
99
99
  ), this.registerEventHandler(
100
100
  this.Event.SheetEditChanging,
101
101
  () => r.onCommandExecuted((t) => {
102
- if (t.id !== le.id) return;
102
+ if (t.id !== ve.id) return;
103
103
  const i = this.getActiveSheet();
104
104
  if (!i) return;
105
105
  const { workbook: o, worksheet: s } = i, d = e.get(p), h = e.get(O), g = t.params;
@@ -111,7 +111,7 @@ class xe extends Q {
111
111
  worksheet: s,
112
112
  row: a,
113
113
  column: n,
114
- value: z.create(h.getUnit(D).getSnapshot()),
114
+ value: F.create(h.getUnit(D).getSnapshot()),
115
115
  isZenEditor: !1
116
116
  };
117
117
  this.fireEvent(this.Event.SheetEditChanging, c);
@@ -129,7 +129,7 @@ class xe 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 b();
133
133
  })
134
134
  ), this.registerEventHandler(
135
135
  this.Event.SheetZoomChanged,
@@ -150,7 +150,7 @@ class xe extends Q {
150
150
  _initObserverListener(e) {
151
151
  const r = e.get(v), t = e.get(se), i = new j();
152
152
  this.disposeWithMe(t.lifecycle$.subscribe((h) => {
153
- if (h !== L.Rendered) return;
153
+ if (h !== z.Rendered) return;
154
154
  i.dispose();
155
155
  const g = e.get(f), l = e.get(M);
156
156
  g && (this.registerEventHandler(
@@ -351,17 +351,17 @@ class xe extends Q {
351
351
  })), this.disposeWithMe(i);
352
352
  const o = /* @__PURE__ */ new Map();
353
353
  let s;
354
- const d = Ue([
354
+ const d = De([
355
355
  r.created$,
356
356
  t.lifecycle$
357
357
  ]);
358
358
  this.disposeWithMe(d.subscribe(([h, g]) => {
359
- var R;
360
- if (h.type === ae.UNIVER_SHEET && (s = h), g <= L.Rendered || !s) return;
359
+ var P;
360
+ if (h.type === ae.UNIVER_SHEET && (s = h), g <= z.Rendered || !s) return;
361
361
  const l = new j(), a = this.getWorkbook(s.unitId);
362
362
  if (!a) return;
363
- o.get(s.unitId) && ((R = o.get(s.unitId)) == null || R.dispose()), o.set(s.unitId, l);
364
- const n = s.with(x), c = s.with(Se);
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(Ce);
365
365
  l.add(this.registerEventHandler(
366
366
  this.Event.Scroll,
367
367
  () => n.validViewportScrollInfo$.subscribe((S) => {
@@ -426,7 +426,7 @@ class xe extends Q {
426
426
  */
427
427
  _initialize(e) {
428
428
  this._initSheetUIEvent(e), this._initObserverListener(e);
429
- const r = e.get(P);
429
+ const r = e.get(R);
430
430
  this.registerEventHandler(
431
431
  this.Event.BeforeClipboardChange,
432
432
  () => r.beforeCommandExecuted((t) => {
@@ -474,10 +474,10 @@ class xe extends Q {
474
474
  ), this.registerEventHandler(
475
475
  this.Event.SheetSkeletonChanged,
476
476
  () => r.onCommandExecuted((t) => {
477
- if (me.indexOf(t.id) > -1) {
477
+ if (we.indexOf(t.id) > -1) {
478
478
  const i = this.getActiveSheet();
479
479
  if (!i) return;
480
- const o = Ce(t, i.worksheet.getMaxColumns()).map((s) => {
480
+ const o = Ee(t, i.worksheet.getMaxColumns()).map((s) => {
481
481
  var d, h;
482
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);
@@ -513,7 +513,7 @@ class xe 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 b();
517
517
  }
518
518
  _clipboardChanged() {
519
519
  const e = this._generateClipboardCopyParam();
@@ -534,7 +534,7 @@ class xe extends Q {
534
534
  const e = this.getActiveWorkbook(), r = e == null ? void 0 : e.getActiveSheet();
535
535
  if (!e || !r)
536
536
  return;
537
- const o = (await this._injector.get(He).read())[0];
537
+ const o = (await this._injector.get(Ue).read())[0];
538
538
  let s;
539
539
  if (o) {
540
540
  const d = o.types, h = d.indexOf(Y) !== -1 ? await o.getType(Y).then((l) => l && l.text()) : "", g = d.indexOf(X) !== -1 ? await o.getType(X).then((l) => l && l.text()) : "";
@@ -550,12 +550,12 @@ class xe 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 b();
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 b();
559
559
  }
560
560
  async _beforeClipboardPasteAsync() {
561
561
  if (!J()) {
@@ -564,7 +564,7 @@ class xe 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 b();
568
568
  }
569
569
  async _clipboardPasteAsync() {
570
570
  if (!J()) {
@@ -573,7 +573,7 @@ class xe 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 b();
577
577
  }
578
578
  customizeColumnHeader(e) {
579
579
  var g, l;
@@ -647,15 +647,18 @@ class xe extends Q {
647
647
  getProtectedRangeShadowStrategy$() {
648
648
  return this._injector.get(A).getProtectedRangeShadowStrategy$();
649
649
  }
650
+ setPermissionDialogVisible(e) {
651
+ this._injector.get(ce).setShowComponents(e);
652
+ }
650
653
  }
651
- Q.extend(xe);
652
- class Be extends re {
654
+ Q.extend(Te);
655
+ class Ae extends re {
653
656
  openSiderbar(e) {
654
- return this._logDeprecation("openSiderbar"), this._injector.get(Me).open(e);
657
+ return this._logDeprecation("openSiderbar"), this._injector.get(xe).open(e);
655
658
  }
656
659
  openDialog(e) {
657
660
  this._logDeprecation("openDialog");
658
- const t = this._injector.get(ye).open({
661
+ const t = this._injector.get(Be).open({
659
662
  ...e,
660
663
  onClose: () => {
661
664
  t.dispose();
@@ -750,21 +753,21 @@ class Be extends re {
750
753
  );
751
754
  }
752
755
  startEditing() {
753
- const e = this._injector.get(P);
756
+ const e = this._injector.get(R);
754
757
  return this._injector.get(p).isVisible().visible ? !0 : e.syncExecuteCommand(k.id, {
755
- eventType: N.Dblclick,
758
+ eventType: L.Dblclick,
756
759
  unitId: this._workbook.getUnitId(),
757
760
  visible: !0
758
761
  });
759
762
  }
760
763
  async endEditing(e) {
761
- const r = this._injector.get(P);
764
+ const r = this._injector.get(R);
762
765
  return this._injector.get(p).isVisible().visible && r.syncExecuteCommand(k.id, {
763
- eventType: N.Keyboard,
766
+ eventType: L.Keyboard,
764
767
  keycode: e ? B.ENTER : B.ESC,
765
768
  visible: !1,
766
769
  unitId: this._workbook.getUnitId()
767
- }), await ce(0), !0;
770
+ }), await de(0), !0;
768
771
  }
769
772
  endEditingAsync(e = !0) {
770
773
  return this.endEditing(e);
@@ -805,8 +808,8 @@ class Be extends re {
805
808
  return t && t.with(y).showSelection(), this;
806
809
  }
807
810
  }
808
- re.extend(Be);
809
- class De extends ne {
811
+ re.extend(Ae);
812
+ class je extends ne {
810
813
  refreshCanvas() {
811
814
  const e = this._injector.get(v), r = this._fWorkbook.id, t = e.getRenderById(r);
812
815
  if (!t)
@@ -832,7 +835,7 @@ class De extends ne {
832
835
  });
833
836
  }
834
837
  zoom(e) {
835
- const r = this._injector.get(P), t = Math.min(Math.max(e, 0.1), 4);
838
+ const r = this._injector.get(R), t = Math.min(Math.max(e, 0.1), 4);
836
839
  return r.executeCommand($.id, {
837
840
  unitId: this._workbook.getUnitId(),
838
841
  subUnitId: this._worksheet.getSheetId(),
@@ -855,14 +858,14 @@ class De extends ne {
855
858
  if (!s) return i;
856
859
  const d = s == null ? void 0 : s.getVisibleRanges();
857
860
  if (!d) return i;
858
- i = s.getVisibleRangeByViewport(ue.VIEW_MAIN);
861
+ i = s.getVisibleRangeByViewport(Se.VIEW_MAIN);
859
862
  for (const [h, g] of d)
860
- ve.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));
863
+ me.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));
861
864
  return i;
862
865
  }
863
866
  scrollToCell(e, r, t) {
864
867
  const i = this._workbook.getUnitId(), s = this._injector.get(v).getRenderById(i);
865
- return s && (s == null ? void 0 : s.with(fe)).scrollToCell(e, r, t), this;
868
+ return s && (s == null ? void 0 : s.with(Ie)).scrollToCell(e, r, t), this;
866
869
  }
867
870
  getScrollState() {
868
871
  const e = {
@@ -902,7 +905,7 @@ class De extends ne {
902
905
  endRow: this._worksheet.getRowCount() - 1
903
906
  }
904
907
  ];
905
- return this._commandService.syncExecuteCommand(ke.id, {
908
+ return this._commandService.syncExecuteCommand(_e.id, {
906
909
  unitId: t,
907
910
  subUnitId: i,
908
911
  ranges: o
@@ -920,7 +923,7 @@ class De extends ne {
920
923
  endColumn: this._worksheet.getColumnCount() - 1
921
924
  }
922
925
  ];
923
- return this._commandService.syncExecuteCommand(we.id, {
926
+ return this._commandService.syncExecuteCommand(be.id, {
924
927
  unitId: t,
925
928
  subUnitId: i,
926
929
  ranges: o
@@ -938,7 +941,7 @@ class De extends ne {
938
941
  }
939
942
  setColumnHeaderHeight(e) {
940
943
  const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId();
941
- return this._commandService.executeCommand(Ie.id, {
944
+ return this._commandService.executeCommand(Re.id, {
942
945
  unitId: r,
943
946
  subUnitId: t,
944
947
  size: e
@@ -946,7 +949,7 @@ class De extends ne {
946
949
  }
947
950
  setRowHeaderWidth(e) {
948
951
  const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId();
949
- return this._commandService.executeCommand(_e.id, {
952
+ return this._commandService.executeCommand(Pe.id, {
950
953
  unitId: r,
951
954
  subUnitId: t,
952
955
  size: e
@@ -969,14 +972,14 @@ class De extends ne {
969
972
  return s;
970
973
  }
971
974
  }
972
- ne.extend(De);
973
- class Te extends ie {
975
+ ne.extend(je);
976
+ class $e extends ie {
974
977
  setPermissionDialogVisible(e) {
975
978
  this._permissionService.setShowComponents(e);
976
979
  }
977
980
  }
978
- ie.extend(Te);
979
- class Ae extends W {
981
+ ie.extend($e);
982
+ class We extends W {
980
983
  onCellPointerMove(e) {
981
984
  return m(this._injector.get(f).currentPosition$.subscribe(e));
982
985
  }
@@ -989,27 +992,27 @@ class Ae extends W {
989
992
  onCellDrop(e) {
990
993
  return m(this._injector.get(M).endCell$.subscribe(e));
991
994
  }
992
- onCellRender(e, r = de.Style, t = be.DATA_VALIDATION) {
993
- return this._injector.get(Ee).intercept(pe.CELL_CONTENT, {
995
+ onCellRender(e, r = he.Style, t = pe.DATA_VALIDATION) {
996
+ return this._injector.get(fe).intercept(ke.CELL_CONTENT, {
994
997
  effect: r,
995
998
  handler: (i, o, s) => (i && !i.customRender && e && (i.customRender = [...e]), s(i)),
996
999
  priority: t
997
1000
  });
998
1001
  }
999
1002
  onBeforeCellEdit(e) {
1000
- return this._injector.get(P).beforeCommandExecuted((r) => {
1003
+ return this._injector.get(R).beforeCommandExecuted((r) => {
1001
1004
  const t = r.params;
1002
1005
  r.id === k.id && t.visible && e(t);
1003
1006
  });
1004
1007
  }
1005
1008
  onAfterCellEdit(e) {
1006
- return this._injector.get(P).onCommandExecuted((r) => {
1009
+ return this._injector.get(R).onCommandExecuted((r) => {
1007
1010
  const t = r.params;
1008
1011
  r.id === k.id && !t.visible && e(t);
1009
1012
  });
1010
1013
  }
1011
1014
  }
1012
- W.extend(Ae);
1015
+ W.extend(We);
1013
1016
  const H = {
1014
1017
  CellClicked: "CellClicked",
1015
1018
  CellPointerDown: "CellPointerDown",
@@ -1017,7 +1020,7 @@ const H = {
1017
1020
  CellPointerMove: "CellPointerMove",
1018
1021
  CellHover: "CellHover"
1019
1022
  };
1020
- class je {
1023
+ class Oe {
1021
1024
  get BeforeClipboardChange() {
1022
1025
  return "BeforeClipboardChange";
1023
1026
  }
@@ -1115,8 +1118,8 @@ class je {
1115
1118
  return "SheetZoomChanged";
1116
1119
  }
1117
1120
  }
1118
- ge.extend(je);
1119
- class $e extends oe {
1121
+ ue.extend(Oe);
1122
+ class Fe extends oe {
1120
1123
  getCell() {
1121
1124
  var d;
1122
1125
  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(_).getSkeletonParam(i)) == null ? void 0 : d.skeleton;
@@ -1140,7 +1143,7 @@ class $e extends oe {
1140
1143
  attachPopup(e) {
1141
1144
  var s, d, h;
1142
1145
  e.direction = (s = e.direction) != null ? s : "horizontal", e.extraProps = (d = e.extraProps) != null ? d : {}, e.offset = (h = e.offset) != null ? h : [0, 0];
1143
- const { key: r, disposableCollection: t } = q(e, this._injector.get(G)), o = this._injector.get(F).attachPopupToCell(
1146
+ const { key: r, disposableCollection: t } = q(e, this._injector.get(G)), o = this._injector.get(N).attachPopupToCell(
1144
1147
  this._range.startRow,
1145
1148
  this._range.startColumn,
1146
1149
  { ...e, componentKey: r },
@@ -1150,7 +1153,7 @@ class $e extends oe {
1150
1153
  return o ? (t.add(o), t) : (t.dispose(), null);
1151
1154
  }
1152
1155
  attachAlertPopup(e) {
1153
- const r = this._injector.get(Pe), t = {
1156
+ const r = this._injector.get(He), t = {
1154
1157
  workbook: this._workbook,
1155
1158
  worksheet: this._worksheet,
1156
1159
  row: this._range.startRow,
@@ -1182,7 +1185,7 @@ class $e extends oe {
1182
1185
  attachRangePopup(e) {
1183
1186
  var s, d, h;
1184
1187
  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];
1185
- const { key: r, disposableCollection: t } = q(e, this._injector.get(G)), o = this._injector.get(F).attachRangePopup(
1188
+ const { key: r, disposableCollection: t } = q(e, this._injector.get(G)), o = this._injector.get(N).attachRangePopup(
1186
1189
  this._range,
1187
1190
  { ...e, componentKey: r },
1188
1191
  this.getUnitId(),
@@ -1199,15 +1202,34 @@ class $e extends oe {
1199
1202
  });
1200
1203
  }
1201
1204
  showDropdown(e) {
1202
- return this._injector.get(Re).showDropdown(e);
1205
+ return this._injector.get(Me).showDropdown(e);
1206
+ }
1207
+ async autoFill(e, r) {
1208
+ const t = this.getRange(), i = e.getRange();
1209
+ if (!ge.contains(i, t))
1210
+ throw new Error("AutoFill target range must contain source range");
1211
+ const { startRow: o, startColumn: s, endRow: d, endColumn: h } = t, { startRow: g, startColumn: l, endRow: a, endColumn: n } = i;
1212
+ if (d - o !== a - g && h - s !== n - l)
1213
+ throw new Error("AutoFill can only fill in one direction");
1214
+ if (d - o === a - g && s !== l && h !== n)
1215
+ throw new Error("AutoFill can only fill in one direction");
1216
+ if (h - s === n - l && o !== g && d !== a)
1217
+ throw new Error("AutoFill can only fill in one direction");
1218
+ return this._commandService.executeCommand(ye.id, {
1219
+ sourceRange: t,
1220
+ targetRange: i,
1221
+ unitId: this.getUnitId(),
1222
+ subUnitId: this.getSheetId(),
1223
+ applyType: r
1224
+ });
1203
1225
  }
1204
1226
  }
1205
- oe.extend($e);
1206
- function q(b, e) {
1207
- const { componentKey: r, isVue3: t } = b;
1227
+ oe.extend(Fe);
1228
+ function q(E, e) {
1229
+ const { componentKey: r, isVue3: t } = E;
1208
1230
  let i;
1209
1231
  const o = new j();
1210
- return typeof r == "string" ? i = r : (i = `External_${he(6)}`, o.add(e.register(i, r, { framework: t ? "vue3" : "react" }))), {
1232
+ return typeof r == "string" ? i = r : (i = `External_${le(6)}`, o.add(e.register(i, r, { framework: t ? "vue3" : "react" }))), {
1211
1233
  key: i,
1212
1234
  disposableCollection: o
1213
1235
  };