@univerjs/sheets-ui 0.6.0-nightly.202502101606 → 0.6.0-nightly.202502121606

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 (68) hide show
  1. package/lib/cjs/facade.js +1 -1
  2. package/lib/cjs/index.js +38 -36
  3. package/lib/es/facade.js +649 -563
  4. package/lib/es/index.js +3880 -3848
  5. package/lib/types/common/keys.d.ts +1 -1
  6. package/lib/types/components/border-panel/border-line/icons/BorderDashDot.d.ts +1 -1
  7. package/lib/types/components/border-panel/border-line/icons/BorderDashDotDot.d.ts +1 -1
  8. package/lib/types/components/border-panel/border-line/icons/BorderDashed.d.ts +1 -1
  9. package/lib/types/components/border-panel/border-line/icons/BorderDotted.d.ts +1 -1
  10. package/lib/types/components/border-panel/border-line/icons/BorderHair.d.ts +1 -1
  11. package/lib/types/components/border-panel/border-line/icons/BorderMedium.d.ts +1 -1
  12. package/lib/types/components/border-panel/border-line/icons/BorderMediumDashDot.d.ts +1 -1
  13. package/lib/types/components/border-panel/border-line/icons/BorderMediumDashDotDot.d.ts +1 -1
  14. package/lib/types/components/border-panel/border-line/icons/BorderMediumDashed.d.ts +1 -1
  15. package/lib/types/components/border-panel/border-line/icons/BorderThick.d.ts +1 -1
  16. package/lib/types/components/border-panel/border-line/icons/BorderThin.d.ts +1 -1
  17. package/lib/types/components/color-picker/index.d.ts +1 -1
  18. package/lib/types/components/color-picker/interface.d.ts +1 -1
  19. package/lib/types/components/const.d.ts +1 -1
  20. package/lib/types/components/font-family/index.d.ts +1 -1
  21. package/lib/types/components/font-family/interface.d.ts +1 -1
  22. package/lib/types/components/font-size/index.d.ts +1 -1
  23. package/lib/types/components/font-size/interface.d.ts +1 -1
  24. package/lib/types/components/menu-item-input/index.d.ts +1 -1
  25. package/lib/types/consts/plugin-name.d.ts +1 -1
  26. package/lib/types/consts/ui-name.d.ts +1 -1
  27. package/lib/types/controllers/clipboard/const.d.ts +1 -1
  28. package/lib/types/controllers/editor/utils/{isEmbeddingFormulaEditor.d.ts → is-embedding-formula-editor.d.ts} +1 -1
  29. package/lib/types/controllers/editor/utils/{isRangeSelector.d.ts → is-range-selector.d.ts} +1 -1
  30. package/lib/types/controllers/utils/cell-tools.d.ts +1 -1
  31. package/lib/types/facade/f-univer.d.ts +1 -4
  32. package/lib/types/facade/index.d.ts +1 -1
  33. package/lib/types/index.d.ts +4 -4
  34. package/lib/types/locale/zh-CN.d.ts +1 -1
  35. package/lib/types/services/editor-bridge.service.d.ts +2 -0
  36. package/lib/types/views/cell-alert/index.d.ts +1 -1
  37. package/lib/types/views/clipboard/ClipboardPopupMenu.d.ts +1 -1
  38. package/lib/types/views/count-bar/CountBar.d.ts +1 -1
  39. package/lib/types/views/count-bar/ZoomSlider.d.ts +1 -1
  40. package/lib/types/views/count-bar/index.d.ts +1 -1
  41. package/lib/types/views/defined-name/DefinedName.d.ts +1 -1
  42. package/lib/types/views/defined-name/DefinedNameContainer.d.ts +1 -1
  43. package/lib/types/views/defined-name/DefinedNameOverlay.d.ts +1 -1
  44. package/lib/types/views/defined-name/component-name.d.ts +1 -1
  45. package/lib/types/views/editor-container/index.d.ts +1 -1
  46. package/lib/types/views/formula-bar/FormulaBar.d.ts +1 -1
  47. package/lib/types/views/formula-bar/index.d.ts +1 -1
  48. package/lib/types/views/mobile/sheet-bar/MobileSheetBar.d.ts +1 -1
  49. package/lib/types/views/operate-container/index.d.ts +1 -1
  50. package/lib/types/views/permission/error-msg-dialog/index.d.ts +1 -1
  51. package/lib/types/views/permission/error-msg-dialog/interface.d.ts +1 -1
  52. package/lib/types/views/permission/extensions/protect-background-img.d.ts +1 -1
  53. package/lib/types/views/permission/index.d.ts +1 -1
  54. package/lib/types/views/permission/panel-list/constant.d.ts +1 -1
  55. package/lib/types/views/permission/panel-list/index.d.ts +1 -1
  56. package/lib/types/views/permission/permission-dialog/index.d.ts +1 -1
  57. package/lib/types/views/permission/user-dialog/constant.d.ts +1 -1
  58. package/lib/types/views/permission/user-dialog/index.d.ts +1 -1
  59. package/lib/types/views/sheet-bar/SheetBar.d.ts +1 -1
  60. package/lib/types/views/sheet-bar/sheet-bar-tabs/SheetBarTabs.d.ts +1 -1
  61. package/lib/types/views/sheet-bar/sheet-bar-tabs/utils/animate.d.ts +1 -1
  62. package/lib/types/views/sheet-container/SheetContainer.d.ts +1 -1
  63. package/lib/types/views/status-bar/CopyableStatisticItem.d.ts +1 -1
  64. package/lib/types/views/status-bar/StatusBar.d.ts +1 -1
  65. package/lib/umd/facade.js +1 -1
  66. package/lib/umd/index.js +32 -30
  67. package/package.json +11 -11
  68. /package/lib/types/hooks/{useHighlightRange.d.ts → use-highlight-range.d.ts} +0 -0
