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