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