package/lib/es/facade.js CHANGED
@@ -1,353 +1,423 @@
1
- import { FUniver as ue, ICommandService as P, IUniverInstanceService as L, CanceledError as G, RichTextValue as q, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as A, LifecycleService as Q, DisposableCollection as $, LifecycleStages as ee, UniverInstanceType as pe, ILogService as D, toDisposable as b, awaitTime as Ee, InterceptorEffectEnum as we, FEventName as ve, generateRandomId as _e } from "@univerjs/core";
2
- import { RichTextEditingMutation as ke } from "@univerjs/docs";
3
- import { IRenderManagerService as m, DeviceInputEventType as te, SHEET_VIEWPORT_KEY as Ie, sheetContentViewportKeys as Pe } from "@univerjs/engine-render";
4
- import { SheetsSelectionsService as Re, COMMAND_LISTENER_SKELETON_CHANGE as Me, getSkeletonChangedEffectedRange as ye, SheetInterceptorService as Ue, INTERCEPTOR_POINT as He, InterceptCellContentPriority as xe } from "@univerjs/sheets";
5
- import { SetCellEditVisibleOperation as M, IEditorBridgeService as W, SetZoomRatioCommand as re, HoverManagerService as _, DragManagerService as H, SheetScrollManagerService as B, SheetPasteShortKeyCommand as ne, ISheetClipboardService as Se, SheetSkeletonManagerService as R, SHEET_VIEW_KEY as k, ISheetSelectionRenderService as x, ChangeZoomRatioCommand as De, SheetsScrollRenderController as Be, SetWorksheetColAutoWidthCommand as Te, SetColumnHeaderHeightCommand as Le, SetRowHeaderWidthCommand as Ae, SheetCanvasPopManagerService as ie, CellAlertManagerService as We, IMarkSelectionService as $e } from "@univerjs/sheets-ui";
6
- import { FSheetHooks as j, FWorkbook as Ce, FWorksheet as me, FPermission as be, FRange as fe } from "@univerjs/sheets/facade";
7
- import { KeyCode as T, CutCommand as oe, CopyCommand as se, PasteCommand as ae, IClipboardInterfaceService as je, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as ce, HTML_CLIPBOARD_MIME_TYPE as de, supportClipboardAPI as he, ISidebarService as Oe, IDialogService as Fe, ComponentManager as le } from "@univerjs/ui";
8
- import { filter as S, combineLatest as Ne } from "rxjs";
9
- class ze extends ue {
1
+ import { FUniver as te, ICommandService as P, CanceledError as j, IUniverInstanceService as A, RichTextValue as O, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as W, LifecycleService as L, DisposableCollection as y, LifecycleStages as F, UniverInstanceType as ce, ILogService as D, toDisposable as b, awaitTime as de, InterceptorEffectEnum as he, FEventName as re, generateRandomId as le } from "@univerjs/core";
2
+ import { RichTextEditingMutation as ge } from "@univerjs/docs";
3
+ import { IRenderManagerService as m, DeviceInputEventType as N, SHEET_VIEWPORT_KEY as ue, sheetContentViewportKeys as ve } from "@univerjs/engine-render";
4
+ import { SheetsSelectionsService as Se, COMMAND_LISTENER_SKELETON_CHANGE as Ce, getSkeletonChangedEffectedRange as me, SheetInterceptorService as be, INTERCEPTOR_POINT as Ee, InterceptCellContentPriority as pe } from "@univerjs/sheets";
5
+ import { SetCellEditVisibleOperation as k, IEditorBridgeService as H, SetZoomRatioCommand as z, HoverManagerService as w, DragManagerService as U, SheetScrollManagerService as T, SheetPasteShortKeyCommand as V, ISheetClipboardService as ne, SheetSkeletonManagerService as R, SHEET_VIEW_KEY as f, ISheetSelectionRenderService as x, ChangeZoomRatioCommand as we, SheetsScrollRenderController as fe, SetWorksheetColAutoWidthCommand as ke, SetColumnHeaderHeightCommand as Ie, SetRowHeaderWidthCommand as _e, SheetCanvasPopManagerService as Z, CellAlertManagerService as Pe, IMarkSelectionService as Re } from "@univerjs/sheets-ui";
6
+ import { FSheetHooks as $, FWorkbook as ie, FWorksheet as oe, FPermission as se, FRange as ae } from "@univerjs/sheets/facade";
7
+ import { KeyCode as B, CutCommand as K, CopyCommand as Y, PasteCommand as X, IClipboardInterfaceService as He, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as J, HTML_CLIPBOARD_MIME_TYPE as G, supportClipboardAPI as q, ISidebarService as Me, IDialogService as ye, ComponentManager as Q } from "@univerjs/ui";
8
+ import { filter as S, combineLatest as Ue } from "rxjs";
9
+ class xe extends te {
10
10
  // eslint-disable-next-line max-lines-per-function
11
11
  _initSheetUIEvent(e) {
12
- const t = e.get(P);
13
- this.disposeWithMe(t.beforeCommandExecuted((r) => {
14
- if (r.id === M.id) {
15
- if (!this._eventListend(this.Event.BeforeSheetEditStart) && !this._eventListend(this.Event.BeforeSheetEditEnd))
16
- return;
17
- const i = this.getActiveSheet();
18
- if (!i)
19
- return;
20
- const { workbook: o, worksheet: s } = i, a = e.get(W), g = e.get(L), v = r.params, { visible: l, keycode: h, eventType: C } = v, d = a.getEditLocation();
21
- if (l) {
22
- const p = {
23
- row: d.row,
24
- column: d.column,
12
+ const r = e.get(P);
13
+ this.registerEventHandler(
14
+ this.Event.BeforeSheetEditStart,
15
+ () => r.beforeCommandExecuted((t) => {
16
+ if (t.id !== k.id) return;
17
+ const n = this.getActiveSheet();
18
+ if (!n) return;
19
+ const { workbook: o, worksheet: s } = n, c = e.get(H), g = t.params, { visible: u, keycode: l, eventType: C } = g, v = c.getEditLocation();
20
+ if (u) {
21
+ const h = {
22
+ row: v.row,
23
+ column: v.column,
25
24
  eventType: C,
26
- keycode: h,
25
+ keycode: l,
27
26
  workbook: o,
28
27
  worksheet: s,
29
28
  isZenEditor: !1
30
29
  };
31
- if (this.fireEvent(this.Event.BeforeSheetEditStart, p), p.cancel)
32
- throw new G();
33
- } else {
34
- const p = {
35
- row: d.row,
36
- column: d.column,
37
- eventType: C,
38
- keycode: h,
30
+ if (this.fireEvent(this.Event.BeforeSheetEditStart, h), h.cancel)
31
+ throw new j();
32
+ }
33
+ })
34
+ ), this.registerEventHandler(
35
+ this.Event.BeforeSheetEditEnd,
36
+ () => r.beforeCommandExecuted((t) => {
37
+ if (t.id !== k.id) return;
38
+ const n = this.getActiveSheet();
39
+ if (!n) return;
40
+ const { workbook: o, worksheet: s } = n, c = e.get(H), g = e.get(A), u = t.params, { visible: l, keycode: C, eventType: v } = u, h = c.getEditLocation();
41
+ if (!l) {
42
+ const I = {
43
+ row: h.row,
44
+ column: h.column,
45
+ eventType: v,
46
+ keycode: C,
39
47
  workbook: o,
40
48
  worksheet: s,
41
49
  isZenEditor: !1,
42
- value: q.create(g.getUnit(A).getSnapshot()),
43
- isConfirm: h !== T.ESC
50
+ value: O.create(g.getUnit(W).getSnapshot()),
51
+ isConfirm: C !== B.ESC
44
52
  };
45
- if (this.fireEvent(this.Event.BeforeSheetEditEnd, p), p.cancel)
46
- throw new G();
53
+ if (this.fireEvent(this.Event.BeforeSheetEditEnd, I), I.cancel)
54
+ throw new j();
47
55
  }
48
- }
49
- if (r.id === re.id) {
50
- if (!this._eventListend(this.Event.BeforeSheetZoomChange))
51
- return;
52
- const i = this.getCommandSheetTarget(r);
53
- if (!i)
54
- return;
55
- const { workbook: o, worksheet: s } = i;
56
- this.fireEvent(this.Event.BeforeSheetZoomChange, {
57
- zoom: r.params.zoomRatio,
58
- workbook: o,
59
- worksheet: s
60
- });
61
- }
62
- })), this.disposeWithMe(t.onCommandExecuted((r) => {
63
- if (r.id === M.id) {
64
- if (!this._eventListend(this.Event.SheetEditStarted) && !this._eventListend(this.Event.SheetEditEnded))
65
- return;
66
- const i = this.getCommandSheetTarget(r);
67
- if (!i)
68
- return;
69
- const { workbook: o, worksheet: s } = i, a = e.get(W), g = r.params, { visible: v, keycode: l, eventType: h } = g, C = a.getEditLocation();
70
- if (v) {
71
- const d = {
72
- row: C.row,
73
- column: C.column,
74
- eventType: h,
56
+ })
57
+ ), this.registerEventHandler(
58
+ this.Event.SheetEditStarted,
59
+ () => r.onCommandExecuted((t) => {
60
+ if (t.id !== k.id) return;
61
+ const n = this.getCommandSheetTarget(t);
62
+ if (!n) return;
63
+ const { workbook: o, worksheet: s } = n, c = e.get(H), g = t.params, { visible: u, keycode: l, eventType: C } = g, v = c.getEditLocation();
64
+ if (u) {
65
+ const h = {
66
+ row: v.row,
67
+ column: v.column,
68
+ eventType: C,
75
69
  keycode: l,
76
70
  workbook: o,
77
71
  worksheet: s,
78
72
  isZenEditor: !1
79
73
  };
80
- this.fireEvent(this.Event.SheetEditStarted, d);
81
- } else {
82
- const d = {
83
- row: C.row,
84
- column: C.column,
85
- eventType: h,
74
+ this.fireEvent(this.Event.SheetEditStarted, h);
75
+ }
76
+ })
77
+ ), this.registerEventHandler(
78
+ this.Event.SheetEditEnded,
79
+ () => r.onCommandExecuted((t) => {
80
+ if (t.id !== k.id) return;
81
+ const n = this.getCommandSheetTarget(t);
82
+ if (!n) return;
83
+ const { workbook: o, worksheet: s } = n, c = e.get(H), g = t.params, { visible: u, keycode: l, eventType: C } = g, v = c.getEditLocation();
84
+ if (!u) {
85
+ const h = {
86
+ row: v.row,
87
+ column: v.column,
88
+ eventType: C,
86
89
  keycode: l,
87
90
  workbook: o,
88
91
  worksheet: s,
89
92
  isZenEditor: !1,
90
- isConfirm: l !== T.ESC
93
+ isConfirm: l !== B.ESC
91
94
  };
92
- this.fireEvent(this.Event.SheetEditEnded, d);
95
+ this.fireEvent(this.Event.SheetEditEnded, h);
93
96
  }
94
- }
95
- if (r.id === ke.id) {
96
- if (!this._eventListend(this.Event.SheetEditChanging))
97
- return;
98
- const i = this.getCommandSheetTarget(r);
99
- if (!i)
100
- return;
101
- const { workbook: o, worksheet: s } = i, a = e.get(W), g = e.get(L), v = r.params;
102
- if (!a.isVisible().visible) return;
103
- const { unitId: l } = v;
104
- if (l === A) {
105
- const { row: h, column: C } = a.getEditLocation(), d = {
97
+ })
98
+ ), this.registerEventHandler(
99
+ this.Event.SheetEditChanging,
100
+ () => r.onCommandExecuted((t) => {
101
+ if (t.id !== ge.id) return;
102
+ const n = this.getCommandSheetTarget(t);
103
+ if (!n) return;
104
+ const { workbook: o, worksheet: s } = n, c = e.get(H), g = e.get(A), u = t.params;
105
+ if (!c.isVisible().visible) return;
106
+ const { unitId: l } = u;
107
+ if (l === W) {
108
+ const { row: C, column: v } = c.getEditLocation(), h = {
106
109
  workbook: o,
107
110
  worksheet: s,
108
- row: h,
109
- column: C,
110
- value: q.create(g.getUnit(A).getSnapshot()),
111
+ row: C,
112
+ column: v,
113
+ value: O.create(g.getUnit(W).getSnapshot()),
111
114
  isZenEditor: !1
112
115
  };
113
- this.fireEvent(this.Event.SheetEditChanging, d);
116
+ this.fireEvent(this.Event.SheetEditChanging, h);
114
117
  }
115
- }
116
- if (r.id === re.id) {
117
- if (!this._eventListend(this.Event.SheetZoomChanged))
118
- return;
119
- const i = this.getCommandSheetTarget(r);
120
- if (!i)
121
- return;
122
- const { workbook: o, worksheet: s } = i;
118
+ })
119
+ ), this.registerEventHandler(
120
+ this.Event.BeforeSheetZoomChange,
121
+ () => r.beforeCommandExecuted((t) => {
122
+ if (t.id !== z.id) return;
123
+ const n = this.getCommandSheetTarget(t);
124
+ if (!n) return;
125
+ const { workbook: o, worksheet: s } = n;
126
+ this.fireEvent(this.Event.BeforeSheetZoomChange, {
127
+ zoom: t.params.zoomRatio,
128
+ workbook: o,
129
+ worksheet: s
130
+ });
131
+ })
132
+ ), this.registerEventHandler(
133
+ this.Event.SheetZoomChanged,
134
+ () => r.onCommandExecuted((t) => {
135
+ if (t.id !== z.id) return;
136
+ const n = this.getCommandSheetTarget(t);
137
+ if (!n) return;
138
+ const { workbook: o, worksheet: s } = n;
123
139
  this.fireEvent(this.Event.SheetZoomChanged, {
124
140
  zoom: s.getZoom(),
125
141
  workbook: o,
126
142
  worksheet: s
127
143
  });
128
- }
129
- })), this._initObserverListener(e);
144
+ })
145
+ );
130
146
  }
131
- /**
132
- * @ignore
133
- */
134
147
  // eslint-disable-next-line max-lines-per-function
135
148
  _initObserverListener(e) {
136
- const r = e.get(L).getFocusedUnit(), i = r == null ? void 0 : r.getUnitId(), o = e.get(m);
137
- if (i) {
138
- const l = e.get(Q), h = new $();
139
- this.disposeWithMe(l.lifecycle$.subscribe((C) => {
140
- var I, y, u, f, E, O, F, N, z, V, Z, K, Y, X, J;
141
- if (C < ee.Rendered) return;
142
- h.dispose();
143
- const d = e.get(_), p = e.get(H);
144
- d && (h.add(
145
- (I = d.currentClickedCell$) == null ? void 0 : I.pipe(S((n) => !!n)).subscribe((n) => {
146
- if (!this._eventListend(this.Event.CellClicked)) return;
147
- const c = this.getSheetTarget(n.location.unitId, n.location.subUnitId);
148
- c && this.fireEvent(this.Event.CellClicked, {
149
- ...c,
150
- ...n,
151
- row: n.location.row,
152
- column: n.location.col
149
+ const t = e.get(A).getFocusedUnit(), n = t == null ? void 0 : t.getUnitId(), o = e.get(m);
150
+ if (n) {
151
+ const l = e.get(L), C = new y();
152
+ this.disposeWithMe(l.lifecycle$.subscribe((v) => {
153
+ if (v < F.Rendered) return;
154
+ C.dispose();
155
+ const h = e.get(w), I = e.get(U);
156
+ h && (this.registerEventHandler(
157
+ this.Event.CellClicked,
158
+ () => {
159
+ var d;
160
+ return (d = h.currentClickedCell$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
161
+ const a = this.getSheetTarget(i.location.unitId, i.location.subUnitId);
162
+ a && this.fireEvent(this.Event.CellClicked, {
163
+ ...a,
164
+ ...i,
165
+ row: i.location.row,
166
+ column: i.location.col
167
+ });
153
168
  });
154
- })
155
- ), h.add(
156
- (y = d.currentRichText$) == null ? void 0 : y.pipe(S((n) => !!n)).subscribe((n) => {
157
- if (!this._eventListend(this.Event.CellHover)) return;
158
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
159
- c && this.fireEvent(this.Event.CellHover, {
160
- ...c,
161
- ...n,
162
- row: n.row,
163
- column: n.col
169
+ }
170
+ ), this.registerEventHandler(
171
+ this.Event.CellHover,
172
+ () => {
173
+ var d;
174
+ return (d = h.currentRichText$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
175
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
176
+ a && this.fireEvent(this.Event.CellHover, {
177
+ ...a,
178
+ ...i,
179
+ row: i.row,
180
+ column: i.col
181
+ });
164
182
  });
165
- })
166
- ), h.add(
167
- (u = d.currentPointerDownCell$) == null ? void 0 : u.pipe(S((n) => !!n)).subscribe((n) => {
168
- if (!this._eventListend(this.Event.CellPointerDown)) return;
169
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
170
- c && this.fireEvent(this.Event.CellPointerDown, {
171
- ...c,
172
- ...n,
173
- row: n.row,
174
- column: n.col
183
+ }
184
+ ), this.registerEventHandler(
185
+ this.Event.CellPointerDown,
186
+ () => {
187
+ var d;
188
+ return (d = h.currentPointerDownCell$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
189
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
190
+ a && this.fireEvent(this.Event.CellPointerDown, {
191
+ ...a,
192
+ ...i,
193
+ row: i.row,
194
+ column: i.col
195
+ });
175
196
  });
176
- })
177
- ), h.add(
178
- (f = d.currentPointerUpCell$) == null ? void 0 : f.pipe(S((n) => !!n)).subscribe((n) => {
179
- if (!this._eventListend(this.Event.CellPointerUp)) return;
180
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
181
- c && this.fireEvent(this.Event.CellPointerUp, {
182
- ...c,
183
- ...n,
184
- row: n.row,
185
- column: n.col
197
+ }
198
+ ), this.registerEventHandler(
199
+ this.Event.CellPointerUp,
200
+ () => {
201
+ var d;
202
+ return (d = h.currentPointerUpCell$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
203
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
204
+ a && this.fireEvent(this.Event.CellPointerUp, {
205
+ ...a,
206
+ ...i,
207
+ row: i.row,
208
+ column: i.col
209
+ });
186
210
  });
187
- })
188
- ), h.add(
189
- (E = d.currentCellPosWithEvent$) == null ? void 0 : E.pipe(S((n) => !!n)).subscribe((n) => {
190
- if (!this._eventListend(this.Event.CellPointerMove)) return;
191
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
192
- c && this.fireEvent(this.Event.CellPointerMove, {
193
- ...c,
194
- ...n,
195
- row: n.row,
196
- column: n.col
211
+ }
212
+ ), this.registerEventHandler(
213
+ this.Event.CellPointerMove,
214
+ () => {
215
+ var d;
216
+ return (d = h.currentCellPosWithEvent$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
217
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
218
+ a && this.fireEvent(this.Event.CellPointerMove, {
219
+ ...a,
220
+ ...i,
221
+ row: i.row,
222
+ column: i.col
223
+ });
197
224
  });
198
- })
199
- ), h.add(
200
- (O = p.currentCell$) == null ? void 0 : O.pipe(S((n) => !!n)).subscribe((n) => {
201
- if (!this._eventListend(this.Event.DragOver)) return;
202
- const c = this.getSheetTarget(n.location.unitId, n.location.subUnitId);
203
- c && this.fireEvent(this.Event.DragOver, {
204
- ...c,
205
- ...n,
206
- row: n.location.row,
207
- column: n.location.col
225
+ }
226
+ ), this.registerEventHandler(
227
+ this.Event.DragOver,
228
+ () => {
229
+ var d;
230
+ return (d = I.currentCell$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
231
+ const a = this.getSheetTarget(i.location.unitId, i.location.subUnitId);
232
+ a && this.fireEvent(this.Event.DragOver, {
233
+ ...a,
234
+ ...i,
235
+ row: i.location.row,
236
+ column: i.location.col
237
+ });
208
238
  });
209
- })
210
- ), h.add(
211
- (F = p.endCell$) == null ? void 0 : F.pipe(S((n) => !!n)).subscribe((n) => {
212
- if (!this._eventListend(this.Event.Drop)) return;
213
- const c = this.getSheetTarget(n.location.unitId, n.location.subUnitId);
214
- c && this.fireEvent(this.Event.Drop, {
215
- ...c,
216
- ...n,
217
- row: n.location.row,
218
- column: n.location.col
239
+ }
240
+ ), this.registerEventHandler(
241
+ this.Event.Drop,
242
+ () => {
243
+ var d;
244
+ return (d = I.endCell$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
245
+ const a = this.getSheetTarget(i.location.unitId, i.location.subUnitId);
246
+ a && this.fireEvent(this.Event.Drop, {
247
+ ...a,
248
+ ...i,
249
+ row: i.location.row,
250
+ column: i.location.col
251
+ });
219
252
  });
220
- })
221
- ), h.add(
222
- (N = d.currentRowHeaderClick$) == null ? void 0 : N.pipe(S((n) => !!n)).subscribe((n) => {
223
- if (!this._eventListend(this.Event.RowHeaderClick)) return;
224
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
225
- c && this.fireEvent(this.Event.RowHeaderClick, {
226
- ...c,
227
- row: n.index
253
+ }
254
+ ), this.registerEventHandler(
255
+ this.Event.RowHeaderClick,
256
+ () => {
257
+ var d;
258
+ return (d = h.currentRowHeaderClick$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
259
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
260
+ a && this.fireEvent(this.Event.RowHeaderClick, {
261
+ ...a,
262
+ row: i.index
263
+ });
228
264
  });
229
- })
230
- ), h.add(
231
- (z = d.currentRowHeaderPointerDown$) == null ? void 0 : z.pipe(S((n) => !!n)).subscribe((n) => {
232
- if (!this._eventListend(this.Event.RowHeaderPointerDown)) return;
233
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
234
- c && this.fireEvent(this.Event.RowHeaderPointerDown, {
235
- ...c,
236
- row: n.index
265
+ }
266
+ ), this.registerEventHandler(
267
+ this.Event.RowHeaderPointerDown,
268
+ () => {
269
+ var d;
270
+ return (d = h.currentRowHeaderPointerDown$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
271
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
272
+ a && this.fireEvent(this.Event.RowHeaderPointerDown, {
273
+ ...a,
274
+ row: i.index
275
+ });
237
276
  });
238
- })
239
- ), h.add(
240
- (V = d.currentRowHeaderPointerUp$) == null ? void 0 : V.pipe(S((n) => !!n)).subscribe((n) => {
241
- if (!this._eventListend(this.Event.RowHeaderPointerUp)) return;
242
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
243
- c && this.fireEvent(this.Event.RowHeaderPointerUp, {
244
- ...c,
245
- row: n.index
277
+ }
278
+ ), this.registerEventHandler(
279
+ this.Event.RowHeaderPointerUp,
280
+ () => {
281
+ var d;
282
+ return (d = h.currentRowHeaderPointerUp$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
283
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
284
+ a && this.fireEvent(this.Event.RowHeaderPointerUp, {
285
+ ...a,
286
+ row: i.index
287
+ });
246
288
  });
247
- })
248
- ), h.add(
249
- (Z = d.currentHoveredRowHeader$) == null ? void 0 : Z.pipe(S((n) => !!n)).subscribe((n) => {
250
- if (!this._eventListend(this.Event.RowHeaderHover)) return;
251
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
252
- c && this.fireEvent(this.Event.RowHeaderHover, {
253
- ...c,
254
- row: n.index
289
+ }
290
+ ), this.registerEventHandler(
291
+ this.Event.RowHeaderHover,
292
+ () => {
293
+ var d;
294
+ return (d = h.currentHoveredRowHeader$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
295
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
296
+ a && this.fireEvent(this.Event.RowHeaderHover, {
297
+ ...a,
298
+ row: i.index
299
+ });
255
300
  });
256
- })
257
- ), h.add(
258
- (K = d.currentColHeaderClick$) == null ? void 0 : K.pipe(S((n) => !!n)).subscribe((n) => {
259
- if (!this._eventListend(this.Event.ColumnHeaderClick)) return;
260
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
261
- c && this.fireEvent(this.Event.ColumnHeaderClick, {
262
- ...c,
263
- column: n.index
301
+ }
302
+ ), this.registerEventHandler(
303
+ this.Event.ColumnHeaderClick,
304
+ () => {
305
+ var d;
306
+ return (d = h.currentColHeaderClick$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
307
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
308
+ a && this.fireEvent(this.Event.ColumnHeaderClick, {
309
+ ...a,
310
+ column: i.index
311
+ });
264
312
  });
265
- })
266
- ), h.add(
267
- (Y = d.currentColHeaderPointerDown$) == null ? void 0 : Y.pipe(S((n) => !!n)).subscribe((n) => {
268
- if (!this._eventListend(this.Event.ColumnHeaderPointerDown)) return;
269
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
270
- c && this.fireEvent(this.Event.ColumnHeaderPointerDown, {
271
- ...c,
272
- column: n.index
313
+ }
314
+ ), this.registerEventHandler(
315
+ this.Event.ColumnHeaderPointerDown,
316
+ () => {
317
+ var d;
318
+ return (d = h.currentColHeaderPointerDown$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
319
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
320
+ a && this.fireEvent(this.Event.ColumnHeaderPointerDown, {
321
+ ...a,
322
+ column: i.index
323
+ });
273
324
  });
274
- })
275
- ), h.add(
276
- (X = d.currentColHeaderPointerUp$) == null ? void 0 : X.pipe(S((n) => !!n)).subscribe((n) => {
277
- if (!this._eventListend(this.Event.ColumnHeaderPointerUp)) return;
278
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
279
- c && this.fireEvent(this.Event.ColumnHeaderPointerUp, {
280
- ...c,
281
- column: n.index
325
+ }
326
+ ), this.registerEventHandler(
327
+ this.Event.ColumnHeaderPointerUp,
328
+ () => {
329
+ var d;
330
+ return (d = h.currentColHeaderPointerUp$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
331
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
332
+ a && this.fireEvent(this.Event.ColumnHeaderPointerUp, {
333
+ ...a,
334
+ column: i.index
335
+ });
282
336
  });
283
- })
284
- ), h.add(
285
- (J = d.currentHoveredColHeader$) == null ? void 0 : J.pipe(S((n) => !!n)).subscribe((n) => {
286
- if (!this._eventListend(this.Event.ColumnHeaderHover)) return;
287
- const c = this.getSheetTarget(n.unitId, n.subUnitId);
288
- c && this.fireEvent(this.Event.ColumnHeaderHover, {
289
- ...c,
290
- column: n.index
337
+ }
338
+ ), this.registerEventHandler(
339
+ this.Event.ColumnHeaderHover,
340
+ () => {
341
+ var d;
342
+ return (d = h.currentHoveredColHeader$) == null ? void 0 : d.pipe(S((i) => !!i)).subscribe((i) => {
343
+ const a = this.getSheetTarget(i.unitId, i.subUnitId);
344
+ a && this.fireEvent(this.Event.ColumnHeaderHover, {
345
+ ...a,
346
+ column: i.index
347
+ });
291
348
  });
292
- })
349
+ }
293
350
  ));
294
- })), this.disposeWithMe(h);
351
+ })), this.disposeWithMe(C);
295
352
  }
296
353
  const s = /* @__PURE__ */ new Map();
297
- let a;
298
- const g = e.get(Q), v = Ne([
354
+ let c;
355
+ const g = e.get(L), u = Ue([
299
356
  o.created$,
300
357
  g.lifecycle$
301
358
  ]);
302
- this.disposeWithMe(v.subscribe(([l, h]) => {
303
- var y;
304
- if (l.type === pe.UNIVER_SHEET && (a = l), h <= ee.Rendered) return;
305
- const C = new $();
306
- if (!a) return;
307
- const d = this.getWorkbook(a.unitId);
308
- if (!d) return;
309
- s.get(a.unitId) && ((y = s.get(a.unitId)) == null || y.dispose()), s.set(a.unitId, C);
310
- const p = a.with(B);
311
- C.add(p.validViewportScrollInfo$.subscribe((u) => {
312
- u && this._eventListend(this.Event.Scroll) && this.fireEvent(this.Event.Scroll, {
313
- workbook: d,
314
- worksheet: d.getActiveSheet(),
315
- ...u
316
- });
317
- }));
318
- const I = a.with(Re);
319
- C.add(I.selectionMoveStart$.subscribe((u) => {
320
- var f;
321
- this._eventListend(this.Event.SelectionMoveStart) && this.fireEvent(this.Event.SelectionMoveStart, {
322
- workbook: d,
323
- worksheet: d.getActiveSheet(),
324
- selections: (f = u == null ? void 0 : u.map((E) => E.range)) != null ? f : []
325
- });
326
- })), C.add(I.selectionMoving$.subscribe((u) => {
327
- var f;
328
- this._eventListend(this.Event.SelectionMoving) && this.fireEvent(this.Event.SelectionMoving, {
329
- workbook: d,
330
- worksheet: d.getActiveSheet(),
331
- selections: (f = u == null ? void 0 : u.map((E) => E.range)) != null ? f : []
332
- });
333
- })), C.add(I.selectionMoveEnd$.subscribe((u) => {
334
- var f;
335
- this._eventListend(this.Event.SelectionMoveEnd) && this.fireEvent(this.Event.SelectionMoveEnd, {
336
- workbook: d,
337
- worksheet: d.getActiveSheet(),
338
- selections: (f = u == null ? void 0 : u.map((E) => E.range)) != null ? f : []
339
- });
340
- })), C.add(I.selectionChanged$.subscribe((u) => {
341
- var f;
342
- this._eventListend(this.Event.SelectionChanged) && this.fireEvent(this.Event.SelectionChanged, {
343
- workbook: d,
344
- worksheet: d.getActiveSheet(),
345
- selections: (f = u == null ? void 0 : u.map((E) => E.range)) != null ? f : []
346
- });
347
- })), a = null, this.disposeWithMe(C);
359
+ this.disposeWithMe(u.subscribe(([l, C]) => {
360
+ var i;
361
+ if (l.type === ce.UNIVER_SHEET && (c = l), C <= F.Rendered) return;
362
+ const v = new y();
363
+ if (!c) return;
364
+ const h = this.getWorkbook(c.unitId);
365
+ if (!h) return;
366
+ s.get(c.unitId) && ((i = s.get(c.unitId)) == null || i.dispose()), s.set(c.unitId, v);
367
+ const I = c.with(T), d = c.with(Se);
368
+ v.add(this.registerEventHandler(
369
+ this.Event.Scroll,
370
+ () => I.validViewportScrollInfo$.subscribe((a) => {
371
+ a && this.fireEvent(this.Event.Scroll, {
372
+ workbook: h,
373
+ worksheet: h.getActiveSheet(),
374
+ ...a
375
+ });
376
+ })
377
+ )), v.add(this.registerEventHandler(
378
+ this.Event.SelectionMoveStart,
379
+ () => d.selectionMoveStart$.subscribe((a) => {
380
+ var E;
381
+ this.fireEvent(this.Event.SelectionMoveStart, {
382
+ workbook: h,
383
+ worksheet: h.getActiveSheet(),
384
+ selections: (E = a == null ? void 0 : a.map((_) => _.range)) != null ? E : []
385
+ });
386
+ })
387
+ )), v.add(this.registerEventHandler(
388
+ this.Event.SelectionMoving,
389
+ () => d.selectionMoving$.subscribe((a) => {
390
+ var E;
391
+ this.fireEvent(this.Event.SelectionMoving, {
392
+ workbook: h,
393
+ worksheet: h.getActiveSheet(),
394
+ selections: (E = a == null ? void 0 : a.map((_) => _.range)) != null ? E : []
395
+ });
396
+ })
397
+ )), v.add(this.registerEventHandler(
398
+ this.Event.SelectionMoveEnd,
399
+ () => d.selectionMoveEnd$.subscribe((a) => {
400
+ var E;
401
+ this.fireEvent(this.Event.SelectionMoveEnd, {
402
+ workbook: h,
403
+ worksheet: h.getActiveSheet(),
404
+ selections: (E = a == null ? void 0 : a.map((_) => _.range)) != null ? E : []
405
+ });
406
+ })
407
+ )), v.add(this.registerEventHandler(
408
+ this.Event.SelectionChanged,
409
+ () => d.selectionChanged$.subscribe((a) => {
410
+ var E;
411
+ this.fireEvent(this.Event.SelectionChanged, {
412
+ workbook: h,
413
+ worksheet: h.getActiveSheet(),
414
+ selections: (E = a == null ? void 0 : a.map((_) => _.range)) != null ? E : []
415
+ });
416
+ })
417
+ )), c = null, this.disposeWithMe(v);
348
418
  })), this.disposeWithMe(o.disposed$.subscribe((l) => {
349
- var h;
350
- (h = s.get(l)) == null || h.dispose(), s.delete(l);
419
+ var C;
420
+ (C = s.get(l)) == null || C.dispose(), s.delete(l);
351
421
  })), this.disposeWithMe(() => {
352
422
  s.forEach((l) => {
353
423
  l.dispose();
@@ -357,85 +427,109 @@ class ze extends ue {
357
427
  /**
358
428
  * @ignore
359
429
  */
430
+ // eslint-disable-next-line max-lines-per-function
360
431
  _initialize(e) {
361
- this._initSheetUIEvent(e);
362
- const t = e.get(P);
363
- this.disposeWithMe(t.beforeCommandExecuted((r) => {
364
- switch (r.id) {
365
- case se.id:
366
- case oe.id:
367
- this._beforeClipboardChange();
368
- break;
369
- case ne.id:
370
- this._beforeClipboardPaste(r.params);
371
- break;
432
+ this._initSheetUIEvent(e), this._initObserverListener(e);
433
+ const r = e.get(P);
434
+ this.registerEventHandler(
435
+ this.Event.BeforeClipboardChange,
436
+ () => {
437
+ const t = new y();
438
+ return t.add(
439
+ r.beforeCommandExecuted((n) => {
440
+ switch (n.id) {
441
+ case Y.id:
442
+ case K.id:
443
+ this._beforeClipboardChange();
444
+ break;
445
+ }
446
+ })
447
+ ), t;
448
+ }
449
+ ), this.registerEventHandler(
450
+ this.Event.ClipboardChanged,
451
+ () => {
452
+ const t = new y();
453
+ return t.add(r.beforeCommandExecuted((n) => {
454
+ switch (n.id) {
455
+ case V.id:
456
+ this._beforeClipboardPaste(n.params);
457
+ break;
458
+ }
459
+ })), t.add(
460
+ r.beforeCommandExecuted(async (n) => {
461
+ switch (n.id) {
462
+ case X.id:
463
+ await this._beforeClipboardPasteAsync();
464
+ break;
465
+ }
466
+ })
467
+ ), t;
372
468
  }
373
- })), this.disposeWithMe(t.onCommandExecuted((r) => {
374
- if (Me.indexOf(r.id) > -1) {
375
- if (!this._eventListend(this.Event.SheetSkeletonChanged)) return;
376
- const i = this.getActiveSheet();
377
- if (!i) return;
378
- const o = ye(r).map((s) => {
379
- var a, g;
380
- return (g = (a = this.getWorkbook(s.unitId)) == null ? void 0 : a.getSheetBySheetId(s.subUnitId)) == null ? void 0 : g.getRange(s.range);
469
+ ), this.disposeWithMe(r.onCommandExecuted((t) => {
470
+ if (Ce.indexOf(t.id) > -1) {
471
+ const n = this.getActiveSheet();
472
+ if (!n) return;
473
+ const o = me(t, n.worksheet.getMaxColumns()).map((s) => {
474
+ var c, g;
475
+ return (g = (c = this.getWorkbook(s.unitId)) == null ? void 0 : c.getSheetBySheetId(s.subUnitId)) == null ? void 0 : g.getRange(s.range);
381
476
  }).filter(Boolean);
382
477
  if (!o.length) return;
383
478
  this.fireEvent(this.Event.SheetSkeletonChanged, {
384
- workbook: i.workbook,
385
- worksheet: i.worksheet,
386
- payload: r,
387
- skeleton: i.worksheet.getSkeleton(),
479
+ workbook: n.workbook,
480
+ worksheet: n.worksheet,
481
+ payload: t,
482
+ skeleton: n.worksheet.getSkeleton(),
388
483
  effectedRanges: o
389
484
  });
390
- return;
391
- }
392
- switch (r.id) {
393
- case se.id:
394
- case oe.id:
395
- this._clipboardChanged();
396
- break;
397
- case ne.id:
398
- this._clipboardPaste();
399
- break;
400
- case ae.id:
401
- this._clipboardPasteAsync();
402
- break;
403
485
  }
404
- })), this.disposeWithMe(t.beforeCommandExecuted(async (r) => {
405
- switch (r.id) {
406
- case ae.id:
407
- await this._beforeClipboardPasteAsync();
408
- break;
409
- }
410
- }));
486
+ })), this.registerEventHandler(
487
+ this.Event.ClipboardChanged,
488
+ () => r.beforeCommandExecuted((t) => {
489
+ switch (t.id) {
490
+ case Y.id:
491
+ case K.id:
492
+ this._clipboardChanged();
493
+ break;
494
+ }
495
+ })
496
+ ), this.registerEventHandler(
497
+ this.Event.ClipboardPasted,
498
+ () => r.beforeCommandExecuted((t) => {
499
+ switch (t.id) {
500
+ case V.id:
501
+ this._clipboardPaste(t.params);
502
+ break;
503
+ case X.id:
504
+ this._clipboardPasteAsync();
505
+ break;
506
+ }
507
+ })
508
+ );
411
509
  }
412
510
  _generateClipboardCopyParam() {
413
- const e = this.getActiveWorkbook(), t = e == null ? void 0 : e.getActiveSheet(), r = e == null ? void 0 : e.getActiveRange();
414
- if (!e || !t || !r)
511
+ const e = this.getActiveWorkbook(), r = e == null ? void 0 : e.getActiveSheet(), t = e == null ? void 0 : e.getActiveRange();
512
+ if (!e || !r || !t)
415
513
  return;
416
- const o = this._injector.get(Se).generateCopyContent(e.getId(), t.getSheetId(), r.getRange());
514
+ const o = this._injector.get(ne).generateCopyContent(e.getId(), r.getSheetId(), t.getRange());
417
515
  if (!o)
418
516
  return;
419
- const { html: s, plain: a } = o;
517
+ const { html: s, plain: c } = o;
420
518
  return {
421
519
  workbook: e,
422
- worksheet: t,
423
- text: a,
520
+ worksheet: r,
521
+ text: c,
424
522
  html: s,
425
- fromSheet: t,
426
- fromRange: r
523
+ fromSheet: r,
524
+ fromRange: t
427
525
  };
428
526
  }
429
527
  _beforeClipboardChange() {
430
- if (!this.hasEventCallback(this.Event.BeforeClipboardChange))
431
- return;
432
528
  const e = this._generateClipboardCopyParam();
433
529
  if (e && (this.fireEvent(this.Event.BeforeClipboardChange, e), e.cancel))
434
530
  throw new Error("Before clipboard change is canceled");
435
531
  }
436
532
  _clipboardChanged() {
437
- if (!this.hasEventCallback(this.Event.ClipboardChanged))
438
- return;
439
533
  const e = this._generateClipboardCopyParam();
440
534
  if (e && (this.fireEvent(this.Event.ClipboardChanged, e), e.cancel))
441
535
  throw new Error("Clipboard changed is canceled");
@@ -443,49 +537,43 @@ class ze extends ue {
443
537
  _generateClipboardPasteParam(e) {
444
538
  if (!e)
445
539
  return;
446
- const { htmlContent: t, textContent: r } = e, i = this.getActiveWorkbook(), o = i == null ? void 0 : i.getActiveSheet();
447
- return !i || !o ? void 0 : {
448
- workbook: i,
540
+ const { htmlContent: r, textContent: t } = e, n = this.getActiveWorkbook(), o = n == null ? void 0 : n.getActiveSheet();
541
+ return !n || !o ? void 0 : {
542
+ workbook: n,
449
543
  worksheet: o,
450
- text: r,
451
- html: t
544
+ text: t,
545
+ html: r
452
546
  };
453
547
  }
454
548
  async _generateClipboardPasteParamAsync() {
455
- const e = this.getActiveWorkbook(), t = e == null ? void 0 : e.getActiveSheet();
456
- if (!e || !t)
549
+ const e = this.getActiveWorkbook(), r = e == null ? void 0 : e.getActiveSheet();
550
+ if (!e || !r)
457
551
  return;
458
- const o = (await this._injector.get(je).read())[0];
552
+ const o = (await this._injector.get(He).read())[0];
459
553
  let s;
460
554
  if (o) {
461
- const a = o.types, g = a.indexOf(ce) !== -1 ? await o.getType(ce).then((l) => l && l.text()) : "", v = a.indexOf(de) !== -1 ? await o.getType(de).then((l) => l && l.text()) : "";
555
+ const c = o.types, g = c.indexOf(J) !== -1 ? await o.getType(J).then((l) => l && l.text()) : "", u = c.indexOf(G) !== -1 ? await o.getType(G).then((l) => l && l.text()) : "";
462
556
  s = {
463
557
  workbook: e,
464
- worksheet: t,
558
+ worksheet: r,
465
559
  text: g,
466
- html: v
560
+ html: u
467
561
  };
468
562
  }
469
563
  return s;
470
564
  }
471
565
  _beforeClipboardPaste(e) {
472
- if (!this.hasEventCallback(this.Event.BeforeClipboardPaste))
473
- return;
474
- const t = this._generateClipboardPasteParam(e);
475
- if (t && (this.fireEvent(this.Event.BeforeClipboardPaste, t), t.cancel))
566
+ const r = this._generateClipboardPasteParam(e);
567
+ if (r && (this.fireEvent(this.Event.BeforeClipboardPaste, r), r.cancel))
476
568
  throw new Error("Before clipboard paste is canceled");
477
569
  }
478
570
  _clipboardPaste(e) {
479
- if (!this.hasEventCallback(this.Event.BeforeClipboardPaste))
480
- return;
481
- const t = this._generateClipboardPasteParam(e);
482
- if (t && (this.fireEvent(this.Event.BeforeClipboardPaste, t), t.cancel))
571
+ const r = this._generateClipboardPasteParam(e);
572
+ if (r && (this.fireEvent(this.Event.ClipboardPasted, r), r.cancel))
483
573
  throw new Error("Clipboard pasted is canceled");
484
574
  }
485
575
  async _beforeClipboardPasteAsync() {
486
- if (!this.hasEventCallback(this.Event.BeforeClipboardPaste))
487
- return;
488
- if (!he()) {
576
+ if (!q()) {
489
577
  this._injector.get(D).warn("[Facade]: The navigator object only supports the browser environment");
490
578
  return;
491
579
  }
@@ -494,9 +582,7 @@ class ze extends ue {
494
582
  throw new Error("Before clipboard paste is canceled");
495
583
  }
496
584
  async _clipboardPasteAsync() {
497
- if (!this.hasEventCallback(this.Event.ClipboardPasted))
498
- return;
499
- if (!he()) {
585
+ if (!q()) {
500
586
  this._injector.get(D).warn("[Facade]: The navigator object only supports the browser environment");
501
587
  return;
502
588
  }
@@ -505,40 +591,40 @@ class ze extends ue {
505
591
  throw new Error("Clipboard pasted is canceled");
506
592
  }
507
593
  customizeColumnHeader(e) {
508
- var v, l;
509
- const t = this.getActiveWorkbook();
510
- if (!t) {
594
+ var u, l;
595
+ const r = this.getActiveWorkbook();
596
+ if (!r) {
511
597
  console.error("WorkBook not exist");
512
598
  return;
513
599
  }
514
- const r = t == null ? void 0 : t.getId(), i = this._injector.get(m), o = t.getActiveSheet(), s = o.getSheetId(), a = i.getRenderById(r);
515
- a && ((v = e.headerStyle) != null && v.size) && (a.with(R).setColumnHeaderSize(a, s, (l = e.headerStyle) == null ? void 0 : l.size), o == null || o.refreshCanvas()), this._getSheetRenderComponent(r, k.COLUMN).setCustomHeader(e), o == null || o.refreshCanvas();
600
+ const t = r == null ? void 0 : r.getId(), n = this._injector.get(m), o = r.getActiveSheet(), s = o.getSheetId(), c = n.getRenderById(t);
601
+ c && ((u = e.headerStyle) != null && u.size) && (c.with(R).setColumnHeaderSize(c, s, (l = e.headerStyle) == null ? void 0 : l.size), o == null || o.refreshCanvas()), this._getSheetRenderComponent(t, f.COLUMN).setCustomHeader(e), o == null || o.refreshCanvas();
516
602
  }
517
603
  customizeRowHeader(e) {
518
- const t = this.getActiveWorkbook();
519
- if (!t) {
604
+ const r = this.getActiveWorkbook();
605
+ if (!r) {
520
606
  console.error("WorkBook not exist");
521
607
  return;
522
608
  }
523
- const r = t == null ? void 0 : t.getId();
524
- this._getSheetRenderComponent(r, k.ROW).setCustomHeader(e);
609
+ const t = r == null ? void 0 : r.getId();
610
+ this._getSheetRenderComponent(t, f.ROW).setCustomHeader(e);
525
611
  }
526
- registerSheetRowHeaderExtension(e, ...t) {
527
- const r = this._getSheetRenderComponent(e, k.ROW), i = r.register(...t);
612
+ registerSheetRowHeaderExtension(e, ...r) {
613
+ const t = this._getSheetRenderComponent(e, f.ROW), n = t.register(...r);
528
614
  return b(() => {
529
- i.dispose(), r.makeDirty(!0);
615
+ n.dispose(), t.makeDirty(!0);
530
616
  });
531
617
  }
532
- registerSheetColumnHeaderExtension(e, ...t) {
533
- const r = this._getSheetRenderComponent(e, k.COLUMN), i = r.register(...t);
618
+ registerSheetColumnHeaderExtension(e, ...r) {
619
+ const t = this._getSheetRenderComponent(e, f.COLUMN), n = t.register(...r);
534
620
  return b(() => {
535
- i.dispose(), r.makeDirty(!0);
621
+ n.dispose(), t.makeDirty(!0);
536
622
  });
537
623
  }
538
- registerSheetMainExtension(e, ...t) {
539
- const r = this._getSheetRenderComponent(e, k.MAIN), i = r.register(...t);
624
+ registerSheetMainExtension(e, ...r) {
625
+ const t = this._getSheetRenderComponent(e, f.MAIN), n = t.register(...r);
540
626
  return b(() => {
541
- i.dispose(), r.makeDirty(!0);
627
+ n.dispose(), t.makeDirty(!0);
542
628
  });
543
629
  }
544
630
  /**
@@ -548,11 +634,11 @@ class ze extends ue {
548
634
  * @param {SHEET_VIEW_KEY} viewKey The view key of the spreadsheet.
549
635
  * @returns {Nullable<RenderComponentType>} The render component.
550
636
  */
551
- _getSheetRenderComponent(e, t) {
552
- const i = this._injector.get(m).getRenderById(e);
553
- if (!i)
637
+ _getSheetRenderComponent(e, r) {
638
+ const n = this._injector.get(m).getRenderById(e);
639
+ if (!n)
554
640
  throw new Error(`Render Unit with unitId ${e} not found`);
555
- const { components: o } = i, s = o.get(t);
641
+ const { components: o } = n, s = o.get(r);
556
642
  if (!s)
557
643
  throw new Error("Render component not found");
558
644
  return s;
@@ -562,100 +648,100 @@ class ze extends ue {
562
648
  * @returns {FSheetHooks} FSheetHooks instance
563
649
  */
564
650
  getSheetHooks() {
565
- return this._injector.createInstance(j);
651
+ return this._injector.createInstance($);
566
652
  }
567
653
  }
568
- ue.extend(ze);
569
- class Ve extends Ce {
654
+ te.extend(xe);
655
+ class De extends ie {
570
656
  openSiderbar(e) {
571
- return this._logDeprecation("openSiderbar"), this._injector.get(Oe).open(e);
657
+ return this._logDeprecation("openSiderbar"), this._injector.get(Me).open(e);
572
658
  }
573
659
  openDialog(e) {
574
660
  this._logDeprecation("openDialog");
575
- const r = this._injector.get(Fe).open({
661
+ const t = this._injector.get(ye).open({
576
662
  ...e,
577
663
  onClose: () => {
578
- r.dispose();
664
+ t.dispose();
579
665
  }
580
666
  });
581
- return r;
667
+ return t;
582
668
  }
583
669
  _logDeprecation(e) {
584
670
  this._injector.get(D).warn("[FWorkbook]", `${e} is deprecated. Please use the function of the same name on "FUniver".`);
585
671
  }
586
672
  generateCellParams(e) {
587
- const t = this.getActiveSheet();
673
+ const r = this.getActiveSheet();
588
674
  return {
589
675
  row: e.row,
590
676
  column: e.col,
591
677
  workbook: this,
592
- worksheet: t
678
+ worksheet: r
593
679
  };
594
680
  }
595
681
  onCellClick(e) {
596
- const t = this._injector.get(_);
682
+ const r = this._injector.get(w);
597
683
  return b(
598
- t.currentClickedCell$.pipe(S((r) => !!r)).subscribe((r) => {
599
- e(r);
684
+ r.currentClickedCell$.pipe(S((t) => !!t)).subscribe((t) => {
685
+ e(t);
600
686
  })
601
687
  );
602
688
  }
603
689
  onCellHover(e) {
604
- const t = this._injector.get(_);
690
+ const r = this._injector.get(w);
605
691
  return b(
606
- t.currentRichText$.pipe(S((r) => !!r)).subscribe(e)
692
+ r.currentRichText$.pipe(S((t) => !!t)).subscribe(e)
607
693
  );
608
694
  }
609
695
  onCellPointerDown(e) {
610
- const t = this._injector.get(_);
696
+ const r = this._injector.get(w);
611
697
  return b(
612
- t.currentPointerDownCell$.subscribe(e)
698
+ r.currentPointerDownCell$.subscribe(e)
613
699
  );
614
700
  }
615
701
  onCellPointerUp(e) {
616
- const t = this._injector.get(_);
702
+ const r = this._injector.get(w);
617
703
  return b(
618
- t.currentPointerUpCell$.subscribe(e)
704
+ r.currentPointerUpCell$.subscribe(e)
619
705
  );
620
706
  }
621
707
  onCellPointerMove(e) {
622
- const t = this._injector.get(_);
708
+ const r = this._injector.get(w);
623
709
  return b(
624
- t.currentCellPosWithEvent$.pipe(S((r) => !!r)).subscribe((r) => {
625
- e(r, r.event);
710
+ r.currentCellPosWithEvent$.pipe(S((t) => !!t)).subscribe((t) => {
711
+ e(t, t.event);
626
712
  })
627
713
  );
628
714
  }
629
715
  onDragOver(e) {
630
- const t = this._injector.get(H);
716
+ const r = this._injector.get(U);
631
717
  return b(
632
- t.currentCell$.pipe(S((r) => !!r)).subscribe((r) => {
633
- e(r);
718
+ r.currentCell$.pipe(S((t) => !!t)).subscribe((t) => {
719
+ e(t);
634
720
  })
635
721
  );
636
722
  }
637
723
  onDrop(e) {
638
- const t = this._injector.get(H);
724
+ const r = this._injector.get(U);
639
725
  return b(
640
- t.endCell$.pipe(S((r) => !!r)).subscribe((r) => {
641
- e(r);
726
+ r.endCell$.pipe(S((t) => !!t)).subscribe((t) => {
727
+ e(t);
642
728
  })
643
729
  );
644
730
  }
645
731
  startEditing() {
646
- return this._injector.get(P).syncExecuteCommand(M.id, {
647
- eventType: te.Dblclick,
732
+ return this._injector.get(P).syncExecuteCommand(k.id, {
733
+ eventType: N.Dblclick,
648
734
  unitId: this._workbook.getUnitId(),
649
735
  visible: !0
650
736
  });
651
737
  }
652
738
  async endEditing(e) {
653
- return this._injector.get(P).syncExecuteCommand(M.id, {
654
- eventType: te.Keyboard,
655
- keycode: e ? T.ENTER : T.ESC,
739
+ return this._injector.get(P).syncExecuteCommand(k.id, {
740
+ eventType: N.Keyboard,
741
+ keycode: e ? B.ENTER : B.ESC,
656
742
  visible: !1,
657
743
  unitId: this._workbook.getUnitId()
658
- }), await Ee(0), !0;
744
+ }), await de(0), !0;
659
745
  }
660
746
  endEditingAsync(e = !0) {
661
747
  return this.endEditing(e);
@@ -670,40 +756,40 @@ class Ve extends Ce {
670
756
  * ```
671
757
  */
672
758
  getScrollStateBySheetId(e) {
673
- const t = this._workbook.getUnitId(), i = this._injector.get(m).getRenderById(t);
674
- return i ? i.with(B).getScrollStateByParam({ unitId: t, sheetId: e }) : null;
759
+ const r = this._workbook.getUnitId(), n = this._injector.get(m).getRenderById(r);
760
+ return n ? n.with(T).getScrollStateByParam({ unitId: r, sheetId: e }) : null;
675
761
  }
676
762
  disableSelection() {
677
- const e = this._workbook.getUnitId(), r = this._injector.get(m).getRenderById(e);
678
- return r && r.with(x).disableSelection(), this;
763
+ const e = this._workbook.getUnitId(), t = this._injector.get(m).getRenderById(e);
764
+ return t && t.with(x).disableSelection(), this;
679
765
  }
680
766
  enableSelection() {
681
- const e = this._workbook.getUnitId(), r = this._injector.get(m).getRenderById(e);
682
- return r && r.with(x).enableSelection(), this;
767
+ const e = this._workbook.getUnitId(), t = this._injector.get(m).getRenderById(e);
768
+ return t && t.with(x).enableSelection(), this;
683
769
  }
684
770
  transparentSelection() {
685
- const e = this._workbook.getUnitId(), r = this._injector.get(m).getRenderById(e);
686
- return r && r.with(x).transparentSelection(), this;
771
+ const e = this._workbook.getUnitId(), t = this._injector.get(m).getRenderById(e);
772
+ return t && t.with(x).transparentSelection(), this;
687
773
  }
688
774
  showSelection() {
689
- const e = this._workbook.getUnitId(), r = this._injector.get(m).getRenderById(e);
690
- return r && r.with(x).showSelection(), this;
775
+ const e = this._workbook.getUnitId(), t = this._injector.get(m).getRenderById(e);
776
+ return t && t.with(x).showSelection(), this;
691
777
  }
692
778
  }
693
- Ce.extend(Ve);
694
- class Ze extends me {
779
+ ie.extend(De);
780
+ class Te extends oe {
695
781
  refreshCanvas() {
696
- const e = this._injector.get(m), t = this._fWorkbook.id, r = e.getRenderById(t);
697
- if (!r)
698
- throw new Error(`Render Unit with unitId ${t} not found`);
699
- r.with(R).reCalculate();
700
- const i = r.mainComponent;
701
- if (!i)
782
+ const e = this._injector.get(m), r = this._fWorkbook.id, t = e.getRenderById(r);
783
+ if (!t)
784
+ throw new Error(`Render Unit with unitId ${r} not found`);
785
+ t.with(R).reCalculate();
786
+ const n = t.mainComponent;
787
+ if (!n)
702
788
  throw new Error("Main component not found");
703
- return i.makeDirty(), this;
789
+ return n.makeDirty(), this;
704
790
  }
705
791
  zoom(e) {
706
- return this._injector.get(P).syncExecuteCommand(De.id, {
792
+ return this._injector.get(P).syncExecuteCommand(we.id, {
707
793
  unitId: this._workbook.getUnitId(),
708
794
  subUnitId: this._worksheet.getSheetId(),
709
795
  zoomRatio: e
@@ -713,26 +799,26 @@ class Ze extends me {
713
799
  return this._worksheet.getZoomRatio();
714
800
  }
715
801
  getVisibleRange() {
716
- const e = this._workbook.getUnitId(), r = this._injector.get(m).getRenderById(e);
717
- let i = {
802
+ const e = this._workbook.getUnitId(), t = this._injector.get(m).getRenderById(e);
803
+ let n = {
718
804
  startColumn: 0,
719
805
  startRow: 0,
720
806
  endColumn: 0,
721
807
  endRow: 0
722
808
  };
723
- if (!r) return i;
724
- const s = r.with(R).getCurrentSkeleton();
725
- if (!s) return i;
726
- const a = s == null ? void 0 : s.getVisibleRanges();
727
- if (!a) return i;
728
- i = s.getVisibleRangeByViewport(Ie.VIEW_MAIN);
729
- for (const [g, v] of a)
730
- Pe.indexOf(g) !== -1 && (i.startColumn = Math.min(i.startColumn, v.startColumn), i.startRow = Math.min(i.startRow, v.startRow), i.endColumn = Math.max(i.endColumn, v.endColumn), i.endRow = Math.max(i.endRow, v.endRow));
731
- return i;
732
- }
733
- scrollToCell(e, t) {
734
- const r = this._workbook.getUnitId(), o = this._injector.get(m).getRenderById(r);
735
- return o && (o == null ? void 0 : o.with(Be)).scrollToCell(e, t), this;
809
+ if (!t) return n;
810
+ const s = t.with(R).getCurrentSkeleton();
811
+ if (!s) return n;
812
+ const c = s == null ? void 0 : s.getVisibleRanges();
813
+ if (!c) return n;
814
+ n = s.getVisibleRangeByViewport(ue.VIEW_MAIN);
815
+ for (const [g, u] of c)
816
+ ve.indexOf(g) !== -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));
817
+ return n;
818
+ }
819
+ scrollToCell(e, r) {
820
+ const t = this._workbook.getUnitId(), o = this._injector.get(m).getRenderById(t);
821
+ return o && (o == null ? void 0 : o.with(fe)).scrollToCell(e, r), this;
736
822
  }
737
823
  getScrollState() {
738
824
  const e = {
@@ -740,15 +826,15 @@ class Ze extends me {
740
826
  offsetY: 0,
741
827
  sheetViewStartColumn: 0,
742
828
  sheetViewStartRow: 0
743
- }, t = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), o = this._injector.get(m).getRenderById(t);
744
- return o && o.with(B).getScrollStateByParam({ unitId: t, sheetId: r }) || e;
829
+ }, r = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), o = this._injector.get(m).getRenderById(r);
830
+ return o && o.with(T).getScrollStateByParam({ unitId: r, sheetId: t }) || e;
745
831
  }
746
832
  onScroll(e) {
747
833
  var o;
748
- const t = this._workbook.getUnitId(), i = (o = this._injector.get(m).getRenderById(t)) == null ? void 0 : o.with(B);
749
- if (i) {
750
- const s = i.validViewportScrollInfo$.subscribe((a) => {
751
- e(a);
834
+ const r = this._workbook.getUnitId(), n = (o = this._injector.get(m).getRenderById(r)) == null ? void 0 : o.with(T);
835
+ if (n) {
836
+ const s = n.validViewportScrollInfo$.subscribe((c) => {
837
+ e(c);
752
838
  });
753
839
  return b(s);
754
840
  }
@@ -756,53 +842,53 @@ class Ze extends me {
756
842
  });
757
843
  }
758
844
  getSkeleton() {
759
- var t, r;
760
- const e = (t = this._injector.get(m).getRenderById(this._workbook.getUnitId())) == null ? void 0 : t.with(R);
761
- return (r = e == null ? void 0 : e.getWorksheetSkeleton(this._worksheet.getSheetId())) == null ? void 0 : r.skeleton;
845
+ var r, t;
846
+ const e = (r = this._injector.get(m).getRenderById(this._workbook.getUnitId())) == null ? void 0 : r.with(R);
847
+ return (t = e == null ? void 0 : e.getWorksheetSkeleton(this._worksheet.getSheetId())) == null ? void 0 : t.skeleton;
762
848
  }
763
- setColumnAutoWidth(e, t) {
764
- const r = this._workbook.getUnitId(), i = this._worksheet.getSheetId(), o = [
849
+ setColumnAutoWidth(e, r) {
850
+ const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), o = [
765
851
  {
766
852
  startColumn: e,
767
- endColumn: e + t - 1,
853
+ endColumn: e + r - 1,
768
854
  startRow: 0,
769
855
  endRow: this._worksheet.getRowCount() - 1
770
856
  }
771
857
  ];
772
- return this._commandService.syncExecuteCommand(Te.id, {
773
- unitId: r,
774
- subUnitId: i,
858
+ return this._commandService.syncExecuteCommand(ke.id, {
859
+ unitId: t,
860
+ subUnitId: n,
775
861
  ranges: o
776
862
  }), this;
777
863
  }
778
864
  customizeColumnHeader(e) {
779
- var g, v;
780
- const t = this, r = this._fWorkbook.getId(), i = this._injector.get(m), o = t.getSheetId(), s = i.getRenderById(r);
781
- s && ((g = e.headerStyle) != null && g.size) && (s.with(R).setColumnHeaderSize(s, o, (v = e.headerStyle) == null ? void 0 : v.size), t == null || t.refreshCanvas());
782
- const a = this._getSheetRenderComponent(r, k.COLUMN);
783
- a && (a.setCustomHeader(e), t == null || t.refreshCanvas());
865
+ var g, u;
866
+ const r = this, t = this._fWorkbook.getId(), n = this._injector.get(m), o = r.getSheetId(), s = n.getRenderById(t);
867
+ s && ((g = e.headerStyle) != null && g.size) && (s.with(R).setColumnHeaderSize(s, o, (u = e.headerStyle) == null ? void 0 : u.size), r == null || r.refreshCanvas());
868
+ const c = this._getSheetRenderComponent(t, f.COLUMN);
869
+ c && (c.setCustomHeader(e), r == null || r.refreshCanvas());
784
870
  }
785
871
  customizeRowHeader(e) {
786
- const t = this._fWorkbook.getId();
787
- this._getSheetRenderComponent(t, k.ROW).setCustomHeader(e);
872
+ const r = this._fWorkbook.getId();
873
+ this._getSheetRenderComponent(r, f.ROW).setCustomHeader(e);
788
874
  }
789
875
  setColumnHeaderHeight(e) {
790
- const t = this, r = this._fWorkbook.getId(), i = t.getSheetId();
791
- return this._commandService.executeCommand(Le.id, {
792
- unitId: r,
793
- subUnitId: i,
876
+ const r = this, t = this._fWorkbook.getId(), n = r.getSheetId();
877
+ return this._commandService.executeCommand(Ie.id, {
878
+ unitId: t,
879
+ subUnitId: n,
794
880
  size: e
795
- }), t == null || t.refreshCanvas(), this;
881
+ }), r == null || r.refreshCanvas(), this;
796
882
  }
797
883
  setRowHeaderWidth(e) {
798
- const t = this, r = this._fWorkbook.getId(), i = t.getSheetId();
799
- this._commandService.executeCommand(Ae.id, {
800
- unitId: r,
801
- subUnitId: i,
884
+ const r = this, t = this._fWorkbook.getId(), n = r.getSheetId();
885
+ this._commandService.executeCommand(_e.id, {
886
+ unitId: t,
887
+ subUnitId: n,
802
888
  size: e
803
889
  });
804
- const o = this._getSheetRenderComponent(r, k.ROW);
805
- return o && o.setCustomHeader({ headerStyle: { size: e } }), t == null || t.refreshCanvas(), this;
890
+ const o = this._getSheetRenderComponent(t, f.ROW);
891
+ return o && o.setCustomHeader({ headerStyle: { size: e } }), r == null || r.refreshCanvas(), this;
806
892
  }
807
893
  /**
808
894
  * Get sheet render component from render by unitId and view key.
@@ -811,64 +897,64 @@ class Ze extends me {
811
897
  * @param {SHEET_VIEW_KEY} viewKey The view key of the spreadsheet.
812
898
  * @returns {Nullable<RenderComponentType>} The render component.
813
899
  */
814
- _getSheetRenderComponent(e, t) {
815
- const i = this._injector.get(m).getRenderById(e);
816
- if (!i)
900
+ _getSheetRenderComponent(e, r) {
901
+ const n = this._injector.get(m).getRenderById(e);
902
+ if (!n)
817
903
  throw new Error(`Render Unit with unitId ${e} not found`);
818
- const { components: o } = i, s = o.get(t);
904
+ const { components: o } = n, s = o.get(r);
819
905
  if (!s)
820
906
  throw new Error("Render component not found");
821
907
  return s;
822
908
  }
823
909
  }
824
- me.extend(Ze);
825
- class Ke extends be {
910
+ oe.extend(Te);
911
+ class Be extends se {
826
912
  setPermissionDialogVisible(e) {
827
913
  this._permissionService.setShowComponents(e);
828
914
  }
829
915
  }
830
- be.extend(Ke);
831
- class Ye extends j {
916
+ se.extend(Be);
917
+ class Ae extends $ {
832
918
  onCellPointerMove(e) {
833
- return b(this._injector.get(_).currentPosition$.subscribe(e));
919
+ return b(this._injector.get(w).currentPosition$.subscribe(e));
834
920
  }
835
921
  onCellPointerOver(e) {
836
- return b(this._injector.get(_).currentCell$.subscribe(e));
922
+ return b(this._injector.get(w).currentCell$.subscribe(e));
837
923
  }
838
924
  onCellDragOver(e) {
839
- return b(this._injector.get(H).currentCell$.subscribe(e));
925
+ return b(this._injector.get(U).currentCell$.subscribe(e));
840
926
  }
841
927
  onCellDrop(e) {
842
- return b(this._injector.get(H).endCell$.subscribe(e));
928
+ return b(this._injector.get(U).endCell$.subscribe(e));
843
929
  }
844
- onCellRender(e, t = we.Style, r = xe.DATA_VALIDATION) {
845
- return this._injector.get(Ue).intercept(He.CELL_CONTENT, {
846
- effect: t,
847
- handler: (i, o, s) => s({
848
- ...i,
930
+ onCellRender(e, r = he.Style, t = pe.DATA_VALIDATION) {
931
+ return this._injector.get(be).intercept(Ee.CELL_CONTENT, {
932
+ effect: r,
933
+ handler: (n, o, s) => s({
934
+ ...n,
849
935
  customRender: [
850
- ...(i == null ? void 0 : i.customRender) || [],
936
+ ...(n == null ? void 0 : n.customRender) || [],
851
937
  ...e || []
852
938
  ]
853
939
  }),
854
- priority: r
940
+ priority: t
855
941
  });
856
942
  }
857
943
  onBeforeCellEdit(e) {
858
- return this._injector.get(P).beforeCommandExecuted((t) => {
859
- const r = t.params;
860
- t.id === M.id && r.visible && e(r);
944
+ return this._injector.get(P).beforeCommandExecuted((r) => {
945
+ const t = r.params;
946
+ r.id === k.id && t.visible && e(t);
861
947
  });
862
948
  }
863
949
  onAfterCellEdit(e) {
864
- return this._injector.get(P).onCommandExecuted((t) => {
865
- const r = t.params;
866
- t.id === M.id && !r.visible && e(r);
950
+ return this._injector.get(P).onCommandExecuted((r) => {
951
+ const t = r.params;
952
+ r.id === k.id && !t.visible && e(t);
867
953
  });
868
954
  }
869
955
  }
870
- j.extend(Ye);
871
- const U = {
956
+ $.extend(Ae);
957
+ const M = {
872
958
  CellClicked: "CellClicked",
873
959
  CellPointerDown: "CellPointerDown",
874
960
  CellPointerUp: "CellPointerUp",
@@ -882,7 +968,7 @@ const U = {
882
968
  SelectionMoveEnd: "SelectionMoveEnd",
883
969
  SelectionChanged: "SelectionChanged"
884
970
  };
885
- class Xe extends ve {
971
+ class We extends re {
886
972
  get BeforeClipboardChange() {
887
973
  return "BeforeClipboardChange";
888
974
  }
@@ -911,19 +997,19 @@ class Xe extends ve {
911
997
  return "SheetEditEnded";
912
998
  }
913
999
  get CellClicked() {
914
- return U.CellClicked;
1000
+ return M.CellClicked;
915
1001
  }
916
1002
  get CellHover() {
917
- return U.CellHover;
1003
+ return M.CellHover;
918
1004
  }
919
1005
  get CellPointerDown() {
920
- return U.CellPointerDown;
1006
+ return M.CellPointerDown;
921
1007
  }
922
1008
  get CellPointerUp() {
923
- return U.CellPointerUp;
1009
+ return M.CellPointerUp;
924
1010
  }
925
1011
  get CellPointerMove() {
926
- return U.CellPointerMove;
1012
+ return M.CellPointerMove;
927
1013
  }
928
1014
  get DragOver() {
929
1015
  return "DragOver";
@@ -974,42 +1060,42 @@ class Xe extends ve {
974
1060
  return "SheetSkeletonChanged";
975
1061
  }
976
1062
  }
977
- ve.extend(Xe);
978
- class Je extends fe {
1063
+ re.extend(We);
1064
+ class $e extends ae {
979
1065
  getCell() {
980
- var a;
981
- const e = this._injector.get(m), t = this._injector.get(D), r = this._workbook.getUnitId(), i = this._worksheet.getSheetId(), o = e.getRenderById(r), s = (a = o == null ? void 0 : o.with(R).getSkeletonParam(i)) == null ? void 0 : a.skeleton;
1066
+ var c;
1067
+ const e = this._injector.get(m), r = this._injector.get(D), t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), o = e.getRenderById(t), s = (c = o == null ? void 0 : o.with(R).getSkeletonParam(n)) == null ? void 0 : c.skeleton;
982
1068
  if (!s)
983
- throw t.error("[Facade]: `FRange.getCell` can only be called in current worksheet"), new Error("`FRange.getCell` can only be called in current worksheet");
1069
+ throw r.error("[Facade]: `FRange.getCell` can only be called in current worksheet"), new Error("`FRange.getCell` can only be called in current worksheet");
984
1070
  return s.getCellWithCoordByIndex(this._range.startRow, this._range.startColumn);
985
1071
  }
986
1072
  getCellRect() {
987
- const { startX: e, startY: t, endX: r, endY: i } = this.getCell(), o = { x: e, y: t, width: r - e, height: i - t, top: t, left: e, bottom: i, right: r };
1073
+ const { startX: e, startY: r, endX: t, endY: n } = this.getCell(), o = { x: e, y: r, width: t - e, height: n - r, top: r, left: e, bottom: n, right: t };
988
1074
  return { ...o, toJSON: () => JSON.stringify(o) };
989
1075
  }
990
1076
  generateHTML() {
991
- var t;
992
- const e = this._injector.get(Se).generateCopyContent(
1077
+ var r;
1078
+ const e = this._injector.get(ne).generateCopyContent(
993
1079
  this._workbook.getUnitId(),
994
1080
  this._worksheet.getSheetId(),
995
1081
  this._range
996
1082
  );
997
- return (t = e == null ? void 0 : e.html) != null ? t : "";
1083
+ return (r = e == null ? void 0 : e.html) != null ? r : "";
998
1084
  }
999
1085
  attachPopup(e) {
1000
- var s, a, g;
1001
- e.direction = (s = e.direction) != null ? s : "horizontal", e.extraProps = (a = e.extraProps) != null ? a : {}, e.offset = (g = e.offset) != null ? g : [0, 0];
1002
- const { key: t, disposableCollection: r } = ge(e, this._injector.get(le)), o = this._injector.get(ie).attachPopupToCell(
1086
+ var s, c, g;
1087
+ e.direction = (s = e.direction) != null ? s : "horizontal", e.extraProps = (c = e.extraProps) != null ? c : {}, e.offset = (g = e.offset) != null ? g : [0, 0];
1088
+ const { key: r, disposableCollection: t } = ee(e, this._injector.get(Q)), o = this._injector.get(Z).attachPopupToCell(
1003
1089
  this._range.startRow,
1004
1090
  this._range.startColumn,
1005
- { ...e, componentKey: t },
1091
+ { ...e, componentKey: r },
1006
1092
  this.getUnitId(),
1007
1093
  this._worksheet.getSheetId()
1008
1094
  );
1009
- return o ? (r.add(o), r) : (r.dispose(), null);
1095
+ return o ? (t.add(o), t) : (t.dispose(), null);
1010
1096
  }
1011
1097
  attachAlertPopup(e) {
1012
- const t = this._injector.get(We), r = {
1098
+ const r = this._injector.get(Pe), t = {
1013
1099
  workbook: this._workbook,
1014
1100
  worksheet: this._worksheet,
1015
1101
  row: this._range.startRow,
@@ -1017,12 +1103,12 @@ class Je extends fe {
1017
1103
  unitId: this.getUnitId(),
1018
1104
  subUnitId: this._worksheet.getSheetId()
1019
1105
  };
1020
- return t.showAlert({
1106
+ return r.showAlert({
1021
1107
  ...e,
1022
- location: r
1108
+ location: t
1023
1109
  }), {
1024
1110
  dispose: () => {
1025
- t.removeAlert(e.key);
1111
+ r.removeAlert(e.key);
1026
1112
  }
1027
1113
  };
1028
1114
  }
@@ -1039,35 +1125,35 @@ class Je extends fe {
1039
1125
  });
1040
1126
  */
1041
1127
  attachRangePopup(e) {
1042
- var s, a, g;
1043
- e.direction = (s = e.direction) != null ? s : "top-center", e.extraProps = (a = e.extraProps) != null ? a : {}, e.offset = (g = e.offset) != null ? g : [0, 0];
1044
- const { key: t, disposableCollection: r } = ge(e, this._injector.get(le)), o = this._injector.get(ie).attachRangePopup(
1128
+ var s, c, g;
1129
+ e.direction = (s = e.direction) != null ? s : "top-center", e.extraProps = (c = e.extraProps) != null ? c : {}, e.offset = (g = e.offset) != null ? g : [0, 0];
1130
+ const { key: r, disposableCollection: t } = ee(e, this._injector.get(Q)), o = this._injector.get(Z).attachRangePopup(
1045
1131
  this._range,
1046
- { ...e, componentKey: t },
1132
+ { ...e, componentKey: r },
1047
1133
  this.getUnitId(),
1048
1134
  this._worksheet.getSheetId()
1049
1135
  );
1050
- return o ? (r.add(o), r) : (r.dispose(), null);
1136
+ return o ? (t.add(o), t) : (t.dispose(), null);
1051
1137
  }
1052
- highlight(e, t) {
1053
- const r = this._injector.get($e), i = r.addShape({ range: this._range, style: e, primary: t });
1054
- if (!i)
1138
+ highlight(e, r) {
1139
+ const t = this._injector.get(Re), n = t.addShape({ range: this._range, style: e, primary: r });
1140
+ if (!n)
1055
1141
  throw new Error("Failed to highlight current range");
1056
1142
  return b(() => {
1057
- r.removeShape(i);
1143
+ t.removeShape(n);
1058
1144
  });
1059
1145
  }
1060
1146
  }
1061
- fe.extend(Je);
1062
- function ge(w, e) {
1063
- const { componentKey: t, isVue3: r } = w;
1064
- let i;
1065
- const o = new $();
1066
- return typeof t == "string" ? i = t : (i = `External_${_e(6)}`, o.add(e.register(i, t, { framework: r ? "vue3" : "react" }))), {
1067
- key: i,
1147
+ ae.extend($e);
1148
+ function ee(p, e) {
1149
+ const { componentKey: r, isVue3: t } = p;
1150
+ let n;
1151
+ const o = new y();
1152
+ return typeof r == "string" ? n = r : (n = `External_${le(6)}`, o.add(e.register(n, r, { framework: t ? "vue3" : "react" }))), {
1153
+ key: n,
1068
1154
  disposableCollection: o
1069
1155
  };
1070
1156
  }
1071
1157
  export {
1072
- ge as transformComponentKey
1158
+ ee as transformComponentKey
1073
1159
  };