@univerjs/sheets-ui 0.10.11 → 0.10.12-nightly.202510251119
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/cjs/facade.js +1 -1
- package/lib/cjs/index.js +14 -14
- package/lib/es/facade.js +172 -153
- package/lib/es/index.js +4575 -4021
- package/lib/facade.js +172 -153
- package/lib/index.css +1 -1
- package/lib/index.js +4575 -4021
- package/lib/types/commands/commands/set-scroll.command.d.ts +4 -0
- package/lib/types/controllers/render-controllers/scroll.render-controller.d.ts +8 -2
- package/lib/types/facade/f-event.d.ts +11 -8
- package/lib/types/facade/f-workbook.d.ts +13 -1
- package/lib/types/facade/f-worksheet.d.ts +25 -4
- package/lib/types/services/scroll-manager.service.d.ts +42 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +13 -13
- package/package.json +13 -13
- package/LICENSE +0 -176
package/lib/es/facade.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { ICommandService as
|
|
2
|
-
import { FUniver as q, FEventName as
|
|
3
|
-
import { RichTextEditingMutation as
|
|
4
|
-
import { IRenderManagerService as v, DeviceInputEventType as L, SHEET_VIEWPORT_KEY as le, sheetContentViewportKeys as
|
|
5
|
-
import { SheetsSelectionsService as
|
|
6
|
-
import { SetCellEditVisibleOperation as
|
|
7
|
-
import { FSheetHooks as
|
|
8
|
-
import { KeyCode as
|
|
1
|
+
import { ICommandService as P, CanceledError as E, IUniverInstanceService as W, RichTextValue as O, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as D, LifecycleService as oe, DisposableCollection as A, LifecycleStages as z, UniverInstanceType as se, ILogService as U, toDisposable as m, awaitTime as ae, InterceptorEffectEnum as ce, generateRandomId as de } from "@univerjs/core";
|
|
2
|
+
import { FUniver as q, FEventName as he } from "@univerjs/core/facade";
|
|
3
|
+
import { RichTextEditingMutation as ge } from "@univerjs/docs";
|
|
4
|
+
import { IRenderManagerService as v, DeviceInputEventType as L, SHEET_VIEWPORT_KEY as le, sheetContentViewportKeys as ue } from "@univerjs/engine-render";
|
|
5
|
+
import { SheetsSelectionsService as ve, COMMAND_LISTENER_SKELETON_CHANGE as Se, getSkeletonChangedEffectedRange as me, SetWorksheetRowIsAutoHeightCommand as Ce, InterceptCellContentPriority as be, SheetInterceptorService as we, INTERCEPTOR_POINT as Ee } from "@univerjs/sheets";
|
|
6
|
+
import { SetCellEditVisibleOperation as k, IEditorBridgeService as p, SetZoomRatioCommand as j, HoverManagerService as f, DragManagerService as M, SheetScrollManagerService as x, SheetPasteShortKeyCommand as T, ISheetClipboardService as Q, SheetSkeletonManagerService as _, SHEET_VIEW_KEY as b, ISheetSelectionRenderService as y, IMarkSelectionService as ee, SheetsScrollRenderController as pe, SetWorksheetColAutoWidthCommand as fe, SetColumnHeaderHeightCommand as ke, SetRowHeaderWidthCommand as Ie, SheetCanvasPopManagerService as N, CellAlertManagerService as _e, ISheetCellDropdownManagerService as Pe } from "@univerjs/sheets-ui";
|
|
7
|
+
import { FSheetHooks as $, FWorkbook as te, FWorksheet as re, FPermission as ne, FRange as ie } from "@univerjs/sheets/facade";
|
|
8
|
+
import { KeyCode as B, 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(
|
|
13
|
+
const r = e.get(P);
|
|
14
14
|
this.registerEventHandler(
|
|
15
15
|
this.Event.BeforeSheetEditStart,
|
|
16
16
|
() => r.beforeCommandExecuted((t) => {
|
|
17
|
-
if (t.id !==
|
|
17
|
+
if (t.id !== k.id) return;
|
|
18
18
|
const i = this.getActiveSheet();
|
|
19
19
|
if (!i) return;
|
|
20
|
-
const { workbook: o, worksheet: s } = i, d = e.get(
|
|
21
|
-
if (
|
|
20
|
+
const { workbook: o, worksheet: s } = i, d = e.get(p), h = t.params, { visible: g, keycode: l, eventType: a } = h, n = d.getEditLocation();
|
|
21
|
+
if (g) {
|
|
22
22
|
const c = {
|
|
23
23
|
row: n.row,
|
|
24
24
|
column: n.column,
|
|
25
25
|
eventType: a,
|
|
26
|
-
keycode:
|
|
26
|
+
keycode: l,
|
|
27
27
|
workbook: o,
|
|
28
28
|
worksheet: s,
|
|
29
29
|
isZenEditor: !1
|
|
@@ -35,12 +35,12 @@ class Ue extends q {
|
|
|
35
35
|
), this.registerEventHandler(
|
|
36
36
|
this.Event.BeforeSheetEditEnd,
|
|
37
37
|
() => r.beforeCommandExecuted((t) => {
|
|
38
|
-
if (t.id !==
|
|
38
|
+
if (t.id !== k.id) return;
|
|
39
39
|
const i = this.getActiveSheet();
|
|
40
40
|
if (!i) return;
|
|
41
|
-
const { workbook: o, worksheet: s } = i, d = e.get(
|
|
42
|
-
if (!
|
|
43
|
-
const
|
|
41
|
+
const { workbook: o, worksheet: s } = i, d = e.get(p), h = e.get(W), g = t.params, { visible: l, keycode: a, eventType: n } = g, c = d.getEditLocation();
|
|
42
|
+
if (!l) {
|
|
43
|
+
const R = {
|
|
44
44
|
row: c.row,
|
|
45
45
|
column: c.column,
|
|
46
46
|
eventType: n,
|
|
@@ -48,26 +48,26 @@ class Ue extends q {
|
|
|
48
48
|
workbook: o,
|
|
49
49
|
worksheet: s,
|
|
50
50
|
isZenEditor: !1,
|
|
51
|
-
value: O.create(
|
|
52
|
-
isConfirm: a !==
|
|
51
|
+
value: O.create(h.getUnit(D).getSnapshot()),
|
|
52
|
+
isConfirm: a !== B.ESC
|
|
53
53
|
};
|
|
54
|
-
if (this.fireEvent(this.Event.BeforeSheetEditEnd,
|
|
54
|
+
if (this.fireEvent(this.Event.BeforeSheetEditEnd, R), R.cancel)
|
|
55
55
|
throw new E();
|
|
56
56
|
}
|
|
57
57
|
})
|
|
58
58
|
), this.registerEventHandler(
|
|
59
59
|
this.Event.SheetEditStarted,
|
|
60
60
|
() => r.onCommandExecuted((t) => {
|
|
61
|
-
if (t.id !==
|
|
61
|
+
if (t.id !== k.id) return;
|
|
62
62
|
const i = this.getCommandSheetTarget(t);
|
|
63
63
|
if (!i) return;
|
|
64
|
-
const { workbook: o, worksheet: s } = i, d = e.get(
|
|
65
|
-
if (
|
|
64
|
+
const { workbook: o, worksheet: s } = i, d = e.get(p), h = t.params, { visible: g, keycode: l, eventType: a } = h, n = d.getEditLocation();
|
|
65
|
+
if (g) {
|
|
66
66
|
const c = {
|
|
67
67
|
row: n.row,
|
|
68
68
|
column: n.column,
|
|
69
69
|
eventType: a,
|
|
70
|
-
keycode:
|
|
70
|
+
keycode: l,
|
|
71
71
|
workbook: o,
|
|
72
72
|
worksheet: s,
|
|
73
73
|
isZenEditor: !1
|
|
@@ -78,20 +78,20 @@ class Ue extends q {
|
|
|
78
78
|
), this.registerEventHandler(
|
|
79
79
|
this.Event.SheetEditEnded,
|
|
80
80
|
() => r.onCommandExecuted((t) => {
|
|
81
|
-
if (t.id !==
|
|
81
|
+
if (t.id !== k.id) return;
|
|
82
82
|
const i = this.getCommandSheetTarget(t);
|
|
83
83
|
if (!i) return;
|
|
84
|
-
const { workbook: o, worksheet: s } = i, d = e.get(
|
|
85
|
-
if (!
|
|
84
|
+
const { workbook: o, worksheet: s } = i, d = e.get(p), h = t.params, { visible: g, keycode: l, eventType: a } = h, n = d.getEditLocation();
|
|
85
|
+
if (!g) {
|
|
86
86
|
const c = {
|
|
87
87
|
row: n.row,
|
|
88
88
|
column: n.column,
|
|
89
89
|
eventType: a,
|
|
90
|
-
keycode:
|
|
90
|
+
keycode: l,
|
|
91
91
|
workbook: o,
|
|
92
92
|
worksheet: s,
|
|
93
93
|
isZenEditor: !1,
|
|
94
|
-
isConfirm:
|
|
94
|
+
isConfirm: l !== B.ESC
|
|
95
95
|
};
|
|
96
96
|
this.fireEvent(this.Event.SheetEditEnded, c);
|
|
97
97
|
}
|
|
@@ -99,19 +99,19 @@ class Ue extends q {
|
|
|
99
99
|
), this.registerEventHandler(
|
|
100
100
|
this.Event.SheetEditChanging,
|
|
101
101
|
() => r.onCommandExecuted((t) => {
|
|
102
|
-
if (t.id !==
|
|
102
|
+
if (t.id !== ge.id) return;
|
|
103
103
|
const i = this.getActiveSheet();
|
|
104
104
|
if (!i) return;
|
|
105
|
-
const { workbook: o, worksheet: s } = i, d = e.get(
|
|
105
|
+
const { workbook: o, worksheet: s } = i, d = e.get(p), h = e.get(W), g = t.params;
|
|
106
106
|
if (!d.isVisible().visible) return;
|
|
107
|
-
const { unitId:
|
|
108
|
-
if (
|
|
107
|
+
const { unitId: l } = g;
|
|
108
|
+
if (l === D) {
|
|
109
109
|
const { row: a, column: n } = d.getEditLocation(), c = {
|
|
110
110
|
workbook: o,
|
|
111
111
|
worksheet: s,
|
|
112
112
|
row: a,
|
|
113
113
|
column: n,
|
|
114
|
-
value: O.create(
|
|
114
|
+
value: O.create(h.getUnit(D).getSnapshot()),
|
|
115
115
|
isZenEditor: !1
|
|
116
116
|
};
|
|
117
117
|
this.fireEvent(this.Event.SheetEditChanging, c);
|
|
@@ -120,7 +120,7 @@ class Ue extends q {
|
|
|
120
120
|
), this.registerEventHandler(
|
|
121
121
|
this.Event.BeforeSheetZoomChange,
|
|
122
122
|
() => r.beforeCommandExecuted((t) => {
|
|
123
|
-
if (t.id !==
|
|
123
|
+
if (t.id !== j.id) return;
|
|
124
124
|
const i = this.getCommandSheetTarget(t);
|
|
125
125
|
if (!i) return;
|
|
126
126
|
const { workbook: o, worksheet: s } = i, d = {
|
|
@@ -134,7 +134,7 @@ class Ue extends q {
|
|
|
134
134
|
), this.registerEventHandler(
|
|
135
135
|
this.Event.SheetZoomChanged,
|
|
136
136
|
() => r.onCommandExecuted((t) => {
|
|
137
|
-
if (t.id !==
|
|
137
|
+
if (t.id !== j.id) return;
|
|
138
138
|
const i = this.getCommandSheetTarget(t);
|
|
139
139
|
if (!i) return;
|
|
140
140
|
const { workbook: o, worksheet: s } = i;
|
|
@@ -148,16 +148,16 @@ class Ue extends q {
|
|
|
148
148
|
}
|
|
149
149
|
// eslint-disable-next-line max-lines-per-function
|
|
150
150
|
_initObserverListener(e) {
|
|
151
|
-
const r = e.get(v), t = e.get(
|
|
152
|
-
this.disposeWithMe(t.lifecycle$.subscribe((
|
|
153
|
-
if (
|
|
151
|
+
const r = e.get(v), t = e.get(oe), i = new A();
|
|
152
|
+
this.disposeWithMe(t.lifecycle$.subscribe((h) => {
|
|
153
|
+
if (h !== z.Rendered) return;
|
|
154
154
|
i.dispose();
|
|
155
|
-
const
|
|
156
|
-
|
|
155
|
+
const g = e.get(f), l = e.get(M);
|
|
156
|
+
g && (this.registerEventHandler(
|
|
157
157
|
this.Event.CellClicked,
|
|
158
158
|
() => {
|
|
159
159
|
var a;
|
|
160
|
-
return (a =
|
|
160
|
+
return (a = g.currentClickedCell$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
|
|
161
161
|
const c = this.getSheetTarget(n.location.unitId, n.location.subUnitId);
|
|
162
162
|
c && this.fireEvent(this.Event.CellClicked, {
|
|
163
163
|
...c,
|
|
@@ -171,7 +171,7 @@ class Ue extends q {
|
|
|
171
171
|
this.Event.CellHover,
|
|
172
172
|
() => {
|
|
173
173
|
var a;
|
|
174
|
-
return (a =
|
|
174
|
+
return (a = g.currentRichText$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
|
|
175
175
|
const c = this.getSheetTarget(n.unitId, n.subUnitId);
|
|
176
176
|
c && this.fireEvent(this.Event.CellHover, {
|
|
177
177
|
...c,
|
|
@@ -185,7 +185,7 @@ class Ue extends q {
|
|
|
185
185
|
this.Event.CellPointerDown,
|
|
186
186
|
() => {
|
|
187
187
|
var a;
|
|
188
|
-
return (a =
|
|
188
|
+
return (a = g.currentPointerDownCell$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
|
|
189
189
|
const c = this.getSheetTarget(n.unitId, n.subUnitId);
|
|
190
190
|
c && this.fireEvent(this.Event.CellPointerDown, {
|
|
191
191
|
...c,
|
|
@@ -199,7 +199,7 @@ class Ue extends q {
|
|
|
199
199
|
this.Event.CellPointerUp,
|
|
200
200
|
() => {
|
|
201
201
|
var a;
|
|
202
|
-
return (a =
|
|
202
|
+
return (a = g.currentPointerUpCell$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
|
|
203
203
|
const c = this.getSheetTarget(n.unitId, n.subUnitId);
|
|
204
204
|
c && this.fireEvent(this.Event.CellPointerUp, {
|
|
205
205
|
...c,
|
|
@@ -213,7 +213,7 @@ class Ue extends q {
|
|
|
213
213
|
this.Event.CellPointerMove,
|
|
214
214
|
() => {
|
|
215
215
|
var a;
|
|
216
|
-
return (a =
|
|
216
|
+
return (a = g.currentCellPosWithEvent$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
|
|
217
217
|
const c = this.getSheetTarget(n.unitId, n.subUnitId);
|
|
218
218
|
c && this.fireEvent(this.Event.CellPointerMove, {
|
|
219
219
|
...c,
|
|
@@ -227,7 +227,7 @@ class Ue extends q {
|
|
|
227
227
|
this.Event.DragOver,
|
|
228
228
|
() => {
|
|
229
229
|
var a;
|
|
230
|
-
return (a =
|
|
230
|
+
return (a = l.currentCell$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
|
|
231
231
|
const c = this.getSheetTarget(n.location.unitId, n.location.subUnitId);
|
|
232
232
|
c && this.fireEvent(this.Event.DragOver, {
|
|
233
233
|
...c,
|
|
@@ -241,7 +241,7 @@ class Ue extends q {
|
|
|
241
241
|
this.Event.Drop,
|
|
242
242
|
() => {
|
|
243
243
|
var a;
|
|
244
|
-
return (a =
|
|
244
|
+
return (a = l.endCell$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
|
|
245
245
|
const c = this.getSheetTarget(n.location.unitId, n.location.subUnitId);
|
|
246
246
|
c && this.fireEvent(this.Event.Drop, {
|
|
247
247
|
...c,
|
|
@@ -255,7 +255,7 @@ class Ue extends q {
|
|
|
255
255
|
this.Event.RowHeaderClick,
|
|
256
256
|
() => {
|
|
257
257
|
var a;
|
|
258
|
-
return (a =
|
|
258
|
+
return (a = g.currentRowHeaderClick$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
|
|
259
259
|
const c = this.getSheetTarget(n.unitId, n.subUnitId);
|
|
260
260
|
c && this.fireEvent(this.Event.RowHeaderClick, {
|
|
261
261
|
...c,
|
|
@@ -267,7 +267,7 @@ class Ue extends q {
|
|
|
267
267
|
this.Event.RowHeaderPointerDown,
|
|
268
268
|
() => {
|
|
269
269
|
var a;
|
|
270
|
-
return (a =
|
|
270
|
+
return (a = g.currentRowHeaderPointerDown$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
|
|
271
271
|
const c = this.getSheetTarget(n.unitId, n.subUnitId);
|
|
272
272
|
c && this.fireEvent(this.Event.RowHeaderPointerDown, {
|
|
273
273
|
...c,
|
|
@@ -279,7 +279,7 @@ class Ue extends q {
|
|
|
279
279
|
this.Event.RowHeaderPointerUp,
|
|
280
280
|
() => {
|
|
281
281
|
var a;
|
|
282
|
-
return (a =
|
|
282
|
+
return (a = g.currentRowHeaderPointerUp$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
|
|
283
283
|
const c = this.getSheetTarget(n.unitId, n.subUnitId);
|
|
284
284
|
c && this.fireEvent(this.Event.RowHeaderPointerUp, {
|
|
285
285
|
...c,
|
|
@@ -291,7 +291,7 @@ class Ue extends q {
|
|
|
291
291
|
this.Event.RowHeaderHover,
|
|
292
292
|
() => {
|
|
293
293
|
var a;
|
|
294
|
-
return (a =
|
|
294
|
+
return (a = g.currentHoveredRowHeader$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
|
|
295
295
|
const c = this.getSheetTarget(n.unitId, n.subUnitId);
|
|
296
296
|
c && this.fireEvent(this.Event.RowHeaderHover, {
|
|
297
297
|
...c,
|
|
@@ -303,7 +303,7 @@ class Ue extends q {
|
|
|
303
303
|
this.Event.ColumnHeaderClick,
|
|
304
304
|
() => {
|
|
305
305
|
var a;
|
|
306
|
-
return (a =
|
|
306
|
+
return (a = g.currentColHeaderClick$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
|
|
307
307
|
const c = this.getSheetTarget(n.unitId, n.subUnitId);
|
|
308
308
|
c && this.fireEvent(this.Event.ColumnHeaderClick, {
|
|
309
309
|
...c,
|
|
@@ -315,7 +315,7 @@ class Ue extends q {
|
|
|
315
315
|
this.Event.ColumnHeaderPointerDown,
|
|
316
316
|
() => {
|
|
317
317
|
var a;
|
|
318
|
-
return (a =
|
|
318
|
+
return (a = g.currentColHeaderPointerDown$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
|
|
319
319
|
const c = this.getSheetTarget(n.unitId, n.subUnitId);
|
|
320
320
|
c && this.fireEvent(this.Event.ColumnHeaderPointerDown, {
|
|
321
321
|
...c,
|
|
@@ -327,7 +327,7 @@ class Ue extends q {
|
|
|
327
327
|
this.Event.ColumnHeaderPointerUp,
|
|
328
328
|
() => {
|
|
329
329
|
var a;
|
|
330
|
-
return (a =
|
|
330
|
+
return (a = g.currentColHeaderPointerUp$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
|
|
331
331
|
const c = this.getSheetTarget(n.unitId, n.subUnitId);
|
|
332
332
|
c && this.fireEvent(this.Event.ColumnHeaderPointerUp, {
|
|
333
333
|
...c,
|
|
@@ -339,7 +339,7 @@ class Ue extends q {
|
|
|
339
339
|
this.Event.ColumnHeaderHover,
|
|
340
340
|
() => {
|
|
341
341
|
var a;
|
|
342
|
-
return (a =
|
|
342
|
+
return (a = g.currentHoveredColHeader$) == null ? void 0 : a.pipe(u((n) => !!n)).subscribe((n) => {
|
|
343
343
|
const c = this.getSheetTarget(n.unitId, n.subUnitId);
|
|
344
344
|
c && this.fireEvent(this.Event.ColumnHeaderHover, {
|
|
345
345
|
...c,
|
|
@@ -355,14 +355,14 @@ class Ue extends q {
|
|
|
355
355
|
r.created$,
|
|
356
356
|
t.lifecycle$
|
|
357
357
|
]);
|
|
358
|
-
this.disposeWithMe(d.subscribe(([
|
|
359
|
-
var
|
|
360
|
-
if (
|
|
361
|
-
const
|
|
358
|
+
this.disposeWithMe(d.subscribe(([h, g]) => {
|
|
359
|
+
var R;
|
|
360
|
+
if (h.type === se.UNIVER_SHEET && (s = h), g <= z.Rendered || !s) return;
|
|
361
|
+
const l = new A(), a = this.getWorkbook(s.unitId);
|
|
362
362
|
if (!a) return;
|
|
363
|
-
o.get(s.unitId) && ((
|
|
364
|
-
const n = s.with(x), c = s.with(
|
|
365
|
-
|
|
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(ve);
|
|
365
|
+
l.add(this.registerEventHandler(
|
|
366
366
|
this.Event.Scroll,
|
|
367
367
|
() => n.validViewportScrollInfo$.subscribe((S) => {
|
|
368
368
|
S && this.fireEvent(this.Event.Scroll, {
|
|
@@ -371,53 +371,53 @@ class Ue extends q {
|
|
|
371
371
|
...S
|
|
372
372
|
});
|
|
373
373
|
})
|
|
374
|
-
)),
|
|
374
|
+
)), l.add(this.registerEventHandler(
|
|
375
375
|
this.Event.SelectionMoveStart,
|
|
376
376
|
() => c.selectionMoveStart$.subscribe((S) => {
|
|
377
377
|
var C;
|
|
378
378
|
this.fireEvent(this.Event.SelectionMoveStart, {
|
|
379
379
|
workbook: a,
|
|
380
380
|
worksheet: a.getActiveSheet(),
|
|
381
|
-
selections: (C = S == null ? void 0 : S.map((
|
|
381
|
+
selections: (C = S == null ? void 0 : S.map((I) => I.range)) != null ? C : []
|
|
382
382
|
});
|
|
383
383
|
})
|
|
384
|
-
)),
|
|
384
|
+
)), l.add(this.registerEventHandler(
|
|
385
385
|
this.Event.SelectionMoving,
|
|
386
386
|
() => c.selectionMoving$.subscribe((S) => {
|
|
387
387
|
var C;
|
|
388
388
|
this.fireEvent(this.Event.SelectionMoving, {
|
|
389
389
|
workbook: a,
|
|
390
390
|
worksheet: a.getActiveSheet(),
|
|
391
|
-
selections: (C = S == null ? void 0 : S.map((
|
|
391
|
+
selections: (C = S == null ? void 0 : S.map((I) => I.range)) != null ? C : []
|
|
392
392
|
});
|
|
393
393
|
})
|
|
394
|
-
)),
|
|
394
|
+
)), l.add(this.registerEventHandler(
|
|
395
395
|
this.Event.SelectionMoveEnd,
|
|
396
396
|
() => c.selectionMoveEnd$.subscribe((S) => {
|
|
397
397
|
var C;
|
|
398
398
|
this.fireEvent(this.Event.SelectionMoveEnd, {
|
|
399
399
|
workbook: a,
|
|
400
400
|
worksheet: a.getActiveSheet(),
|
|
401
|
-
selections: (C = S == null ? void 0 : S.map((
|
|
401
|
+
selections: (C = S == null ? void 0 : S.map((I) => I.range)) != null ? C : []
|
|
402
402
|
});
|
|
403
403
|
})
|
|
404
|
-
)),
|
|
404
|
+
)), l.add(this.registerEventHandler(
|
|
405
405
|
this.Event.SelectionChanged,
|
|
406
406
|
() => c.selectionChanged$.subscribe((S) => {
|
|
407
407
|
var C;
|
|
408
408
|
this.fireEvent(this.Event.SelectionChanged, {
|
|
409
409
|
workbook: a,
|
|
410
410
|
worksheet: a.getActiveSheet(),
|
|
411
|
-
selections: (C = S == null ? void 0 : S.map((
|
|
411
|
+
selections: (C = S == null ? void 0 : S.map((I) => I.range)) != null ? C : []
|
|
412
412
|
});
|
|
413
413
|
})
|
|
414
|
-
)), s = null, this.disposeWithMe(
|
|
415
|
-
})), this.disposeWithMe(r.disposed$.subscribe((
|
|
416
|
-
var
|
|
417
|
-
(
|
|
414
|
+
)), s = null, this.disposeWithMe(l);
|
|
415
|
+
})), this.disposeWithMe(r.disposed$.subscribe((h) => {
|
|
416
|
+
var g;
|
|
417
|
+
(g = o.get(h)) == null || g.dispose(), o.delete(h);
|
|
418
418
|
})), this.disposeWithMe(() => {
|
|
419
|
-
o.forEach((
|
|
420
|
-
|
|
419
|
+
o.forEach((h) => {
|
|
420
|
+
h.dispose();
|
|
421
421
|
});
|
|
422
422
|
});
|
|
423
423
|
}
|
|
@@ -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(
|
|
429
|
+
const r = e.get(P);
|
|
430
430
|
this.registerEventHandler(
|
|
431
431
|
this.Event.BeforeClipboardChange,
|
|
432
432
|
() => r.beforeCommandExecuted((t) => {
|
|
@@ -451,7 +451,7 @@ class Ue extends q {
|
|
|
451
451
|
this.Event.BeforeClipboardPaste,
|
|
452
452
|
() => r.beforeCommandExecuted((t) => {
|
|
453
453
|
switch (t.id) {
|
|
454
|
-
case
|
|
454
|
+
case T.id:
|
|
455
455
|
this._beforeClipboardPaste(t.params);
|
|
456
456
|
break;
|
|
457
457
|
case Z.id:
|
|
@@ -463,7 +463,7 @@ class Ue extends q {
|
|
|
463
463
|
this.Event.ClipboardPasted,
|
|
464
464
|
() => r.onCommandExecuted((t) => {
|
|
465
465
|
switch (t.id) {
|
|
466
|
-
case
|
|
466
|
+
case T.id:
|
|
467
467
|
this._clipboardPaste(t.params);
|
|
468
468
|
break;
|
|
469
469
|
case Z.id:
|
|
@@ -474,12 +474,12 @@ class Ue extends q {
|
|
|
474
474
|
), this.registerEventHandler(
|
|
475
475
|
this.Event.SheetSkeletonChanged,
|
|
476
476
|
() => r.onCommandExecuted((t) => {
|
|
477
|
-
if (
|
|
477
|
+
if (Se.indexOf(t.id) > -1) {
|
|
478
478
|
const i = this.getActiveSheet();
|
|
479
479
|
if (!i) return;
|
|
480
|
-
const o =
|
|
481
|
-
var d,
|
|
482
|
-
return (
|
|
480
|
+
const o = me(t, i.worksheet.getMaxColumns()).map((s) => {
|
|
481
|
+
var d, h;
|
|
482
|
+
return (h = (d = this.getWorkbook(s.unitId)) == null ? void 0 : d.getSheetBySheetId(s.subUnitId)) == null ? void 0 : h.getRange(s.range);
|
|
483
483
|
}).filter(Boolean);
|
|
484
484
|
if (!o.length) return;
|
|
485
485
|
this.fireEvent(this.Event.SheetSkeletonChanged, {
|
|
@@ -537,12 +537,12 @@ class Ue extends q {
|
|
|
537
537
|
const o = (await this._injector.get(Re).read())[0];
|
|
538
538
|
let s;
|
|
539
539
|
if (o) {
|
|
540
|
-
const d = o.types,
|
|
540
|
+
const d = o.types, h = d.indexOf(K) !== -1 ? await o.getType(K).then((l) => l && l.text()) : "", g = d.indexOf(Y) !== -1 ? await o.getType(Y).then((l) => l && l.text()) : "";
|
|
541
541
|
s = {
|
|
542
542
|
workbook: e,
|
|
543
543
|
worksheet: r,
|
|
544
|
-
text:
|
|
545
|
-
html:
|
|
544
|
+
text: h,
|
|
545
|
+
html: g
|
|
546
546
|
};
|
|
547
547
|
}
|
|
548
548
|
return s;
|
|
@@ -576,14 +576,14 @@ class Ue extends q {
|
|
|
576
576
|
throw new E();
|
|
577
577
|
}
|
|
578
578
|
customizeColumnHeader(e) {
|
|
579
|
-
var
|
|
579
|
+
var g, l;
|
|
580
580
|
const r = this.getActiveWorkbook();
|
|
581
581
|
if (!r) {
|
|
582
582
|
console.error("WorkBook not exist");
|
|
583
583
|
return;
|
|
584
584
|
}
|
|
585
585
|
const t = r == null ? void 0 : r.getId(), i = this._injector.get(v), o = r.getActiveSheet(), s = o.getSheetId(), d = i.getRenderById(t);
|
|
586
|
-
d && ((
|
|
586
|
+
d && ((g = e.headerStyle) != null && g.size) && (d.with(_).setColumnHeaderSize(d, s, (l = e.headerStyle) == null ? void 0 : l.size), o == null || o.refreshCanvas()), this._getSheetRenderComponent(t, b.COLUMN).setCustomHeader(e), o == null || o.refreshCanvas();
|
|
587
587
|
}
|
|
588
588
|
customizeRowHeader(e) {
|
|
589
589
|
const r = this.getActiveWorkbook();
|
|
@@ -592,22 +592,22 @@ class Ue extends q {
|
|
|
592
592
|
return;
|
|
593
593
|
}
|
|
594
594
|
const t = r == null ? void 0 : r.getId();
|
|
595
|
-
this._getSheetRenderComponent(t,
|
|
595
|
+
this._getSheetRenderComponent(t, b.ROW).setCustomHeader(e);
|
|
596
596
|
}
|
|
597
597
|
registerSheetRowHeaderExtension(e, ...r) {
|
|
598
|
-
const t = this._getSheetRenderComponent(e,
|
|
598
|
+
const t = this._getSheetRenderComponent(e, b.ROW), i = t.register(...r);
|
|
599
599
|
return m(() => {
|
|
600
600
|
i.dispose(), t.makeDirty(!0);
|
|
601
601
|
});
|
|
602
602
|
}
|
|
603
603
|
registerSheetColumnHeaderExtension(e, ...r) {
|
|
604
|
-
const t = this._getSheetRenderComponent(e,
|
|
604
|
+
const t = this._getSheetRenderComponent(e, b.COLUMN), i = t.register(...r);
|
|
605
605
|
return m(() => {
|
|
606
606
|
i.dispose(), t.makeDirty(!0);
|
|
607
607
|
});
|
|
608
608
|
}
|
|
609
609
|
registerSheetMainExtension(e, ...r) {
|
|
610
|
-
const t = this._getSheetRenderComponent(e,
|
|
610
|
+
const t = this._getSheetRenderComponent(e, b.MAIN), i = t.register(...r);
|
|
611
611
|
return m(() => {
|
|
612
612
|
i.dispose(), t.makeDirty(!0);
|
|
613
613
|
});
|
|
@@ -633,14 +633,14 @@ class Ue extends q {
|
|
|
633
633
|
* @returns {FSheetHooks} FSheetHooks instance
|
|
634
634
|
*/
|
|
635
635
|
getSheetHooks() {
|
|
636
|
-
return this._injector.createInstance(
|
|
636
|
+
return this._injector.createInstance($);
|
|
637
637
|
}
|
|
638
638
|
pasteIntoSheet(e, r, t) {
|
|
639
|
-
return this._commandService.executeCommand(
|
|
639
|
+
return this._commandService.executeCommand(T.id, { htmlContent: e, textContent: r, files: t });
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
642
|
q.extend(Ue);
|
|
643
|
-
class xe extends
|
|
643
|
+
class xe extends te {
|
|
644
644
|
openSiderbar(e) {
|
|
645
645
|
return this._logDeprecation("openSiderbar"), this._injector.get(He).open(e);
|
|
646
646
|
}
|
|
@@ -656,11 +656,11 @@ class xe extends ee {
|
|
|
656
656
|
}
|
|
657
657
|
customizeColumnHeader(e) {
|
|
658
658
|
const r = this._workbook.getUnitId();
|
|
659
|
-
this._getSheetRenderComponent(r,
|
|
659
|
+
this._getSheetRenderComponent(r, b.COLUMN).setCustomHeader(e);
|
|
660
660
|
}
|
|
661
661
|
customizeRowHeader(e) {
|
|
662
662
|
const r = this._workbook.getUnitId();
|
|
663
|
-
this._getSheetRenderComponent(r,
|
|
663
|
+
this._getSheetRenderComponent(r, b.ROW).setCustomHeader(e);
|
|
664
664
|
}
|
|
665
665
|
/**
|
|
666
666
|
* Get sheet render component from render by unitId and view key.
|
|
@@ -691,7 +691,7 @@ class xe extends ee {
|
|
|
691
691
|
};
|
|
692
692
|
}
|
|
693
693
|
onCellClick(e) {
|
|
694
|
-
const r = this._injector.get(
|
|
694
|
+
const r = this._injector.get(f);
|
|
695
695
|
return m(
|
|
696
696
|
r.currentClickedCell$.pipe(u((t) => !!t)).subscribe((t) => {
|
|
697
697
|
e(t);
|
|
@@ -699,25 +699,25 @@ class xe extends ee {
|
|
|
699
699
|
);
|
|
700
700
|
}
|
|
701
701
|
onCellHover(e) {
|
|
702
|
-
const r = this._injector.get(
|
|
702
|
+
const r = this._injector.get(f);
|
|
703
703
|
return m(
|
|
704
704
|
r.currentRichText$.pipe(u((t) => !!t)).subscribe(e)
|
|
705
705
|
);
|
|
706
706
|
}
|
|
707
707
|
onCellPointerDown(e) {
|
|
708
|
-
const r = this._injector.get(
|
|
708
|
+
const r = this._injector.get(f);
|
|
709
709
|
return m(
|
|
710
710
|
r.currentPointerDownCell$.subscribe(e)
|
|
711
711
|
);
|
|
712
712
|
}
|
|
713
713
|
onCellPointerUp(e) {
|
|
714
|
-
const r = this._injector.get(
|
|
714
|
+
const r = this._injector.get(f);
|
|
715
715
|
return m(
|
|
716
716
|
r.currentPointerUpCell$.subscribe(e)
|
|
717
717
|
);
|
|
718
718
|
}
|
|
719
719
|
onCellPointerMove(e) {
|
|
720
|
-
const r = this._injector.get(
|
|
720
|
+
const r = this._injector.get(f);
|
|
721
721
|
return m(
|
|
722
722
|
r.currentCellPosWithEvent$.pipe(u((t) => !!t)).subscribe((t) => {
|
|
723
723
|
e(t, t.event);
|
|
@@ -741,19 +741,21 @@ class xe extends ee {
|
|
|
741
741
|
);
|
|
742
742
|
}
|
|
743
743
|
startEditing() {
|
|
744
|
-
|
|
744
|
+
const e = this._injector.get(P);
|
|
745
|
+
return this._injector.get(p).isVisible().visible ? !0 : e.syncExecuteCommand(k.id, {
|
|
745
746
|
eventType: L.Dblclick,
|
|
746
747
|
unitId: this._workbook.getUnitId(),
|
|
747
748
|
visible: !0
|
|
748
749
|
});
|
|
749
750
|
}
|
|
750
751
|
async endEditing(e) {
|
|
751
|
-
|
|
752
|
+
const r = this._injector.get(P);
|
|
753
|
+
return this._injector.get(p).isVisible().visible && r.syncExecuteCommand(k.id, {
|
|
752
754
|
eventType: L.Keyboard,
|
|
753
|
-
keycode: e ?
|
|
755
|
+
keycode: e ? B.ENTER : B.ESC,
|
|
754
756
|
visible: !1,
|
|
755
757
|
unitId: this._workbook.getUnitId()
|
|
756
|
-
}), await
|
|
758
|
+
}), await ae(0), !0;
|
|
757
759
|
}
|
|
758
760
|
endEditingAsync(e = !0) {
|
|
759
761
|
return this.endEditing(e);
|
|
@@ -761,6 +763,9 @@ class xe extends ee {
|
|
|
761
763
|
abortEditingAsync() {
|
|
762
764
|
return this.endEditingAsync(!1);
|
|
763
765
|
}
|
|
766
|
+
isCellEditing() {
|
|
767
|
+
return this._injector.get(p).isVisible().visible;
|
|
768
|
+
}
|
|
764
769
|
/**
|
|
765
770
|
* Get scroll state of specified sheet.
|
|
766
771
|
* @param {string} sheetId - sheet id
|
|
@@ -791,21 +796,35 @@ class xe extends ee {
|
|
|
791
796
|
return t && t.with(y).showSelection(), this;
|
|
792
797
|
}
|
|
793
798
|
}
|
|
794
|
-
|
|
795
|
-
class
|
|
799
|
+
te.extend(xe);
|
|
800
|
+
class Be extends re {
|
|
796
801
|
refreshCanvas() {
|
|
797
802
|
const e = this._injector.get(v), r = this._fWorkbook.id, t = e.getRenderById(r);
|
|
798
803
|
if (!t)
|
|
799
804
|
throw new Error(`Render Unit with unitId ${r} not found`);
|
|
800
|
-
t.with(
|
|
805
|
+
t.with(_).reCalculate();
|
|
801
806
|
const i = t.mainComponent;
|
|
802
807
|
if (!i)
|
|
803
808
|
throw new Error("Main component not found");
|
|
804
809
|
return i.makeDirty(), this;
|
|
805
810
|
}
|
|
811
|
+
highlightRanges(e, r, t) {
|
|
812
|
+
const i = this._injector.get(ee), o = [];
|
|
813
|
+
for (const s of e) {
|
|
814
|
+
const d = s.getRange(), h = i.addShapeWithNoFresh({ range: d, style: r, primary: t });
|
|
815
|
+
h && o.push(h);
|
|
816
|
+
}
|
|
817
|
+
if (i.refreshShapes(), o.length === 0)
|
|
818
|
+
throw new Error("Failed to highlight current range");
|
|
819
|
+
return m(() => {
|
|
820
|
+
o.forEach((s) => {
|
|
821
|
+
i.removeShape(s);
|
|
822
|
+
});
|
|
823
|
+
});
|
|
824
|
+
}
|
|
806
825
|
zoom(e) {
|
|
807
|
-
const r = this._injector.get(
|
|
808
|
-
return r.executeCommand(
|
|
826
|
+
const r = this._injector.get(P), t = Math.min(Math.max(e, 0.1), 4);
|
|
827
|
+
return r.executeCommand(j.id, {
|
|
809
828
|
unitId: this._workbook.getUnitId(),
|
|
810
829
|
subUnitId: this._worksheet.getSheetId(),
|
|
811
830
|
zoomRatio: t
|
|
@@ -823,18 +842,18 @@ class De extends te {
|
|
|
823
842
|
endRow: 0
|
|
824
843
|
};
|
|
825
844
|
if (!t) return i;
|
|
826
|
-
const s = t.with(
|
|
845
|
+
const s = t.with(_).getCurrentSkeleton();
|
|
827
846
|
if (!s) return i;
|
|
828
847
|
const d = s == null ? void 0 : s.getVisibleRanges();
|
|
829
848
|
if (!d) return i;
|
|
830
849
|
i = s.getVisibleRangeByViewport(le.VIEW_MAIN);
|
|
831
|
-
for (const [
|
|
832
|
-
|
|
850
|
+
for (const [h, g] of d)
|
|
851
|
+
ue.indexOf(h) !== -1 && (i.startColumn = Math.min(i.startColumn, g.startColumn), i.startRow = Math.min(i.startRow, g.startRow), i.endColumn = Math.max(i.endColumn, g.endColumn), i.endRow = Math.max(i.endRow, g.endRow));
|
|
833
852
|
return i;
|
|
834
853
|
}
|
|
835
|
-
scrollToCell(e, r) {
|
|
836
|
-
const
|
|
837
|
-
return
|
|
854
|
+
scrollToCell(e, r, t) {
|
|
855
|
+
const i = this._workbook.getUnitId(), s = this._injector.get(v).getRenderById(i);
|
|
856
|
+
return s && (s == null ? void 0 : s.with(pe)).scrollToCell(e, r, t), this;
|
|
838
857
|
}
|
|
839
858
|
getScrollState() {
|
|
840
859
|
const e = {
|
|
@@ -859,7 +878,7 @@ class De extends te {
|
|
|
859
878
|
}
|
|
860
879
|
getSkeleton() {
|
|
861
880
|
var r, t;
|
|
862
|
-
const e = (r = this._injector.get(v).getRenderById(this._workbook.getUnitId())) == null ? void 0 : r.with(
|
|
881
|
+
const e = (r = this._injector.get(v).getRenderById(this._workbook.getUnitId())) == null ? void 0 : r.with(_);
|
|
863
882
|
return (t = e == null ? void 0 : e.getWorksheetSkeleton(this._worksheet.getSheetId())) == null ? void 0 : t.skeleton;
|
|
864
883
|
}
|
|
865
884
|
autoResizeColumn(e) {
|
|
@@ -874,7 +893,7 @@ class De extends te {
|
|
|
874
893
|
endRow: this._worksheet.getRowCount() - 1
|
|
875
894
|
}
|
|
876
895
|
];
|
|
877
|
-
return this._commandService.syncExecuteCommand(
|
|
896
|
+
return this._commandService.syncExecuteCommand(fe.id, {
|
|
878
897
|
unitId: t,
|
|
879
898
|
subUnitId: i,
|
|
880
899
|
ranges: o
|
|
@@ -892,25 +911,25 @@ class De extends te {
|
|
|
892
911
|
endColumn: this._worksheet.getColumnCount() - 1
|
|
893
912
|
}
|
|
894
913
|
];
|
|
895
|
-
return this._commandService.syncExecuteCommand(
|
|
914
|
+
return this._commandService.syncExecuteCommand(Ce.id, {
|
|
896
915
|
unitId: t,
|
|
897
916
|
subUnitId: i,
|
|
898
917
|
ranges: o
|
|
899
918
|
}), this;
|
|
900
919
|
}
|
|
901
920
|
customizeColumnHeader(e) {
|
|
902
|
-
var d,
|
|
921
|
+
var d, h;
|
|
903
922
|
const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), o = this._injector.get(v).getRenderById(r);
|
|
904
|
-
o && ((d = e.headerStyle) != null && d.size) && o.with(
|
|
923
|
+
o && ((d = e.headerStyle) != null && d.size) && o.with(_).setColumnHeaderSize(o, t, (h = e.headerStyle) == null ? void 0 : h.size), this._getSheetRenderComponent(r, b.COLUMN).setCustomHeader(e, t);
|
|
905
924
|
}
|
|
906
925
|
customizeRowHeader(e) {
|
|
907
|
-
var d,
|
|
926
|
+
var d, h;
|
|
908
927
|
const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId(), o = this._injector.get(v).getRenderById(r);
|
|
909
|
-
o && ((d = e.headerStyle) != null && d.size) && o.with(
|
|
928
|
+
o && ((d = e.headerStyle) != null && d.size) && o.with(_).setRowHeaderSize(o, t, (h = e.headerStyle) == null ? void 0 : h.size), this._getSheetRenderComponent(r, b.ROW).setCustomHeader(e, t);
|
|
910
929
|
}
|
|
911
930
|
setColumnHeaderHeight(e) {
|
|
912
931
|
const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId();
|
|
913
|
-
return this._commandService.executeCommand(
|
|
932
|
+
return this._commandService.executeCommand(ke.id, {
|
|
914
933
|
unitId: r,
|
|
915
934
|
subUnitId: t,
|
|
916
935
|
size: e
|
|
@@ -918,7 +937,7 @@ class De extends te {
|
|
|
918
937
|
}
|
|
919
938
|
setRowHeaderWidth(e) {
|
|
920
939
|
const r = this._workbook.getUnitId(), t = this._worksheet.getSheetId();
|
|
921
|
-
return this._commandService.executeCommand(
|
|
940
|
+
return this._commandService.executeCommand(Ie.id, {
|
|
922
941
|
unitId: r,
|
|
923
942
|
subUnitId: t,
|
|
924
943
|
size: e
|
|
@@ -941,19 +960,19 @@ class De extends te {
|
|
|
941
960
|
return s;
|
|
942
961
|
}
|
|
943
962
|
}
|
|
944
|
-
|
|
945
|
-
class
|
|
963
|
+
re.extend(Be);
|
|
964
|
+
class De extends ne {
|
|
946
965
|
setPermissionDialogVisible(e) {
|
|
947
966
|
this._permissionService.setShowComponents(e);
|
|
948
967
|
}
|
|
949
968
|
}
|
|
950
|
-
|
|
951
|
-
class
|
|
969
|
+
ne.extend(De);
|
|
970
|
+
class Te extends $ {
|
|
952
971
|
onCellPointerMove(e) {
|
|
953
|
-
return m(this._injector.get(
|
|
972
|
+
return m(this._injector.get(f).currentPosition$.subscribe(e));
|
|
954
973
|
}
|
|
955
974
|
onCellPointerOver(e) {
|
|
956
|
-
return m(this._injector.get(
|
|
975
|
+
return m(this._injector.get(f).currentCell$.subscribe(e));
|
|
957
976
|
}
|
|
958
977
|
onCellDragOver(e) {
|
|
959
978
|
return m(this._injector.get(M).currentCell$.subscribe(e));
|
|
@@ -961,27 +980,27 @@ class Be extends j {
|
|
|
961
980
|
onCellDrop(e) {
|
|
962
981
|
return m(this._injector.get(M).endCell$.subscribe(e));
|
|
963
982
|
}
|
|
964
|
-
onCellRender(e, r =
|
|
965
|
-
return this._injector.get(we).intercept(
|
|
983
|
+
onCellRender(e, r = ce.Style, t = be.DATA_VALIDATION) {
|
|
984
|
+
return this._injector.get(we).intercept(Ee.CELL_CONTENT, {
|
|
966
985
|
effect: r,
|
|
967
986
|
handler: (i, o, s) => (i && !i.customRender && e && (i.customRender = [...e]), s(i)),
|
|
968
987
|
priority: t
|
|
969
988
|
});
|
|
970
989
|
}
|
|
971
990
|
onBeforeCellEdit(e) {
|
|
972
|
-
return this._injector.get(
|
|
991
|
+
return this._injector.get(P).beforeCommandExecuted((r) => {
|
|
973
992
|
const t = r.params;
|
|
974
|
-
r.id ===
|
|
993
|
+
r.id === k.id && t.visible && e(t);
|
|
975
994
|
});
|
|
976
995
|
}
|
|
977
996
|
onAfterCellEdit(e) {
|
|
978
|
-
return this._injector.get(
|
|
997
|
+
return this._injector.get(P).onCommandExecuted((r) => {
|
|
979
998
|
const t = r.params;
|
|
980
|
-
r.id ===
|
|
999
|
+
r.id === k.id && !t.visible && e(t);
|
|
981
1000
|
});
|
|
982
1001
|
}
|
|
983
1002
|
}
|
|
984
|
-
|
|
1003
|
+
$.extend(Te);
|
|
985
1004
|
const H = {
|
|
986
1005
|
CellClicked: "CellClicked",
|
|
987
1006
|
CellPointerDown: "CellPointerDown",
|
|
@@ -1087,11 +1106,11 @@ class Ae {
|
|
|
1087
1106
|
return "SheetZoomChanged";
|
|
1088
1107
|
}
|
|
1089
1108
|
}
|
|
1090
|
-
|
|
1091
|
-
class
|
|
1109
|
+
he.extend(Ae);
|
|
1110
|
+
class je extends ie {
|
|
1092
1111
|
getCell() {
|
|
1093
1112
|
var d;
|
|
1094
|
-
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(
|
|
1113
|
+
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;
|
|
1095
1114
|
if (!s)
|
|
1096
1115
|
throw r.error("[Facade]: `FRange.getCell` can only be called in current worksheet"), new Error("`FRange.getCell` can only be called in current worksheet");
|
|
1097
1116
|
return s.getCellWithCoordByIndex(this._range.startRow, this._range.startColumn);
|
|
@@ -1110,8 +1129,8 @@ class $e extends ne {
|
|
|
1110
1129
|
return (t = r == null ? void 0 : r.html) != null ? t : "";
|
|
1111
1130
|
}
|
|
1112
1131
|
attachPopup(e) {
|
|
1113
|
-
var s, d,
|
|
1114
|
-
e.direction = (s = e.direction) != null ? s : "horizontal", e.extraProps = (d = e.extraProps) != null ? d : {}, e.offset = (
|
|
1132
|
+
var s, d, h;
|
|
1133
|
+
e.direction = (s = e.direction) != null ? s : "horizontal", e.extraProps = (d = e.extraProps) != null ? d : {}, e.offset = (h = e.offset) != null ? h : [0, 0];
|
|
1115
1134
|
const { key: r, disposableCollection: t } = G(e, this._injector.get(J)), o = this._injector.get(N).attachPopupToCell(
|
|
1116
1135
|
this._range.startRow,
|
|
1117
1136
|
this._range.startColumn,
|
|
@@ -1122,7 +1141,7 @@ class $e extends ne {
|
|
|
1122
1141
|
return o ? (t.add(o), t) : (t.dispose(), null);
|
|
1123
1142
|
}
|
|
1124
1143
|
attachAlertPopup(e) {
|
|
1125
|
-
const r = this._injector.get(
|
|
1144
|
+
const r = this._injector.get(_e), t = {
|
|
1126
1145
|
workbook: this._workbook,
|
|
1127
1146
|
worksheet: this._worksheet,
|
|
1128
1147
|
row: this._range.startRow,
|
|
@@ -1152,8 +1171,8 @@ class $e extends ne {
|
|
|
1152
1171
|
});
|
|
1153
1172
|
*/
|
|
1154
1173
|
attachRangePopup(e) {
|
|
1155
|
-
var s, d,
|
|
1156
|
-
e.direction = (s = e.direction) != null ? s : "top-center", e.extraProps = (d = e.extraProps) != null ? d : {}, e.offset = (
|
|
1174
|
+
var s, d, h;
|
|
1175
|
+
e.direction = (s = e.direction) != null ? s : "top-center", e.extraProps = (d = e.extraProps) != null ? d : {}, e.offset = (h = e.offset) != null ? h : [0, 0];
|
|
1157
1176
|
const { key: r, disposableCollection: t } = G(e, this._injector.get(J)), o = this._injector.get(N).attachRangePopup(
|
|
1158
1177
|
this._range,
|
|
1159
1178
|
{ ...e, componentKey: r },
|
|
@@ -1163,7 +1182,7 @@ class $e extends ne {
|
|
|
1163
1182
|
return o ? (t.add(o), t) : (t.dispose(), null);
|
|
1164
1183
|
}
|
|
1165
1184
|
highlight(e, r) {
|
|
1166
|
-
const t = this._injector.get(
|
|
1185
|
+
const t = this._injector.get(ee), i = t.addShape({ range: this._range, style: e, primary: r });
|
|
1167
1186
|
if (!i)
|
|
1168
1187
|
throw new Error("Failed to highlight current range");
|
|
1169
1188
|
return m(() => {
|
|
@@ -1174,12 +1193,12 @@ class $e extends ne {
|
|
|
1174
1193
|
return this._injector.get(Pe).showDropdown(e);
|
|
1175
1194
|
}
|
|
1176
1195
|
}
|
|
1177
|
-
|
|
1178
|
-
function G(
|
|
1179
|
-
const { componentKey: r, isVue3: t } =
|
|
1196
|
+
ie.extend(je);
|
|
1197
|
+
function G(w, e) {
|
|
1198
|
+
const { componentKey: r, isVue3: t } = w;
|
|
1180
1199
|
let i;
|
|
1181
1200
|
const o = new A();
|
|
1182
|
-
return typeof r == "string" ? i = r : (i = `External_${
|
|
1201
|
+
return typeof r == "string" ? i = r : (i = `External_${de(6)}`, o.add(e.register(i, r, { framework: t ? "vue3" : "react" }))), {
|
|
1183
1202
|
key: i,
|
|
1184
1203
|
disposableCollection: o
|
|
1185
1204
|
};
|