@univerjs/sheets-hyper-link-ui 0.1.13 → 0.1.14
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/index.js +2 -2
- package/lib/es/index.js +631 -624
- package/lib/types/controllers/render-controllers/render.controller.d.ts +11 -7
- package/lib/types/index.d.ts +1 -1
- package/lib/types/plugin.d.ts +5 -4
- package/lib/types/types/const.d.ts +1 -1
- package/lib/umd/index.js +2 -2
- package/package.json +36 -22
package/lib/es/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { Disposable as
|
|
5
|
-
import { RemoveSheetCommand as
|
|
6
|
-
import { Inject as g, Injector as
|
|
7
|
-
import { RemoveHyperLinkCommand as
|
|
8
|
-
import { deserializeRangeWithSheet as ce, serializeRangeWithSheet as
|
|
9
|
-
import { MessageType as ie, FormLayout as
|
|
10
|
-
import { ScrollToCellCommand as
|
|
11
|
-
import { IMessageService as
|
|
12
|
-
import { IRenderManagerService as
|
|
13
|
-
import { Subject as
|
|
14
|
-
import
|
|
15
|
-
import { useDependency as b, useObservable as
|
|
16
|
-
import
|
|
17
|
-
import { SPECIAL_PASTE_FORMULA as
|
|
18
|
-
var
|
|
19
|
-
for (var
|
|
20
|
-
(o = t[s]) && (
|
|
21
|
-
return
|
|
22
|
-
}, Ze = (t, e) => (n,
|
|
23
|
-
let _e = class extends
|
|
1
|
+
var Jt = Object.defineProperty;
|
|
2
|
+
var Qt = (t, e, n) => e in t ? Jt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var H = (t, e, n) => (Qt(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
import { Disposable as O, UniverInstanceType as M, OnLifecycle as T, LifecycleStages as U, IUniverInstanceService as J, isValidRange as Re, LocaleService as de, Rectangle as oe, ICommandService as F, toDisposable as en, BooleanNumber as tn, ThemeService as nn, createInternalEditorID as rn, DEFAULT_EMPTY_DOCUMENT_VALUE as sn, Tools as ae, CommandType as Te, CellValueType as at, ObjectMatrix as St, Range as qe, Plugin as on, DependentOn as an } from "@univerjs/core";
|
|
5
|
+
import { RemoveSheetCommand as cn, SheetInterceptorService as Je, SetSelectionsOperation as ln, NORMAL_SELECTION_PLUGIN_NAME as dn, SetWorksheetActiveOperation as Pe, RefRangeService as un, handleDefaultRangeChangeWithEffectRefCommands as ct, INTERCEPTOR_POINT as pn, getSheetCommandTarget as Ct, SelectionManagerService as Lt, SetRangeValuesMutation as pe, SetRangeValuesUndoMutationFactory as lt, SetRangeValuesCommand as hn, ClearSelectionContentCommand as gn, ClearSelectionAllCommand as mn, WorkbookEditablePermission as Qe, WorksheetEditPermission as et, WorksheetSetCellValuePermission as tt, WorksheetInsertHyperlinkPermission as nt, RangeProtectionPermissionEditPoint as rt } from "@univerjs/sheets";
|
|
6
|
+
import { Inject as g, Injector as Ue } from "@wendellhu/redi";
|
|
7
|
+
import { RemoveHyperLinkCommand as fn, AddHyperLinkCommand as it, HyperLinkModel as w, RemoveHyperLinkMutation as x, AddHyperLinkMutation as j, UpdateHyperLinkRefMutation as dt, UpdateHyperLinkMutation as Oe, UpdateHyperLinkCommand as It, CancelHyperLinkCommand as _n, UniverSheetsHyperLinkPlugin as vn } from "@univerjs/sheets-hyper-link";
|
|
8
|
+
import { deserializeRangeWithSheet as ce, serializeRangeWithSheet as kt, IDefinedNamesService as bt, serializeRange as fe, serializeRangeToRefString as yn } from "@univerjs/engine-formula";
|
|
9
|
+
import { MessageType as ie, FormLayout as G, Input as ut, Select as Ve, Button as pt, Tooltip as Fe } from "@univerjs/design";
|
|
10
|
+
import { ScrollToCellCommand as Rt, SheetSkeletonManagerService as Sn, SheetCanvasPopManagerService as Cn, HoverManagerService as Ln, whenSheetEditorFocused as In, getCurrentRangeDisable$ as Pt, APPLY_TYPE as he, IAutoFillService as kn, virtualizeDiscreteRanges as Ye, getAutoFillRepeatRange as bn, COPY_TYPE as ht, rangeToDiscreteRange as Rn, PREDEFINED_HOOK_NAME as We, getRepeatRange as Pn, ISheetClipboardService as On, SheetPermissionInterceptorBaseController as wn } from "@univerjs/sheets-ui";
|
|
11
|
+
import { IMessageService as Ot, useObservable as En, RangeSelector as Mn, ISidebarService as wt, KeyCode as xn, MetaKeys as jn, MenuItemType as Et, MenuPosition as Mt, getMenuHiddenObservable as xt, MenuGroup as Tn, ComponentManager as Un, IShortcutService as Hn, IMenuService as $n } from "@univerjs/ui";
|
|
12
|
+
import { IRenderManagerService as jt } from "@univerjs/engine-render";
|
|
13
|
+
import { Subject as Nn, BehaviorSubject as Dn, debounceTime as An } from "rxjs";
|
|
14
|
+
import Bn, { forwardRef as W, useRef as Tt, createElement as Z, useState as te, useEffect as Vn, useMemo as Fn } from "react";
|
|
15
|
+
import { useDependency as b, useObservable as Wn } from "@wendellhu/redi/react-bindings";
|
|
16
|
+
import gt from "clsx";
|
|
17
|
+
import { SPECIAL_PASTE_FORMULA as Zn } from "@univerjs/sheets-formula";
|
|
18
|
+
var zn = Object.defineProperty, Kn = Object.getOwnPropertyDescriptor, Yn = (t, e, n, r) => {
|
|
19
|
+
for (var i = r > 1 ? void 0 : r ? Kn(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
20
|
+
(o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
|
|
21
|
+
return r && i && zn(e, n, i), i;
|
|
22
|
+
}, Ze = (t, e) => (n, r) => e(n, r, t);
|
|
23
|
+
let _e = class extends O {
|
|
24
24
|
constructor(t, e, n) {
|
|
25
25
|
super(), this._sheetInterceptorService = t, this._univerInstanceService = e, this._hyperLinkModel = n, this._initSheetChange();
|
|
26
26
|
}
|
|
@@ -28,22 +28,22 @@ let _e = class extends T {
|
|
|
28
28
|
this.disposeWithMe(
|
|
29
29
|
this._sheetInterceptorService.interceptCommand({
|
|
30
30
|
getMutations: (t) => {
|
|
31
|
-
if (t.id ===
|
|
32
|
-
const e = t.params, n = e.unitId ? this._univerInstanceService.getUnit(e.unitId) : this._univerInstanceService.getCurrentUnitForType(
|
|
31
|
+
if (t.id === cn.id) {
|
|
32
|
+
const e = t.params, n = e.unitId ? this._univerInstanceService.getUnit(e.unitId) : this._univerInstanceService.getCurrentUnitForType(M.UNIVER_SHEET);
|
|
33
33
|
if (!n)
|
|
34
34
|
return { redos: [], undos: [] };
|
|
35
|
-
const
|
|
36
|
-
id:
|
|
35
|
+
const r = n.getUnitId(), i = e.subUnitId || n.getActiveSheet().getSheetId(), s = this._hyperLinkModel.getSubUnit(r, i), o = s.map((a) => ({
|
|
36
|
+
id: fn.id,
|
|
37
37
|
params: {
|
|
38
|
-
unitId:
|
|
39
|
-
subUnitId:
|
|
38
|
+
unitId: r,
|
|
39
|
+
subUnitId: i,
|
|
40
40
|
id: a.id
|
|
41
41
|
}
|
|
42
42
|
})), c = s.map((a) => ({
|
|
43
|
-
id:
|
|
43
|
+
id: it.id,
|
|
44
44
|
params: {
|
|
45
|
-
unitId:
|
|
46
|
-
subUnitId:
|
|
45
|
+
unitId: r,
|
|
46
|
+
subUnitId: i,
|
|
47
47
|
link: a
|
|
48
48
|
}
|
|
49
49
|
}));
|
|
@@ -55,46 +55,46 @@ let _e = class extends T {
|
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
-
_e =
|
|
59
|
-
U
|
|
60
|
-
Ze(0, g(
|
|
61
|
-
Ze(1,
|
|
62
|
-
Ze(2, g(
|
|
58
|
+
_e = Yn([
|
|
59
|
+
T(U.Ready, _e),
|
|
60
|
+
Ze(0, g(Je)),
|
|
61
|
+
Ze(1, J),
|
|
62
|
+
Ze(2, g(w))
|
|
63
63
|
], _e);
|
|
64
|
-
const
|
|
65
|
-
var
|
|
66
|
-
for (var
|
|
67
|
-
(o = t[s]) && (
|
|
68
|
-
return
|
|
69
|
-
}, ne = (t, e) => (n,
|
|
70
|
-
function
|
|
64
|
+
const st = "SHEET_HYPER_LINK_UI_PLUGIN", Ge = "err";
|
|
65
|
+
var Gn = Object.defineProperty, Xn = Object.getOwnPropertyDescriptor, qn = (t, e, n, r) => {
|
|
66
|
+
for (var i = r > 1 ? void 0 : r ? Xn(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
67
|
+
(o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
|
|
68
|
+
return r && i && Gn(e, n, i), i;
|
|
69
|
+
}, ne = (t, e) => (n, r) => e(n, r, t);
|
|
70
|
+
function Jn(t, e) {
|
|
71
71
|
const n = [];
|
|
72
|
-
return e.forEach((
|
|
73
|
-
oe.intersects(t,
|
|
72
|
+
return e.forEach((r) => {
|
|
73
|
+
oe.intersects(t, r) && n.push(r);
|
|
74
74
|
}), oe.realUnion(t, ...n);
|
|
75
75
|
}
|
|
76
76
|
let B = class {
|
|
77
|
-
constructor(t, e, n,
|
|
78
|
-
this._univerInstanceService = t, this._commandService = e, this._definedNamesService = n, this._messageService =
|
|
77
|
+
constructor(t, e, n, r, i) {
|
|
78
|
+
this._univerInstanceService = t, this._commandService = e, this._definedNamesService = n, this._messageService = r, this._localeService = i;
|
|
79
79
|
}
|
|
80
80
|
_getURLName(t) {
|
|
81
81
|
var c;
|
|
82
|
-
const { gid: e, range: n, rangeid:
|
|
83
|
-
if (!
|
|
82
|
+
const { gid: e, range: n, rangeid: r } = t, i = this._univerInstanceService.getCurrentUnitForType(M.UNIVER_SHEET);
|
|
83
|
+
if (!i)
|
|
84
84
|
return null;
|
|
85
|
-
const s = e ?
|
|
85
|
+
const s = e ? i.getSheetBySheetId(e) : i.getActiveSheet(), o = (c = s == null ? void 0 : s.getName()) != null ? c : "";
|
|
86
86
|
if (n) {
|
|
87
87
|
const a = ce(n).range;
|
|
88
|
-
return
|
|
88
|
+
return Re(a) && n !== Ge ? {
|
|
89
89
|
type: "range",
|
|
90
|
-
name:
|
|
90
|
+
name: kt(o, a)
|
|
91
91
|
} : {
|
|
92
92
|
type: "range-error",
|
|
93
93
|
name: this._localeService.t("hyperLink.message.refError")
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
if (
|
|
97
|
-
const a = this._definedNamesService.getValueById(
|
|
96
|
+
if (r) {
|
|
97
|
+
const a = this._definedNamesService.getValueById(i.getUnitId(), r);
|
|
98
98
|
return a ? {
|
|
99
99
|
type: "defineName",
|
|
100
100
|
name: a.formulaOrRefString
|
|
@@ -104,7 +104,7 @@ let B = class {
|
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
if (e) {
|
|
107
|
-
const a =
|
|
107
|
+
const a = i.getSheetBySheetId(e);
|
|
108
108
|
return a ? {
|
|
109
109
|
type: "sheet",
|
|
110
110
|
name: a.getName()
|
|
@@ -116,26 +116,26 @@ let B = class {
|
|
|
116
116
|
return null;
|
|
117
117
|
}
|
|
118
118
|
navigateTo(t) {
|
|
119
|
-
const { gid: e, range: n, rangeid:
|
|
120
|
-
if (!
|
|
119
|
+
const { gid: e, range: n, rangeid: r } = t, i = this._univerInstanceService.getCurrentUnitForType(M.UNIVER_SHEET);
|
|
120
|
+
if (!i)
|
|
121
121
|
return;
|
|
122
|
-
const s =
|
|
123
|
-
if (
|
|
122
|
+
const s = i.getUnitId();
|
|
123
|
+
if (r && this.navigateToDefineName(s, r), !!e) {
|
|
124
124
|
if (n) {
|
|
125
125
|
const o = ce(n);
|
|
126
|
-
|
|
126
|
+
Re(o.range) && n !== Ge && this.navigateToRange(s, e, o.range);
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
129
|
this.navigateToSheetById(s, e);
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
parseHyperLink(t) {
|
|
133
|
-
var e, n,
|
|
133
|
+
var e, n, r;
|
|
134
134
|
if (t != null && t.startsWith("#")) {
|
|
135
|
-
const
|
|
136
|
-
gid: (e =
|
|
137
|
-
range: (n =
|
|
138
|
-
rangeid: (
|
|
135
|
+
const i = new URLSearchParams(t.slice(1)), s = {
|
|
136
|
+
gid: (e = i.get("gid")) != null ? e : "",
|
|
137
|
+
range: (n = i.get("range")) != null ? n : "",
|
|
138
|
+
rangeid: (r = i.get("rangeid")) != null ? r : ""
|
|
139
139
|
}, o = this._getURLName(s);
|
|
140
140
|
return {
|
|
141
141
|
type: (o == null ? void 0 : o.type) || "link",
|
|
@@ -157,57 +157,57 @@ let B = class {
|
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
async navigateToRange(t, e, n) {
|
|
160
|
-
const
|
|
161
|
-
if (
|
|
162
|
-
const
|
|
160
|
+
const r = await this.navigateToSheetById(t, e);
|
|
161
|
+
if (r) {
|
|
162
|
+
const i = Jn(n, r.getMergeData());
|
|
163
163
|
await this._commandService.executeCommand(
|
|
164
|
-
|
|
164
|
+
ln.id,
|
|
165
165
|
{
|
|
166
166
|
unitId: t,
|
|
167
167
|
subUnitId: e,
|
|
168
|
-
pluginName:
|
|
168
|
+
pluginName: dn,
|
|
169
169
|
selections: [{
|
|
170
|
-
range:
|
|
170
|
+
range: i
|
|
171
171
|
}]
|
|
172
172
|
}
|
|
173
|
-
), await this._commandService.executeCommand(
|
|
174
|
-
range:
|
|
173
|
+
), await this._commandService.executeCommand(Rt.id, {
|
|
174
|
+
range: i
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
async navigateToSheet(t, e) {
|
|
179
|
-
const n = this._univerInstanceService.getUnit(t,
|
|
179
|
+
const n = this._univerInstanceService.getUnit(t, M.UNIVER_SHEET);
|
|
180
180
|
if (!n)
|
|
181
181
|
return !1;
|
|
182
|
-
const
|
|
183
|
-
if ((
|
|
182
|
+
const r = n.getActiveSheet();
|
|
183
|
+
if ((r == null ? void 0 : r.getName()) === e)
|
|
184
184
|
return !0;
|
|
185
|
-
const
|
|
186
|
-
if (!
|
|
185
|
+
const i = n.getSheetBySheetName(e);
|
|
186
|
+
if (!i) {
|
|
187
187
|
this._messageService.show({
|
|
188
188
|
content: this._localeService.t("hyperLink.message.noSheet"),
|
|
189
189
|
type: ie.Error
|
|
190
190
|
});
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
193
|
-
const s =
|
|
193
|
+
const s = i.getSheetId();
|
|
194
194
|
return n.getHiddenWorksheets().indexOf(s) > -1 && this._messageService.show({
|
|
195
195
|
content: this._localeService.t("hyperLink.message.hiddenSheet"),
|
|
196
196
|
type: ie.Error
|
|
197
|
-
}), await this._commandService.executeCommand(
|
|
197
|
+
}), await this._commandService.executeCommand(Pe.id, { unitId: t, subUnitId: s });
|
|
198
198
|
}
|
|
199
199
|
async navigateToSheetById(t, e) {
|
|
200
|
-
const n = this._univerInstanceService.getUnit(t,
|
|
200
|
+
const n = this._univerInstanceService.getUnit(t, M.UNIVER_SHEET);
|
|
201
201
|
if (!n)
|
|
202
202
|
return !1;
|
|
203
|
-
const
|
|
204
|
-
if (
|
|
205
|
-
return
|
|
206
|
-
const
|
|
207
|
-
return
|
|
203
|
+
const r = n.getActiveSheet();
|
|
204
|
+
if (r.getSheetId() === e)
|
|
205
|
+
return r;
|
|
206
|
+
const i = n.getSheetBySheetId(e);
|
|
207
|
+
return i ? n.getHiddenWorksheets().indexOf(e) > -1 ? (this._messageService.show({
|
|
208
208
|
content: this._localeService.t("hyperLink.message.hiddenSheet"),
|
|
209
209
|
type: ie.Error
|
|
210
|
-
}), !1) : await this._commandService.executeCommand(
|
|
210
|
+
}), !1) : await this._commandService.executeCommand(Pe.id, { unitId: t, subUnitId: e }) ? i : !1 : (this._messageService.show({
|
|
211
211
|
content: this._localeService.t("hyperLink.message.noSheet"),
|
|
212
212
|
type: ie.Error
|
|
213
213
|
}), !1);
|
|
@@ -219,78 +219,78 @@ let B = class {
|
|
|
219
219
|
window.open(t, "_blank", "noopener noreferrer");
|
|
220
220
|
}
|
|
221
221
|
};
|
|
222
|
-
B =
|
|
223
|
-
ne(0,
|
|
224
|
-
ne(1,
|
|
225
|
-
ne(2,
|
|
226
|
-
ne(3,
|
|
222
|
+
B = qn([
|
|
223
|
+
ne(0, J),
|
|
224
|
+
ne(1, F),
|
|
225
|
+
ne(2, bt),
|
|
226
|
+
ne(3, Ot),
|
|
227
227
|
ne(4, g(de))
|
|
228
228
|
], B);
|
|
229
|
-
var
|
|
230
|
-
for (var
|
|
231
|
-
(o = t[s]) && (
|
|
232
|
-
return
|
|
233
|
-
}, ge = (t, e) => (n,
|
|
234
|
-
let
|
|
235
|
-
constructor(e, n,
|
|
229
|
+
var Qn = Object.defineProperty, er = Object.getOwnPropertyDescriptor, tr = (t, e, n, r) => {
|
|
230
|
+
for (var i = r > 1 ? void 0 : r ? er(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
231
|
+
(o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
|
|
232
|
+
return r && i && Qn(e, n, i), i;
|
|
233
|
+
}, ge = (t, e) => (n, r) => e(n, r, t);
|
|
234
|
+
let ve = class extends O {
|
|
235
|
+
constructor(e, n, r, i) {
|
|
236
236
|
super();
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
this._refRangeService = e, this._hyperLinkModel = n, this._resolverService =
|
|
237
|
+
H(this, "_disposableMap", /* @__PURE__ */ new Map());
|
|
238
|
+
H(this, "_rangeDisableMap", /* @__PURE__ */ new Map());
|
|
239
|
+
this._refRangeService = e, this._hyperLinkModel = n, this._resolverService = r, this._univerInstanceService = i, this._initData(), this._initRefRange();
|
|
240
240
|
}
|
|
241
|
-
_register(e, n,
|
|
242
|
-
const
|
|
243
|
-
startColumn:
|
|
244
|
-
endColumn:
|
|
245
|
-
startRow:
|
|
246
|
-
endRow:
|
|
241
|
+
_register(e, n, r) {
|
|
242
|
+
const i = r.id, s = {
|
|
243
|
+
startColumn: r.column,
|
|
244
|
+
endColumn: r.column,
|
|
245
|
+
startRow: r.row,
|
|
246
|
+
endRow: r.row
|
|
247
247
|
}, o = (c) => {
|
|
248
|
-
const a =
|
|
248
|
+
const a = ct(s, c);
|
|
249
249
|
return a && a.startColumn === s.startColumn && a.startRow === s.startRow ? {
|
|
250
250
|
undos: [],
|
|
251
251
|
redos: []
|
|
252
252
|
} : a ? {
|
|
253
253
|
redos: [{
|
|
254
|
-
id:
|
|
254
|
+
id: dt.id,
|
|
255
255
|
params: {
|
|
256
256
|
unitId: e,
|
|
257
257
|
subUnitId: n,
|
|
258
|
-
id:
|
|
258
|
+
id: r.id,
|
|
259
259
|
row: a.startRow,
|
|
260
260
|
column: a.startColumn
|
|
261
261
|
}
|
|
262
262
|
}],
|
|
263
263
|
undos: [{
|
|
264
|
-
id:
|
|
264
|
+
id: dt.id,
|
|
265
265
|
params: {
|
|
266
266
|
unitId: e,
|
|
267
267
|
subUnitId: n,
|
|
268
|
-
id:
|
|
268
|
+
id: r.id,
|
|
269
269
|
row: s.startRow,
|
|
270
270
|
column: s.startColumn
|
|
271
271
|
}
|
|
272
272
|
}]
|
|
273
273
|
} : {
|
|
274
274
|
redos: [{
|
|
275
|
-
id:
|
|
275
|
+
id: x.id,
|
|
276
276
|
params: {
|
|
277
277
|
unitId: e,
|
|
278
278
|
subUnitId: n,
|
|
279
|
-
id:
|
|
279
|
+
id: r.id
|
|
280
280
|
}
|
|
281
281
|
}],
|
|
282
282
|
undos: [{
|
|
283
|
-
id:
|
|
283
|
+
id: j.id,
|
|
284
284
|
params: {
|
|
285
285
|
unitId: e,
|
|
286
286
|
subUnitId: n,
|
|
287
|
-
link:
|
|
287
|
+
link: r
|
|
288
288
|
}
|
|
289
289
|
}]
|
|
290
290
|
};
|
|
291
291
|
};
|
|
292
292
|
this._disposableMap.set(
|
|
293
|
-
|
|
293
|
+
i,
|
|
294
294
|
this._refRangeService.registerRefRange(s, o, e, n)
|
|
295
295
|
);
|
|
296
296
|
}
|
|
@@ -298,36 +298,36 @@ let ye = class extends T {
|
|
|
298
298
|
const n = this._disposableMap.get(e);
|
|
299
299
|
n == null || n.dispose(), this._disposableMap.delete(e);
|
|
300
300
|
}
|
|
301
|
-
_registerRange(e, n,
|
|
302
|
-
const
|
|
303
|
-
if (
|
|
304
|
-
const s =
|
|
305
|
-
if (
|
|
301
|
+
_registerRange(e, n, r) {
|
|
302
|
+
const i = this._resolverService.parseHyperLink(r);
|
|
303
|
+
if (i.searchObj && i.searchObj.range && i.searchObj.gid) {
|
|
304
|
+
const s = i.searchObj.gid, o = ce(i.searchObj.range).range;
|
|
305
|
+
if (Re(o) && i.searchObj.range !== Ge) {
|
|
306
306
|
const c = (a) => {
|
|
307
|
-
const p =
|
|
308
|
-
return p &&
|
|
307
|
+
const p = ct(o, a);
|
|
308
|
+
return p && fe(p) === fe(o) ? {
|
|
309
309
|
redos: [],
|
|
310
310
|
undos: []
|
|
311
311
|
} : {
|
|
312
312
|
redos: [{
|
|
313
|
-
id:
|
|
313
|
+
id: Oe.id,
|
|
314
314
|
params: {
|
|
315
315
|
unitId: e,
|
|
316
316
|
subUnitId: s,
|
|
317
317
|
id: n,
|
|
318
318
|
payload: {
|
|
319
|
-
payload: `#gid=${s}&range=${p ?
|
|
319
|
+
payload: `#gid=${s}&range=${p ? fe(p) : "err"}`
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
}],
|
|
323
323
|
undos: [{
|
|
324
|
-
id:
|
|
324
|
+
id: Oe.id,
|
|
325
325
|
params: {
|
|
326
326
|
unitId: e,
|
|
327
327
|
subUnitId: s,
|
|
328
328
|
id: n,
|
|
329
329
|
payload: {
|
|
330
|
-
payload:
|
|
330
|
+
payload: r
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
}]
|
|
@@ -343,10 +343,10 @@ let ye = class extends T {
|
|
|
343
343
|
}
|
|
344
344
|
_initData() {
|
|
345
345
|
this._hyperLinkModel.getAll().forEach((n) => {
|
|
346
|
-
n.forEach((
|
|
347
|
-
const { unitId:
|
|
346
|
+
n.forEach((r) => {
|
|
347
|
+
const { unitId: i, subUnitId: s, links: o } = r;
|
|
348
348
|
o.forEach((c) => {
|
|
349
|
-
this._register(
|
|
349
|
+
this._register(i, s, c);
|
|
350
350
|
});
|
|
351
351
|
});
|
|
352
352
|
});
|
|
@@ -364,17 +364,17 @@ let ye = class extends T {
|
|
|
364
364
|
break;
|
|
365
365
|
}
|
|
366
366
|
case "updateRef": {
|
|
367
|
-
const { unitId: n, subUnitId:
|
|
367
|
+
const { unitId: n, subUnitId: r, id: i } = e, s = this._hyperLinkModel.getHyperLink(n, r, i);
|
|
368
368
|
if (!s)
|
|
369
369
|
return;
|
|
370
|
-
this._unregister(
|
|
370
|
+
this._unregister(i), this._register(n, r, s);
|
|
371
371
|
break;
|
|
372
372
|
}
|
|
373
373
|
case "unload": {
|
|
374
374
|
const { unitLinks: n } = e;
|
|
375
|
-
n.forEach((
|
|
376
|
-
const { links:
|
|
377
|
-
|
|
375
|
+
n.forEach((r) => {
|
|
376
|
+
const { links: i } = r;
|
|
377
|
+
i.forEach((s) => {
|
|
378
378
|
this._unregister(s.id), this._unregisterRange(s.id);
|
|
379
379
|
});
|
|
380
380
|
});
|
|
@@ -386,41 +386,60 @@ let ye = class extends T {
|
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
388
|
})
|
|
389
|
-
), this.disposeWithMe(
|
|
389
|
+
), this.disposeWithMe(en(() => {
|
|
390
390
|
this._disposableMap.forEach((e) => {
|
|
391
391
|
e.dispose();
|
|
392
392
|
}), this._disposableMap.clear();
|
|
393
393
|
}));
|
|
394
394
|
}
|
|
395
395
|
};
|
|
396
|
-
|
|
397
|
-
U
|
|
398
|
-
ge(0, g(
|
|
399
|
-
ge(1, g(
|
|
396
|
+
ve = tr([
|
|
397
|
+
T(U.Starting, ve),
|
|
398
|
+
ge(0, g(un)),
|
|
399
|
+
ge(1, g(w)),
|
|
400
400
|
ge(2, g(B)),
|
|
401
|
-
ge(3,
|
|
402
|
-
],
|
|
403
|
-
var
|
|
404
|
-
for (var
|
|
405
|
-
(o = t[s]) && (
|
|
406
|
-
return
|
|
407
|
-
}, q = (t, e) => (n,
|
|
408
|
-
let
|
|
409
|
-
constructor(t, e, n,
|
|
410
|
-
super(), this.
|
|
401
|
+
ge(3, J)
|
|
402
|
+
], ve);
|
|
403
|
+
var nr = Object.defineProperty, rr = Object.getOwnPropertyDescriptor, Ut = (t, e, n, r) => {
|
|
404
|
+
for (var i = r > 1 ? void 0 : r ? rr(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
405
|
+
(o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
|
|
406
|
+
return r && i && nr(e, n, i), i;
|
|
407
|
+
}, q = (t, e) => (n, r) => e(n, r, t);
|
|
408
|
+
let Xe = class extends O {
|
|
409
|
+
constructor(t, e, n, r) {
|
|
410
|
+
super(), this._context = t, this._hyperLinkModel = e, this._sheetSkeletonManagerService = n, this._renderManagerService = r, this._initSkeletonChange();
|
|
411
|
+
}
|
|
412
|
+
_initSkeletonChange() {
|
|
413
|
+
const t = () => {
|
|
414
|
+
const e = this._context.unit, n = e.getUnitId(), r = e.getActiveSheet().getSheetId(), i = this._sheetSkeletonManagerService.getOrCreateSkeleton({ sheetId: r }), s = this._renderManagerService.getRenderById(n);
|
|
415
|
+
i == null || i.makeDirty(!0), i == null || i.calculate(), s && s.mainComponent.makeForceDirty();
|
|
416
|
+
};
|
|
417
|
+
this.disposeWithMe(this._hyperLinkModel.linkUpdate$.subscribe(() => {
|
|
418
|
+
t();
|
|
419
|
+
}));
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
Xe = Ut([
|
|
423
|
+
q(1, g(w)),
|
|
424
|
+
q(2, g(Sn)),
|
|
425
|
+
q(3, jt)
|
|
426
|
+
], Xe);
|
|
427
|
+
let ye = class extends O {
|
|
428
|
+
constructor(t, e, n) {
|
|
429
|
+
super(), this._sheetInterceptorService = t, this._hyperLinkModel = e, this._themeService = n, this._initViewModelIntercept();
|
|
411
430
|
}
|
|
412
431
|
_initViewModelIntercept() {
|
|
413
432
|
this.disposeWithMe(
|
|
414
433
|
this._sheetInterceptorService.intercept(
|
|
415
|
-
|
|
434
|
+
pn.CELL_CONTENT,
|
|
416
435
|
{
|
|
417
436
|
handler: (t, e, n) => {
|
|
418
|
-
const { row:
|
|
437
|
+
const { row: r, col: i, unitId: s, subUnitId: o } = e, c = this._hyperLinkModel.getHyperLinkByLocation(s, o, r, i), a = this._themeService.getCurrentTheme();
|
|
419
438
|
return n(c ? {
|
|
420
439
|
...t,
|
|
421
440
|
interceptorStyle: {
|
|
422
441
|
ul: {
|
|
423
|
-
s:
|
|
442
|
+
s: tn.TRUE
|
|
424
443
|
},
|
|
425
444
|
cl: {
|
|
426
445
|
rgb: a.blue500
|
|
@@ -433,29 +452,14 @@ let Se = class extends T {
|
|
|
433
452
|
)
|
|
434
453
|
);
|
|
435
454
|
}
|
|
436
|
-
_initSkeletonChange() {
|
|
437
|
-
const t = () => {
|
|
438
|
-
const e = this._univerInstanceService.getCurrentUnitForType(E.UNIVER_SHEET);
|
|
439
|
-
if (!e)
|
|
440
|
-
return;
|
|
441
|
-
const n = e.getUnitId(), i = e.getActiveSheet().getSheetId(), r = this._sheetSkeletonManagerService.getOrCreateSkeleton({ unitId: n, sheetId: i }), s = this._renderManagerService.getRenderById(n);
|
|
442
|
-
r == null || r.makeDirty(!0), r == null || r.calculate(), s && s.mainComponent.makeForceDirty();
|
|
443
|
-
};
|
|
444
|
-
this.disposeWithMe(this._hyperLinkModel.linkUpdate$.subscribe(() => {
|
|
445
|
-
t();
|
|
446
|
-
}));
|
|
447
|
-
}
|
|
448
455
|
};
|
|
449
|
-
|
|
450
|
-
U
|
|
451
|
-
q(0, g(
|
|
452
|
-
q(1, g(
|
|
453
|
-
q(2,
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
q(5, g(qt))
|
|
457
|
-
], Se);
|
|
458
|
-
var Tt = { exports: {} }, He = {};
|
|
456
|
+
ye = Ut([
|
|
457
|
+
T(U.Ready, ye),
|
|
458
|
+
q(0, g(Je)),
|
|
459
|
+
q(1, g(w)),
|
|
460
|
+
q(2, g(nn))
|
|
461
|
+
], ye);
|
|
462
|
+
var Ht = { exports: {} }, He = {};
|
|
459
463
|
/**
|
|
460
464
|
* @license React
|
|
461
465
|
* react-jsx-runtime.production.min.js
|
|
@@ -465,135 +469,135 @@ var Tt = { exports: {} }, He = {};
|
|
|
465
469
|
* This source code is licensed under the MIT license found in the
|
|
466
470
|
* LICENSE file in the root directory of this source tree.
|
|
467
471
|
*/
|
|
468
|
-
var
|
|
469
|
-
function
|
|
470
|
-
var
|
|
472
|
+
var ir = Bn, sr = Symbol.for("react.element"), or = Symbol.for("react.fragment"), ar = Object.prototype.hasOwnProperty, cr = ir.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, lr = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
473
|
+
function $t(t, e, n) {
|
|
474
|
+
var r, i = {}, s = null, o = null;
|
|
471
475
|
n !== void 0 && (s = "" + n), e.key !== void 0 && (s = "" + e.key), e.ref !== void 0 && (o = e.ref);
|
|
472
|
-
for (
|
|
473
|
-
|
|
476
|
+
for (r in e)
|
|
477
|
+
ar.call(e, r) && !lr.hasOwnProperty(r) && (i[r] = e[r]);
|
|
474
478
|
if (t && t.defaultProps)
|
|
475
|
-
for (
|
|
476
|
-
r
|
|
477
|
-
return { $$typeof:
|
|
479
|
+
for (r in e = t.defaultProps, e)
|
|
480
|
+
i[r] === void 0 && (i[r] = e[r]);
|
|
481
|
+
return { $$typeof: sr, type: t, key: s, ref: o, props: i, _owner: cr.current };
|
|
478
482
|
}
|
|
479
|
-
He.Fragment =
|
|
480
|
-
He.jsx =
|
|
481
|
-
He.jsxs =
|
|
482
|
-
|
|
483
|
-
var d =
|
|
483
|
+
He.Fragment = or;
|
|
484
|
+
He.jsx = $t;
|
|
485
|
+
He.jsxs = $t;
|
|
486
|
+
Ht.exports = He;
|
|
487
|
+
var d = Ht.exports, P = function() {
|
|
484
488
|
return P = Object.assign || function(t) {
|
|
485
|
-
for (var e, n = 1,
|
|
489
|
+
for (var e, n = 1, r = arguments.length; n < r; n++) {
|
|
486
490
|
e = arguments[n];
|
|
487
|
-
for (var
|
|
488
|
-
Object.prototype.hasOwnProperty.call(e,
|
|
491
|
+
for (var i in e)
|
|
492
|
+
Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
|
|
489
493
|
}
|
|
490
494
|
return t;
|
|
491
495
|
}, P.apply(this, arguments);
|
|
492
|
-
},
|
|
496
|
+
}, dr = function(t, e) {
|
|
493
497
|
var n = {};
|
|
494
|
-
for (var
|
|
495
|
-
Object.prototype.hasOwnProperty.call(t,
|
|
498
|
+
for (var r in t)
|
|
499
|
+
Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
|
|
496
500
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
497
|
-
for (var
|
|
498
|
-
e.indexOf(i
|
|
501
|
+
for (var i = 0, r = Object.getOwnPropertySymbols(t); i < r.length; i++)
|
|
502
|
+
e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[i]) && (n[r[i]] = t[r[i]]);
|
|
499
503
|
return n;
|
|
500
|
-
},
|
|
501
|
-
var n = t.icon,
|
|
502
|
-
return
|
|
504
|
+
}, z = W(function(t, e) {
|
|
505
|
+
var n = t.icon, r = t.id, i = t.className, s = t.extend, o = dr(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(r, " ").concat(i || "").trim(), a = Tt("_".concat(hr()));
|
|
506
|
+
return Nt(n, "".concat(r), { defIds: n.defIds, idSuffix: a.current }, P({ ref: e, className: c }, o), s);
|
|
503
507
|
});
|
|
504
|
-
function
|
|
505
|
-
return
|
|
506
|
-
return
|
|
508
|
+
function Nt(t, e, n, r, i) {
|
|
509
|
+
return Z(t.tag, P(P({ key: e }, ur(t, n, i)), r), (pr(t, n).children || []).map(function(s, o) {
|
|
510
|
+
return Nt(s, "".concat(e, "-").concat(t.tag, "-").concat(o), n, void 0, i);
|
|
507
511
|
}));
|
|
508
512
|
}
|
|
509
|
-
function
|
|
510
|
-
var
|
|
511
|
-
n != null && n.colorChannel1 &&
|
|
512
|
-
var
|
|
513
|
-
return !
|
|
513
|
+
function ur(t, e, n) {
|
|
514
|
+
var r = P({}, t.attrs);
|
|
515
|
+
n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1);
|
|
516
|
+
var i = e.defIds;
|
|
517
|
+
return !i || i.length === 0 || (t.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(s) {
|
|
514
518
|
var o = s[0], c = s[1];
|
|
515
|
-
typeof c == "string" && (
|
|
516
|
-
})),
|
|
519
|
+
typeof c == "string" && (r[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
520
|
+
})), r;
|
|
517
521
|
}
|
|
518
|
-
function
|
|
519
|
-
var n,
|
|
520
|
-
return !
|
|
521
|
-
return typeof
|
|
522
|
+
function pr(t, e) {
|
|
523
|
+
var n, r = e.defIds;
|
|
524
|
+
return !r || r.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? P(P({}, t), { children: t.children.map(function(i) {
|
|
525
|
+
return typeof i.attrs.id == "string" && r && r.indexOf(i.attrs.id) > -1 ? P(P({}, i), { attrs: P(P({}, i.attrs), { id: i.attrs.id + e.idSuffix }) }) : i;
|
|
522
526
|
}) }) : t;
|
|
523
527
|
}
|
|
524
|
-
function
|
|
528
|
+
function hr() {
|
|
525
529
|
return Math.random().toString(36).substring(2, 8);
|
|
526
530
|
}
|
|
527
|
-
|
|
528
|
-
var
|
|
529
|
-
return z
|
|
531
|
+
z.displayName = "UniverIcon";
|
|
532
|
+
var gr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.9999 1.12915C8.03875 1.12915 8.07673 1.13284 8.11352 1.13989H12.2599C13.6958 1.13989 14.8599 2.30395 14.8599 3.73989V7.88619C14.867 7.92301 14.8707 7.96102 14.8707 7.9999C14.8707 8.03878 14.867 8.0768 14.8599 8.11362V12.2599C14.8599 13.6958 13.6958 14.8599 12.2599 14.8599H8.11362C8.0768 14.867 8.03878 14.8707 7.9999 14.8707C7.96102 14.8707 7.92301 14.867 7.88619 14.8599H3.73989C2.30396 14.8599 1.13989 13.6958 1.13989 12.2599V8.11352C1.13284 8.07673 1.12915 8.03875 1.12915 7.9999C1.12915 7.96106 1.13284 7.92308 1.13989 7.88629V3.73989C1.13989 2.30396 2.30395 1.13989 3.73989 1.13989H7.88629C7.92308 1.13284 7.96106 1.12915 7.9999 1.12915ZM2.33989 8.5999V12.2599C2.33989 13.0331 2.9667 13.6599 3.73989 13.6599H7.3999V8.5999H2.33989ZM7.3999 7.3999H2.33989V3.73989C2.33989 2.9667 2.96669 2.33989 3.73989 2.33989H7.3999V7.3999ZM8.5999 8.5999V13.6599H12.2599C13.0331 13.6599 13.6599 13.0331 13.6599 12.2599V8.5999H8.5999ZM13.6599 7.3999H8.5999V2.33989H12.2599C13.0331 2.33989 13.6599 2.96669 13.6599 3.73989V7.3999Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Dt = W(function(t, e) {
|
|
533
|
+
return Z(z, Object.assign({}, t, {
|
|
530
534
|
id: "all-border-single",
|
|
531
535
|
ref: e,
|
|
532
|
-
icon:
|
|
536
|
+
icon: gr
|
|
533
537
|
}));
|
|
534
538
|
});
|
|
535
|
-
|
|
536
|
-
const ze =
|
|
537
|
-
var
|
|
538
|
-
return z
|
|
539
|
+
Dt.displayName = "AllBorderSingle";
|
|
540
|
+
const ze = Dt;
|
|
541
|
+
var mr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.02547 12.4251C5.15328 13.7417 6.26305 14.7708 7.61318 14.7708H12.6132C14.0491 14.7708 15.2132 13.6067 15.2132 12.1708V6.1708C15.2132 4.78586 14.1303 3.65383 12.7651 3.57517C12.6373 2.25858 11.5275 1.22949 10.1774 1.22949H5.17739C3.74145 1.22949 2.57739 2.39355 2.57739 3.82949V9.82949C2.57739 11.2144 3.66024 12.3465 5.02547 12.4251ZM11.5535 3.5708H7.61318C6.17724 3.5708 5.01318 4.73486 5.01318 6.1708V11.22C4.31736 11.1387 3.77739 10.5471 3.77739 9.82949V3.82949C3.77739 3.05629 4.40419 2.42949 5.17739 2.42949H10.1774C10.8622 2.42949 11.4322 2.92119 11.5535 3.5708ZM14.0132 6.1708C14.0132 5.3976 13.3864 4.7708 12.6132 4.7708H7.61318C6.83998 4.7708 6.21318 5.3976 6.21318 6.1708V12.1708C6.21318 12.944 6.83998 13.5708 7.61318 13.5708H12.6132C13.3864 13.5708 14.0132 12.944 14.0132 12.1708V6.1708Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, At = W(function(t, e) {
|
|
542
|
+
return Z(z, Object.assign({}, t, {
|
|
539
543
|
id: "copy-single",
|
|
540
544
|
ref: e,
|
|
541
|
-
icon:
|
|
545
|
+
icon: mr
|
|
542
546
|
}));
|
|
543
547
|
});
|
|
544
|
-
|
|
545
|
-
const
|
|
546
|
-
var
|
|
547
|
-
return z
|
|
548
|
+
At.displayName = "CopySingle";
|
|
549
|
+
const fr = At;
|
|
550
|
+
var _r = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.9564 2.91332C4.91407 1.87102 3.22413 1.87101 2.18182 2.91333L2.18182 2.91333C1.13953 3.95567 1.13952 5.6456 2.18182 6.68791L8.27777 12.7838C9.72408 14.2302 12.069 14.2302 13.5154 12.7839L13.0911 12.3596L13.5154 12.7839C14.9617 11.3375 14.9617 8.99257 13.5154 7.54626L8.39476 2.42566C8.16044 2.19134 7.78054 2.19134 7.54623 2.42566C7.31191 2.65997 7.31191 3.03987 7.54623 3.27419L12.6668 8.39479L13.0911 7.97052L12.6668 8.39479C13.6445 9.37247 13.6445 10.9576 12.6668 11.9353L13.0399 12.3084L12.6668 11.9353C11.6891 12.913 10.104 12.913 9.1263 11.9353L3.03035 5.83938C2.45668 5.26571 2.45667 4.33556 3.03036 3.76184C3.60403 3.18818 4.53416 3.18817 5.10788 3.76185C5.10788 3.76186 5.10788 3.76186 5.10789 3.76186L11.2038 9.8578L11.601 9.46061L11.2038 9.8578C11.3735 10.0275 11.3735 10.3026 11.2038 10.4723L11.2038 10.4723C11.0341 10.642 10.759 10.642 10.5893 10.4723L5.46874 5.35171C5.23442 5.1174 4.85452 5.1174 4.62021 5.35171C4.38589 5.58602 4.38589 5.96592 4.62021 6.20024L9.74078 11.3208C10.3791 11.9591 11.414 11.9591 12.0523 11.3208C12.0523 11.3208 12.0523 11.3208 12.0523 11.3208M12.0523 11.3208C12.6907 10.6825 12.6906 9.64757 12.0523 9.00927L5.95641 2.91333L5.9564 2.91332", fillRule: "evenodd", clipRule: "evenodd" } }] }, we = W(function(t, e) {
|
|
551
|
+
return Z(z, Object.assign({}, t, {
|
|
548
552
|
id: "link-single",
|
|
549
553
|
ref: e,
|
|
550
|
-
icon:
|
|
554
|
+
icon: _r
|
|
551
555
|
}));
|
|
552
556
|
});
|
|
553
|
-
|
|
554
|
-
var
|
|
555
|
-
return z
|
|
557
|
+
we.displayName = "LinkSingle";
|
|
558
|
+
var vr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 17", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.5935 3.47302C11.6354 2.51492 10.082 2.51492 9.12388 3.47302L7.83534 4.76157C7.60102 4.99588 7.22112 4.99588 6.98681 4.76157 6.75249 4.52725 6.75249 4.14735 6.98681 3.91304L8.27535 2.62449C9.70209 1.19776 12.0153 1.19776 13.442 2.62449 14.8688 4.05123 14.8688 6.36442 13.442 7.79116L12.1535 9.0797C11.9192 9.31402 11.5393 9.31402 11.3049 9.0797 11.0706 8.84539 11.0706 8.46549 11.3049 8.23117L12.5935 6.94263C13.5516 5.98452 13.5516 4.43113 12.5935 3.47302zM3.40637 12.6606C2.44827 11.7025 2.44827 10.1491 3.40637 9.19102L4.69492 7.90248C4.92923 7.66816 4.92923 7.28826 4.69492 7.05395 4.4606 6.81963 4.0807 6.81963 3.84639 7.05395L2.55784 8.34249C1.13111 9.76923 1.13111 12.0824 2.55784 13.5092 3.98458 14.9359 6.29777 14.9359 7.72451 13.5092L9.01305 12.2206C9.24737 11.9863 9.24737 11.6064 9.01305 11.3721 8.77874 11.1378 8.39884 11.1378 8.16452 11.3721L6.87598 12.6606C5.91787 13.6187 4.36448 13.6187 3.40637 12.6606zM3.5852 2.80332C3.35088 2.569 2.97098 2.569 2.73667 2.80332 2.50235 3.03763 2.50235 3.41753 2.73667 3.65185L12.4151 13.3302C12.6494 13.5646 13.0293 13.5646 13.2636 13.3302 13.4979 13.0959 13.4979 12.716 13.2636 12.4817L3.5852 2.80332z" } }] }, Bt = W(function(t, e) {
|
|
559
|
+
return Z(z, Object.assign({}, t, {
|
|
556
560
|
id: "unlink-single",
|
|
557
561
|
ref: e,
|
|
558
|
-
icon:
|
|
562
|
+
icon: vr
|
|
559
563
|
}));
|
|
560
564
|
});
|
|
561
|
-
|
|
562
|
-
const
|
|
563
|
-
var
|
|
564
|
-
return z
|
|
565
|
+
Bt.displayName = "UnlinkSingle";
|
|
566
|
+
const yr = Bt;
|
|
567
|
+
var Sr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.6551 1.98906C11.7476 1.08113 10.2757 1.08149 9.3686 1.98987L4.82542 6.53955C4.75087 6.61421 4.69336 6.70411 4.65682 6.80309L3.2461 10.625C3.16506 10.8446 3.21909 11.0912 3.3845 11.2568C3.54991 11.4224 3.79651 11.4767 4.01616 11.3959L7.85031 9.98517C7.94979 9.94856 8.04014 9.89077 8.11508 9.81579L12.6552 5.27327C13.5618 4.36621 13.5618 2.89607 12.6551 1.98906ZM10.2177 2.83779C10.6562 2.39869 11.3677 2.39851 11.8064 2.8374C12.2447 3.27584 12.2447 3.9865 11.8065 4.42497L7.3392 8.89457L4.82213 9.82068L5.74706 7.31487L10.2177 2.83779Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.79238 13.2999C1.46101 13.2999 1.19238 13.5685 1.19238 13.8999C1.19238 14.2313 1.46101 14.4999 1.79238 14.4999H14.4924C14.8238 14.4999 15.0924 14.2313 15.0924 13.8999C15.0924 13.5685 14.8238 13.2999 14.4924 13.2999H1.79238Z" } }] }, Vt = W(function(t, e) {
|
|
568
|
+
return Z(z, Object.assign({}, t, {
|
|
565
569
|
id: "write-single",
|
|
566
570
|
ref: e,
|
|
567
|
-
icon:
|
|
571
|
+
icon: Sr
|
|
568
572
|
}));
|
|
569
573
|
});
|
|
570
|
-
|
|
571
|
-
const
|
|
572
|
-
var
|
|
573
|
-
return z
|
|
574
|
+
Vt.displayName = "WriteSingle";
|
|
575
|
+
const Cr = Vt;
|
|
576
|
+
var Lr = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "#35BD4B", d: "M3.36396 1.12549C2.61066 1.12549 2 1.73615 2 2.48945V13.5104C2 14.2637 2.61066 14.8744 3.36396 14.8744H12.457C13.2103 14.8744 13.821 14.2637 13.821 13.5104V5.0992L9.91954 1.12549H3.36396Z" } }, { tag: "path", attrs: { fill: "#32A846", d: "M9.91797 1.12549L13.8209 5.09842H10.5846C10.2164 5.09842 9.91797 4.79994 9.91797 4.43175V1.12549Z" } }, { tag: "path", attrs: { fill: "#fff", d: "M7.71926 10.2949L6.28687 12.403C6.17306 12.5705 5.94501 12.614 5.77751 12.5002C5.61002 12.3864 5.56649 12.1584 5.6803 11.9909L7.27596 9.64252L5.85088 7.54519C5.73707 7.37769 5.78059 7.14964 5.94809 7.03583C6.11558 6.92202 6.34363 6.96555 6.45744 7.13304L7.71926 8.9901L8.98108 7.13304C9.09489 6.96555 9.32294 6.92202 9.49044 7.03583C9.65793 7.14964 9.70146 7.37769 9.58765 7.54519L8.16256 9.64252L9.75822 11.9909C9.87203 12.1584 9.82851 12.3864 9.66101 12.5002C9.49351 12.614 9.26547 12.5705 9.15166 12.403L7.71926 10.2949Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Ft = W(function(t, e) {
|
|
577
|
+
return Z(z, Object.assign({}, t, {
|
|
574
578
|
id: "xlsx",
|
|
575
579
|
ref: e,
|
|
576
|
-
icon:
|
|
580
|
+
icon: Lr
|
|
577
581
|
}));
|
|
578
582
|
});
|
|
579
|
-
|
|
580
|
-
const
|
|
583
|
+
Ft.displayName = "Xlsx";
|
|
584
|
+
const mt = Ft, Ir = /[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi, kr = new RegExp(Ir);
|
|
581
585
|
function le(t) {
|
|
582
|
-
return t.startsWith("http://localhost:3002") || t.startsWith("localhost:3002") ? !0 : !!t.match(
|
|
586
|
+
return t.startsWith("http://localhost:3002") || t.startsWith("localhost:3002") ? !0 : !!t.match(kr);
|
|
583
587
|
}
|
|
584
|
-
function
|
|
588
|
+
function Wt(t) {
|
|
585
589
|
return /^[a-zA-Z]+:\/\//.test(t);
|
|
586
590
|
}
|
|
587
|
-
function
|
|
591
|
+
function br(t) {
|
|
588
592
|
return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(t);
|
|
589
593
|
}
|
|
590
|
-
function
|
|
591
|
-
return le(t) ?
|
|
594
|
+
function Zt(t) {
|
|
595
|
+
return le(t) ? Wt(t) ? t : br(t) ? `mailto://${t}` : `http://${t}` : t;
|
|
592
596
|
}
|
|
593
|
-
const
|
|
594
|
-
cellLinkEditButtons:
|
|
597
|
+
const Rr = "univer-cell-link-edit-buttons", Pr = {
|
|
598
|
+
cellLinkEditButtons: Rr
|
|
595
599
|
};
|
|
596
|
-
function
|
|
600
|
+
function Or(t) {
|
|
597
601
|
if (t === null)
|
|
598
602
|
return "";
|
|
599
603
|
if (t != null && t.p) {
|
|
@@ -601,23 +605,23 @@ function Ir(t) {
|
|
|
601
605
|
if (e == null)
|
|
602
606
|
return "";
|
|
603
607
|
const n = e.dataStream;
|
|
604
|
-
return n.substring(n.length - 2, n.length) ===
|
|
608
|
+
return n.substring(n.length - 2, n.length) === sn ? n.substring(0, n.length - 2) : n;
|
|
605
609
|
}
|
|
606
610
|
return t == null ? void 0 : t.v;
|
|
607
611
|
}
|
|
608
|
-
const
|
|
612
|
+
const Ee = () => {
|
|
609
613
|
var ee;
|
|
610
|
-
const [t, e] = te(""), [n,
|
|
614
|
+
const [t, e] = te(""), [n, r] = te(""), [i, s] = te(
|
|
611
615
|
"link"
|
|
612
616
|
/* link */
|
|
613
|
-
), [o, c] = te(""), a = b(de), p = b(
|
|
614
|
-
|
|
617
|
+
), [o, c] = te(""), a = b(de), p = b(bt), h = b(J), _ = b($), l = En(_.currentEditing$), f = b(w), L = b(B), y = b(F), [S, I] = te(!1), v = Tt(!1);
|
|
618
|
+
Vn(() => {
|
|
615
619
|
var u, m, C;
|
|
616
620
|
if ((l == null ? void 0 : l.row) !== void 0 && l.column !== void 0) {
|
|
617
621
|
const k = f.getHyperLinkByLocation(l.unitId, l.subUnitId, l.row, l.column);
|
|
618
622
|
if (k) {
|
|
619
623
|
const Be = L.parseHyperLink(k.payload);
|
|
620
|
-
if (e(k.id),
|
|
624
|
+
if (e(k.id), r(k.display), Be.type === "outer") {
|
|
621
625
|
s(
|
|
622
626
|
"link"
|
|
623
627
|
/* link */
|
|
@@ -633,11 +637,11 @@ const Me = () => {
|
|
|
633
637
|
return;
|
|
634
638
|
}
|
|
635
639
|
if (A.range) {
|
|
636
|
-
const
|
|
640
|
+
const qt = A.gid && (C = (m = (u = h.getUnit(l.unitId)) == null ? void 0 : u.getSheetBySheetId(A.gid)) == null ? void 0 : m.getName()) != null ? C : "";
|
|
637
641
|
s(
|
|
638
642
|
"range"
|
|
639
643
|
/* range */
|
|
640
|
-
), c(
|
|
644
|
+
), c(kt(qt, ce(A.range).range));
|
|
641
645
|
return;
|
|
642
646
|
}
|
|
643
647
|
if (A.gid) {
|
|
@@ -649,19 +653,19 @@ const Me = () => {
|
|
|
649
653
|
}
|
|
650
654
|
}
|
|
651
655
|
}
|
|
652
|
-
const D = h.getUnit(l.unitId), De = D == null ? void 0 : D.getSheetBySheetId(l.subUnitId),
|
|
656
|
+
const D = h.getUnit(l.unitId), De = D == null ? void 0 : D.getSheetBySheetId(l.subUnitId), Xt = De == null ? void 0 : De.getCellRaw(l.row, l.column), Ae = Or(Xt);
|
|
653
657
|
s(
|
|
654
658
|
"link"
|
|
655
659
|
/* link */
|
|
656
|
-
), c(""),
|
|
660
|
+
), c(""), r((Ae != null ? Ae : "").toString()), e("");
|
|
657
661
|
return;
|
|
658
662
|
}
|
|
659
663
|
s(
|
|
660
664
|
"link"
|
|
661
665
|
/* link */
|
|
662
|
-
), c(""),
|
|
666
|
+
), c(""), r(""), e("");
|
|
663
667
|
}, [l, f, L, h]);
|
|
664
|
-
const
|
|
668
|
+
const K = Fn(() => o, [i]), N = [
|
|
665
669
|
{
|
|
666
670
|
label: a.t("hyperLink.form.link"),
|
|
667
671
|
value: "link"
|
|
@@ -682,114 +686,114 @@ const Me = () => {
|
|
|
682
686
|
value: "rangeid"
|
|
683
687
|
/* definedName */
|
|
684
688
|
}
|
|
685
|
-
], R = h.getCurrentUnitForType(
|
|
689
|
+
], R = h.getCurrentUnitForType(M.UNIVER_SHEET);
|
|
686
690
|
if (!R)
|
|
687
691
|
return;
|
|
688
|
-
const
|
|
692
|
+
const Y = R.getHiddenWorksheets(), V = R.getSheets().map((u) => ({ label: u.getName(), value: u.getSheetId() })).filter((u) => Y.indexOf(u.value) === -1), Q = Object.values((ee = p.getDefinedNameMap(R.getUnitId())) != null ? ee : {}).map((u) => ({
|
|
689
693
|
label: u.name,
|
|
690
694
|
value: u.id
|
|
691
695
|
})), ue = (u, m) => {
|
|
692
696
|
if (u === "link")
|
|
693
|
-
return
|
|
697
|
+
return Wt(m) ? m : `http://${m}`;
|
|
694
698
|
if (u === "range") {
|
|
695
699
|
const C = ce(m), k = R.getSheetBySheetName(C.sheetName);
|
|
696
700
|
if (k)
|
|
697
|
-
return `#gid=${k.getSheetId()}&range=${
|
|
701
|
+
return `#gid=${k.getSheetId()}&range=${fe(C.range)}`;
|
|
698
702
|
}
|
|
699
703
|
return `#${u}=${m}`;
|
|
700
704
|
}, Ne = async () => {
|
|
701
|
-
l && (t ? await y.executeCommand(
|
|
705
|
+
l && (t ? await y.executeCommand(It.id, {
|
|
702
706
|
unitId: l.unitId,
|
|
703
707
|
subUnitId: l.subUnitId,
|
|
704
708
|
id: t,
|
|
705
709
|
payload: {
|
|
706
710
|
display: n,
|
|
707
|
-
payload: ue(
|
|
711
|
+
payload: ue(i, o)
|
|
708
712
|
}
|
|
709
|
-
}) : await y.executeCommand(
|
|
713
|
+
}) : await y.executeCommand(it.id, {
|
|
710
714
|
unitId: l.unitId,
|
|
711
715
|
subUnitId: l.subUnitId,
|
|
712
716
|
link: {
|
|
713
717
|
id: ae.generateRandomId(),
|
|
714
718
|
row: l.row,
|
|
715
719
|
column: l.column,
|
|
716
|
-
payload: ue(
|
|
720
|
+
payload: ue(i, o),
|
|
717
721
|
display: n
|
|
718
722
|
}
|
|
719
|
-
})), l && (await y.executeCommand(
|
|
723
|
+
})), l && (await y.executeCommand(Pe.id, {
|
|
720
724
|
unitId: l.unitId,
|
|
721
725
|
subUnitId: l.subUnitId
|
|
722
|
-
}), await y.executeCommand(
|
|
726
|
+
}), await y.executeCommand(Rt.id, {
|
|
723
727
|
range: {
|
|
724
728
|
startRow: l.row,
|
|
725
729
|
endRow: l.row,
|
|
726
730
|
startColumn: l.column,
|
|
727
731
|
endColumn: l.column
|
|
728
732
|
}
|
|
729
|
-
})), y.executeCommand(
|
|
733
|
+
})), y.executeCommand(Me.id);
|
|
730
734
|
};
|
|
731
735
|
return /* @__PURE__ */ d.jsxs("div", { children: [
|
|
732
736
|
/* @__PURE__ */ d.jsx(
|
|
733
|
-
|
|
737
|
+
G,
|
|
734
738
|
{
|
|
735
739
|
label: a.t("hyperLink.form.label"),
|
|
736
740
|
error: S && !n ? a.t("hyperLink.form.inputError") : "",
|
|
737
741
|
children: /* @__PURE__ */ d.jsx(
|
|
738
|
-
|
|
742
|
+
ut,
|
|
739
743
|
{
|
|
740
744
|
value: n,
|
|
741
745
|
onChange: (u) => {
|
|
742
|
-
|
|
746
|
+
r(u), v.current = !1;
|
|
743
747
|
},
|
|
744
748
|
placeholder: a.t("hyperLink.form.labelPlaceholder")
|
|
745
749
|
}
|
|
746
750
|
)
|
|
747
751
|
}
|
|
748
752
|
),
|
|
749
|
-
/* @__PURE__ */ d.jsx(
|
|
753
|
+
/* @__PURE__ */ d.jsx(G, { label: a.t("hyperLink.form.type"), children: /* @__PURE__ */ d.jsx(
|
|
750
754
|
Ve,
|
|
751
755
|
{
|
|
752
756
|
options: N,
|
|
753
|
-
value:
|
|
757
|
+
value: i,
|
|
754
758
|
onChange: (u) => {
|
|
755
759
|
s(u), c("");
|
|
756
760
|
}
|
|
757
761
|
}
|
|
758
762
|
) }),
|
|
759
|
-
|
|
760
|
-
|
|
763
|
+
i === "link" && /* @__PURE__ */ d.jsx(
|
|
764
|
+
G,
|
|
761
765
|
{
|
|
762
766
|
error: S ? o ? le(o) ? "" : a.t("hyperLink.form.linkError") : a.t("hyperLink.form.inputError") : "",
|
|
763
767
|
children: /* @__PURE__ */ d.jsx(
|
|
764
|
-
|
|
768
|
+
ut,
|
|
765
769
|
{
|
|
766
770
|
value: o,
|
|
767
771
|
onChange: (u) => {
|
|
768
|
-
c(u), u && (
|
|
772
|
+
c(u), u && (v.current || !n) && (r(u), v.current = !0);
|
|
769
773
|
},
|
|
770
774
|
placeholder: a.t("hyperLink.form.linkPlaceholder")
|
|
771
775
|
}
|
|
772
776
|
)
|
|
773
777
|
}
|
|
774
778
|
),
|
|
775
|
-
|
|
776
|
-
|
|
779
|
+
i === "range" && /* @__PURE__ */ d.jsx(G, { error: S && !o ? a.t("hyperLink.form.inputError") : "", children: /* @__PURE__ */ d.jsx(
|
|
780
|
+
Mn,
|
|
777
781
|
{
|
|
778
782
|
openForSheetUnitId: R.getUnitId(),
|
|
779
|
-
id:
|
|
783
|
+
id: rn("hyper-link-edit"),
|
|
780
784
|
isSingleChoice: !0,
|
|
781
|
-
value:
|
|
785
|
+
value: K,
|
|
782
786
|
onChange: (u) => {
|
|
783
787
|
const m = u[0];
|
|
784
|
-
if (!m || !
|
|
788
|
+
if (!m || !Re(m.range))
|
|
785
789
|
return;
|
|
786
790
|
m.sheetName || (m.sheetName = R.getActiveSheet().getName());
|
|
787
|
-
const C =
|
|
788
|
-
c(C), C && (
|
|
791
|
+
const C = yn(m);
|
|
792
|
+
c(C), C && (v.current || !n) && (r(C), v.current = !0);
|
|
789
793
|
}
|
|
790
794
|
}
|
|
791
795
|
) }),
|
|
792
|
-
|
|
796
|
+
i === "gid" && /* @__PURE__ */ d.jsx(G, { error: S && !o ? a.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ d.jsx(
|
|
793
797
|
Ve,
|
|
794
798
|
{
|
|
795
799
|
options: V,
|
|
@@ -798,11 +802,11 @@ const Me = () => {
|
|
|
798
802
|
var C;
|
|
799
803
|
c(u);
|
|
800
804
|
const m = (C = V.find((k) => k.value === u)) == null ? void 0 : C.label;
|
|
801
|
-
m && (
|
|
805
|
+
m && (v.current || !n) && (r(m), v.current = !0);
|
|
802
806
|
}
|
|
803
807
|
}
|
|
804
808
|
) }),
|
|
805
|
-
|
|
809
|
+
i === "rangeid" && /* @__PURE__ */ d.jsx(G, { error: S && !o ? a.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ d.jsx(
|
|
806
810
|
Ve,
|
|
807
811
|
{
|
|
808
812
|
options: Q,
|
|
@@ -811,30 +815,30 @@ const Me = () => {
|
|
|
811
815
|
var C;
|
|
812
816
|
c(u);
|
|
813
817
|
const m = (C = Q.find((k) => k.value === u)) == null ? void 0 : C.label;
|
|
814
|
-
m && (
|
|
818
|
+
m && (v.current || !n) && (r(m), v.current = !0);
|
|
815
819
|
}
|
|
816
820
|
}
|
|
817
821
|
) }),
|
|
818
|
-
/* @__PURE__ */ d.jsxs("div", { className:
|
|
822
|
+
/* @__PURE__ */ d.jsxs("div", { className: Pr.cellLinkEditButtons, children: [
|
|
819
823
|
/* @__PURE__ */ d.jsx(
|
|
820
|
-
|
|
824
|
+
pt,
|
|
821
825
|
{
|
|
822
826
|
onClick: () => {
|
|
823
|
-
l && y.executeCommand(
|
|
827
|
+
l && y.executeCommand(Pe.id, {
|
|
824
828
|
unitId: l.unitId,
|
|
825
829
|
subUnitId: l.subUnitId
|
|
826
|
-
}), y.executeCommand(
|
|
830
|
+
}), y.executeCommand(Me.id);
|
|
827
831
|
},
|
|
828
832
|
children: a.t("hyperLink.form.cancel")
|
|
829
833
|
}
|
|
830
834
|
),
|
|
831
835
|
/* @__PURE__ */ d.jsx(
|
|
832
|
-
|
|
836
|
+
pt,
|
|
833
837
|
{
|
|
834
838
|
type: "primary",
|
|
835
839
|
style: { marginLeft: 8 },
|
|
836
840
|
onClick: async () => {
|
|
837
|
-
if (!n || !o ||
|
|
841
|
+
if (!n || !o || i === "link" && !le(o)) {
|
|
838
842
|
I(!0);
|
|
839
843
|
return;
|
|
840
844
|
}
|
|
@@ -846,151 +850,151 @@ const Me = () => {
|
|
|
846
850
|
] })
|
|
847
851
|
] });
|
|
848
852
|
};
|
|
849
|
-
|
|
850
|
-
const
|
|
851
|
-
type:
|
|
853
|
+
Ee.componentKey = "univer.sheet.cell-link-edit";
|
|
854
|
+
const ot = {
|
|
855
|
+
type: Te.OPERATION,
|
|
852
856
|
id: "sheet.operation.open-hyper-link-sidebar",
|
|
853
857
|
handler(t, e) {
|
|
854
858
|
if (!e)
|
|
855
859
|
return !1;
|
|
856
|
-
const { unitId: n, subUnitId:
|
|
860
|
+
const { unitId: n, subUnitId: r, row: i, column: s } = e, o = t.get(w), c = t.get(wt), a = t.get($), p = o.getHyperLinkByLocation(n, r, i, s);
|
|
857
861
|
return a.startEditing(e), c.open({
|
|
858
862
|
header: {
|
|
859
863
|
title: p ? "hyperLink.form.editTitle" : "hyperLink.form.addTitle"
|
|
860
864
|
},
|
|
861
865
|
children: {
|
|
862
|
-
label:
|
|
866
|
+
label: Ee.componentKey
|
|
863
867
|
}
|
|
864
868
|
}), !0;
|
|
865
869
|
}
|
|
866
|
-
},
|
|
867
|
-
type:
|
|
870
|
+
}, Me = {
|
|
871
|
+
type: Te.OPERATION,
|
|
868
872
|
id: "sheet.operation.close-hyper-link-sidebar",
|
|
869
873
|
handler(t) {
|
|
870
|
-
const e = t.get(
|
|
874
|
+
const e = t.get(wt), n = t.get($);
|
|
871
875
|
return e.close(), n.endEditing(), !0;
|
|
872
876
|
}
|
|
873
877
|
}, $e = {
|
|
874
|
-
type:
|
|
878
|
+
type: Te.OPERATION,
|
|
875
879
|
id: "sheet.operation.insert-hyper-link",
|
|
876
880
|
handler(t) {
|
|
877
|
-
const e = t.get(
|
|
881
|
+
const e = t.get(J), n = Ct(e);
|
|
878
882
|
if (!n)
|
|
879
883
|
return !1;
|
|
880
|
-
const
|
|
884
|
+
const r = t.get(F), s = t.get(Lt).getFirst();
|
|
881
885
|
if (!(s != null && s.primary))
|
|
882
886
|
return !1;
|
|
883
887
|
const o = s.primary.actualRow, c = s.primary.actualColumn;
|
|
884
|
-
return
|
|
888
|
+
return r.executeCommand(ot.id, {
|
|
885
889
|
unitId: n.unitId,
|
|
886
890
|
subUnitId: n.subUnitId,
|
|
887
891
|
row: o,
|
|
888
892
|
column: c
|
|
889
893
|
});
|
|
890
894
|
}
|
|
891
|
-
},
|
|
892
|
-
type:
|
|
895
|
+
}, zt = {
|
|
896
|
+
type: Te.OPERATION,
|
|
893
897
|
id: "sheet.operation.insert-hyper-link-toolbar",
|
|
894
898
|
handler(t) {
|
|
895
|
-
const e = t.get(
|
|
896
|
-
return t.get($).currentEditing ? e.executeCommand(
|
|
899
|
+
const e = t.get(F);
|
|
900
|
+
return t.get($).currentEditing ? e.executeCommand(Me.id) : e.executeCommand($e.id);
|
|
897
901
|
}
|
|
898
|
-
},
|
|
899
|
-
cellLink:
|
|
900
|
-
cellLinkType:
|
|
901
|
-
cellLinkContent:
|
|
902
|
-
cellLinkContentError:
|
|
903
|
-
cellLinkUrl:
|
|
904
|
-
cellLinkOperations:
|
|
905
|
-
cellLinkOperation:
|
|
906
|
-
cellLinkOperationError:
|
|
907
|
-
},
|
|
908
|
-
outer: /* @__PURE__ */ d.jsx(
|
|
909
|
-
link: /* @__PURE__ */ d.jsx(
|
|
910
|
-
sheet: /* @__PURE__ */ d.jsx(
|
|
902
|
+
}, wr = "univer-cell-link", Er = "univer-cell-link-type", Mr = "univer-cell-link-content", xr = "univer-cell-link-content-error", jr = "univer-cell-link-url", Tr = "univer-cell-link-operations", Ur = "univer-cell-link-operation", Hr = "univer-cell-link-operation-error", E = {
|
|
903
|
+
cellLink: wr,
|
|
904
|
+
cellLinkType: Er,
|
|
905
|
+
cellLinkContent: Mr,
|
|
906
|
+
cellLinkContentError: xr,
|
|
907
|
+
cellLinkUrl: jr,
|
|
908
|
+
cellLinkOperations: Tr,
|
|
909
|
+
cellLinkOperation: Ur,
|
|
910
|
+
cellLinkOperationError: Hr
|
|
911
|
+
}, $r = {
|
|
912
|
+
outer: /* @__PURE__ */ d.jsx(we, {}),
|
|
913
|
+
link: /* @__PURE__ */ d.jsx(we, {}),
|
|
914
|
+
sheet: /* @__PURE__ */ d.jsx(mt, {}),
|
|
911
915
|
range: /* @__PURE__ */ d.jsx(ze, {}),
|
|
912
916
|
defineName: /* @__PURE__ */ d.jsx(ze, {}),
|
|
913
917
|
"range-error": /* @__PURE__ */ d.jsx(ze, {}),
|
|
914
|
-
"sheet-error": /* @__PURE__ */ d.jsx(
|
|
915
|
-
},
|
|
916
|
-
const t = b($), e = b(
|
|
918
|
+
"sheet-error": /* @__PURE__ */ d.jsx(mt, {})
|
|
919
|
+
}, xe = () => {
|
|
920
|
+
const t = b($), e = b(w), n = b(F), r = b(Ot), i = b(de), s = Wn(t.currentPopup$, t.currentPopup), o = b(B);
|
|
917
921
|
if (!s)
|
|
918
922
|
return null;
|
|
919
923
|
const { unitId: c, subUnitId: a, id: p } = s, h = e.getHyperLink(c, a, p);
|
|
920
924
|
if (!h)
|
|
921
925
|
return null;
|
|
922
|
-
const
|
|
923
|
-
return /* @__PURE__ */ d.jsxs("div", { className:
|
|
924
|
-
/* @__PURE__ */ d.jsxs("div", { className:
|
|
925
|
-
/* @__PURE__ */ d.jsx("div", { className:
|
|
926
|
-
/* @__PURE__ */ d.jsx("div", { className:
|
|
926
|
+
const _ = o.parseHyperLink(h.payload), l = _.type.indexOf("error") > -1;
|
|
927
|
+
return /* @__PURE__ */ d.jsxs("div", { className: E.cellLink, onClick: () => t.hideCurrentPopup(), children: [
|
|
928
|
+
/* @__PURE__ */ d.jsxs("div", { className: gt(E.cellLinkContent, { [E.cellLinkContentError]: l }), onClick: _.handler, children: [
|
|
929
|
+
/* @__PURE__ */ d.jsx("div", { className: E.cellLinkType, children: $r[_.type] }),
|
|
930
|
+
/* @__PURE__ */ d.jsx("div", { className: E.cellLinkUrl, children: _.name })
|
|
927
931
|
] }),
|
|
928
|
-
/* @__PURE__ */ d.jsxs("div", { className:
|
|
932
|
+
/* @__PURE__ */ d.jsxs("div", { className: E.cellLinkOperations, children: [
|
|
929
933
|
/* @__PURE__ */ d.jsx(
|
|
930
934
|
"div",
|
|
931
935
|
{
|
|
932
|
-
className:
|
|
936
|
+
className: gt(E.cellLinkOperation, { [E.cellLinkOperationError]: l }),
|
|
933
937
|
onClick: () => {
|
|
934
938
|
if (!l) {
|
|
935
|
-
if (
|
|
939
|
+
if (_.type !== "outer") {
|
|
936
940
|
const f = new URL(window.location.href);
|
|
937
|
-
f.hash =
|
|
941
|
+
f.hash = _.url.slice(1), navigator.clipboard.writeText(f.href);
|
|
938
942
|
} else
|
|
939
|
-
navigator.clipboard.writeText(
|
|
940
|
-
|
|
941
|
-
content:
|
|
943
|
+
navigator.clipboard.writeText(_.url);
|
|
944
|
+
r.show({
|
|
945
|
+
content: i.t("hyperLink.message.coped"),
|
|
942
946
|
type: ie.Info
|
|
943
947
|
});
|
|
944
948
|
}
|
|
945
949
|
},
|
|
946
|
-
children: /* @__PURE__ */ d.jsx(Fe, { placement: "bottom", title:
|
|
950
|
+
children: /* @__PURE__ */ d.jsx(Fe, { placement: "bottom", title: i.t("hyperLink.popup.copy"), children: /* @__PURE__ */ d.jsx(fr, {}) })
|
|
947
951
|
}
|
|
948
952
|
),
|
|
949
953
|
/* @__PURE__ */ d.jsx(
|
|
950
954
|
"div",
|
|
951
955
|
{
|
|
952
|
-
className:
|
|
956
|
+
className: E.cellLinkOperation,
|
|
953
957
|
onClick: () => {
|
|
954
|
-
n.executeCommand(
|
|
958
|
+
n.executeCommand(ot.id, {
|
|
955
959
|
unitId: c,
|
|
956
960
|
subUnitId: a,
|
|
957
961
|
row: h.row,
|
|
958
962
|
column: h.column
|
|
959
963
|
});
|
|
960
964
|
},
|
|
961
|
-
children: /* @__PURE__ */ d.jsx(Fe, { placement: "bottom", title:
|
|
965
|
+
children: /* @__PURE__ */ d.jsx(Fe, { placement: "bottom", title: i.t("hyperLink.popup.edit"), children: /* @__PURE__ */ d.jsx(Cr, {}) })
|
|
962
966
|
}
|
|
963
967
|
),
|
|
964
968
|
/* @__PURE__ */ d.jsx(
|
|
965
969
|
"div",
|
|
966
970
|
{
|
|
967
|
-
className:
|
|
971
|
+
className: E.cellLinkOperation,
|
|
968
972
|
onClick: () => {
|
|
969
|
-
n.executeCommand(
|
|
973
|
+
n.executeCommand(_n.id, {
|
|
970
974
|
unitId: c,
|
|
971
975
|
subUnitId: a,
|
|
972
976
|
id: h.id
|
|
973
977
|
});
|
|
974
978
|
},
|
|
975
|
-
children: /* @__PURE__ */ d.jsx(Fe, { placement: "bottom", title:
|
|
979
|
+
children: /* @__PURE__ */ d.jsx(Fe, { placement: "bottom", title: i.t("hyperLink.popup.cancel"), children: /* @__PURE__ */ d.jsx(yr, {}) })
|
|
976
980
|
}
|
|
977
981
|
)
|
|
978
982
|
] })
|
|
979
983
|
] });
|
|
980
984
|
};
|
|
981
|
-
|
|
982
|
-
var
|
|
983
|
-
for (var
|
|
984
|
-
(o = t[s]) && (
|
|
985
|
-
return
|
|
986
|
-
},
|
|
985
|
+
xe.componentKey = "univer.sheet.cell-link-popup";
|
|
986
|
+
var Nr = Object.defineProperty, Dr = Object.getOwnPropertyDescriptor, Ar = (t, e, n, r) => {
|
|
987
|
+
for (var i = r > 1 ? void 0 : r ? Dr(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
988
|
+
(o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
|
|
989
|
+
return r && i && Nr(e, n, i), i;
|
|
990
|
+
}, ft = (t, e) => (n, r) => e(n, r, t);
|
|
987
991
|
let $ = class {
|
|
988
992
|
constructor(t, e) {
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
993
|
+
H(this, "_currentPopup", null);
|
|
994
|
+
H(this, "_currentPopup$", new Nn());
|
|
995
|
+
H(this, "currentPopup$", this._currentPopup$.asObservable());
|
|
996
|
+
H(this, "_currentEditing$", new Dn(null));
|
|
997
|
+
H(this, "currentEditing$", this._currentEditing$.asObservable());
|
|
994
998
|
this._hyperLinkModel = t, this._sheetCanvasPopManagerService = e;
|
|
995
999
|
}
|
|
996
1000
|
get currentPopup() {
|
|
@@ -1001,11 +1005,11 @@ let $ = class {
|
|
|
1001
1005
|
}
|
|
1002
1006
|
showPopup(t) {
|
|
1003
1007
|
this.hideCurrentPopup();
|
|
1004
|
-
const { unitId: e, subUnitId: n, row:
|
|
1008
|
+
const { unitId: e, subUnitId: n, row: r, col: i } = t, s = this._hyperLinkModel.getHyperLinkByLocation(e, n, r, i);
|
|
1005
1009
|
if (!s)
|
|
1006
1010
|
return;
|
|
1007
|
-
const o = this._sheetCanvasPopManagerService.attachPopupToCell(
|
|
1008
|
-
componentKey:
|
|
1011
|
+
const o = this._sheetCanvasPopManagerService.attachPopupToCell(r, i, {
|
|
1012
|
+
componentKey: xe.componentKey,
|
|
1009
1013
|
direction: "bottom",
|
|
1010
1014
|
closeOnSelfTarget: !0
|
|
1011
1015
|
});
|
|
@@ -1027,18 +1031,18 @@ let $ = class {
|
|
|
1027
1031
|
this._currentEditing$.next(null);
|
|
1028
1032
|
}
|
|
1029
1033
|
};
|
|
1030
|
-
$ =
|
|
1031
|
-
|
|
1032
|
-
|
|
1034
|
+
$ = Ar([
|
|
1035
|
+
ft(0, g(w)),
|
|
1036
|
+
ft(1, g(Cn))
|
|
1033
1037
|
], $);
|
|
1034
|
-
var
|
|
1035
|
-
for (var
|
|
1036
|
-
(o = t[s]) && (
|
|
1037
|
-
return
|
|
1038
|
-
}, re = (t, e) => (n,
|
|
1039
|
-
let
|
|
1040
|
-
constructor(t, e, n,
|
|
1041
|
-
super(), this._sheetInterceptorService = t, this._injector = e, this._hyperLinkModel = n, this._selectionManagerService =
|
|
1038
|
+
var Br = Object.defineProperty, Vr = Object.getOwnPropertyDescriptor, Fr = (t, e, n, r) => {
|
|
1039
|
+
for (var i = r > 1 ? void 0 : r ? Vr(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1040
|
+
(o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
|
|
1041
|
+
return r && i && Br(e, n, i), i;
|
|
1042
|
+
}, re = (t, e) => (n, r) => e(n, r, t);
|
|
1043
|
+
let Se = class extends O {
|
|
1044
|
+
constructor(t, e, n, r, i) {
|
|
1045
|
+
super(), this._sheetInterceptorService = t, this._injector = e, this._hyperLinkModel = n, this._selectionManagerService = r, this._univerInstanceService = i, this._initCommandInterceptor();
|
|
1042
1046
|
}
|
|
1043
1047
|
_initCommandInterceptor() {
|
|
1044
1048
|
this._initAddHyperLinkCommandInterceptor(), this._initSetRangeValuesCommandInterceptor(), this._initUpdateHyperLinkCommandInterceptor(), this._initClearSelectionCommandInterceptor();
|
|
@@ -1046,15 +1050,15 @@ let Ce = class extends T {
|
|
|
1046
1050
|
_initAddHyperLinkCommandInterceptor() {
|
|
1047
1051
|
this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
|
|
1048
1052
|
getMutations: (t) => {
|
|
1049
|
-
if (t.id ===
|
|
1050
|
-
const e = t.params, { unitId: n, subUnitId:
|
|
1053
|
+
if (t.id === it.id) {
|
|
1054
|
+
const e = t.params, { unitId: n, subUnitId: r, link: i } = e, s = {
|
|
1051
1055
|
unitId: n,
|
|
1052
|
-
subUnitId:
|
|
1056
|
+
subUnitId: r,
|
|
1053
1057
|
cellValue: {
|
|
1054
|
-
[
|
|
1055
|
-
[
|
|
1056
|
-
v:
|
|
1057
|
-
t:
|
|
1058
|
+
[i.row]: {
|
|
1059
|
+
[i.column]: {
|
|
1060
|
+
v: i.display,
|
|
1061
|
+
t: at.STRING,
|
|
1058
1062
|
p: null
|
|
1059
1063
|
}
|
|
1060
1064
|
}
|
|
@@ -1067,7 +1071,7 @@ let Ce = class extends T {
|
|
|
1067
1071
|
}],
|
|
1068
1072
|
undos: [{
|
|
1069
1073
|
id: pe.id,
|
|
1070
|
-
params:
|
|
1074
|
+
params: lt(this._injector, s)
|
|
1071
1075
|
}]
|
|
1072
1076
|
};
|
|
1073
1077
|
}
|
|
@@ -1081,17 +1085,17 @@ let Ce = class extends T {
|
|
|
1081
1085
|
_initUpdateHyperLinkCommandInterceptor() {
|
|
1082
1086
|
this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
|
|
1083
1087
|
getMutations: (t) => {
|
|
1084
|
-
if (t.id ===
|
|
1085
|
-
const e = t.params, { unitId: n, subUnitId:
|
|
1088
|
+
if (t.id === It.id) {
|
|
1089
|
+
const e = t.params, { unitId: n, subUnitId: r, id: i, payload: s } = e, o = this._hyperLinkModel.getHyperLink(n, r, i);
|
|
1086
1090
|
if (o && o.display !== s.display) {
|
|
1087
1091
|
const c = {
|
|
1088
1092
|
unitId: n,
|
|
1089
|
-
subUnitId:
|
|
1093
|
+
subUnitId: r,
|
|
1090
1094
|
cellValue: {
|
|
1091
1095
|
[o.row]: {
|
|
1092
1096
|
[o.column]: {
|
|
1093
1097
|
v: s.display,
|
|
1094
|
-
t:
|
|
1098
|
+
t: at.STRING,
|
|
1095
1099
|
p: null
|
|
1096
1100
|
}
|
|
1097
1101
|
}
|
|
@@ -1104,7 +1108,7 @@ let Ce = class extends T {
|
|
|
1104
1108
|
}],
|
|
1105
1109
|
undos: [{
|
|
1106
1110
|
id: pe.id,
|
|
1107
|
-
params:
|
|
1111
|
+
params: lt(this._injector, c)
|
|
1108
1112
|
}]
|
|
1109
1113
|
};
|
|
1110
1114
|
}
|
|
@@ -1121,32 +1125,32 @@ let Ce = class extends T {
|
|
|
1121
1125
|
this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
|
|
1122
1126
|
// eslint-disable-next-line max-lines-per-function
|
|
1123
1127
|
getMutations: (t) => {
|
|
1124
|
-
if (t.id ===
|
|
1125
|
-
const e = t.params, { unitId: n, subUnitId:
|
|
1126
|
-
return e.cellValue && new
|
|
1128
|
+
if (t.id === hn.id) {
|
|
1129
|
+
const e = t.params, { unitId: n, subUnitId: r } = e, i = [], s = [];
|
|
1130
|
+
return e.cellValue && new St(e.cellValue).forValue((o, c, a) => {
|
|
1127
1131
|
var f, L, y, S;
|
|
1128
|
-
const p = ((S = (y = a == null ? void 0 : a.v) != null ? y : (L = (f = a == null ? void 0 : a.p) == null ? void 0 : f.body) == null ? void 0 : L.dataStream.slice(0, -2)) != null ? S : "").toString(), h = this._hyperLinkModel.getHyperLinkByLocation(n,
|
|
1132
|
+
const p = ((S = (y = a == null ? void 0 : a.v) != null ? y : (L = (f = a == null ? void 0 : a.p) == null ? void 0 : f.body) == null ? void 0 : L.dataStream.slice(0, -2)) != null ? S : "").toString(), h = this._hyperLinkModel.getHyperLinkByLocation(n, r, o, c);
|
|
1129
1133
|
if (!h) {
|
|
1130
1134
|
if (le(p)) {
|
|
1131
1135
|
const I = ae.generateRandomId();
|
|
1132
1136
|
s.push({
|
|
1133
|
-
id:
|
|
1137
|
+
id: x.id,
|
|
1134
1138
|
params: {
|
|
1135
1139
|
unitId: n,
|
|
1136
|
-
subUnitId:
|
|
1140
|
+
subUnitId: r,
|
|
1137
1141
|
id: I
|
|
1138
1142
|
}
|
|
1139
|
-
}),
|
|
1140
|
-
id:
|
|
1143
|
+
}), i.push({
|
|
1144
|
+
id: j.id,
|
|
1141
1145
|
params: {
|
|
1142
1146
|
unitId: n,
|
|
1143
|
-
subUnitId:
|
|
1147
|
+
subUnitId: r,
|
|
1144
1148
|
link: {
|
|
1145
1149
|
id: I,
|
|
1146
1150
|
row: o,
|
|
1147
1151
|
column: c,
|
|
1148
1152
|
display: p,
|
|
1149
|
-
payload:
|
|
1153
|
+
payload: Zt(p)
|
|
1150
1154
|
}
|
|
1151
1155
|
}
|
|
1152
1156
|
});
|
|
@@ -1155,24 +1159,24 @@ let Ce = class extends T {
|
|
|
1155
1159
|
}
|
|
1156
1160
|
if (h.display === p)
|
|
1157
1161
|
return;
|
|
1158
|
-
p || (
|
|
1159
|
-
id:
|
|
1162
|
+
p || (i.push({
|
|
1163
|
+
id: x.id,
|
|
1160
1164
|
params: {
|
|
1161
1165
|
unitId: n,
|
|
1162
|
-
subUnitId:
|
|
1166
|
+
subUnitId: r,
|
|
1163
1167
|
id: h.id
|
|
1164
1168
|
}
|
|
1165
1169
|
}), s.push({
|
|
1166
|
-
id:
|
|
1170
|
+
id: j.id,
|
|
1167
1171
|
params: {
|
|
1168
1172
|
unitId: n,
|
|
1169
|
-
subUnitId:
|
|
1173
|
+
subUnitId: r,
|
|
1170
1174
|
link: h
|
|
1171
1175
|
}
|
|
1172
1176
|
}));
|
|
1173
|
-
const
|
|
1177
|
+
const _ = {
|
|
1174
1178
|
unitId: n,
|
|
1175
|
-
subUnitId:
|
|
1179
|
+
subUnitId: r,
|
|
1176
1180
|
id: h.id,
|
|
1177
1181
|
payload: {
|
|
1178
1182
|
payload: h.payload,
|
|
@@ -1180,23 +1184,23 @@ let Ce = class extends T {
|
|
|
1180
1184
|
}
|
|
1181
1185
|
}, l = {
|
|
1182
1186
|
unitId: n,
|
|
1183
|
-
subUnitId:
|
|
1187
|
+
subUnitId: r,
|
|
1184
1188
|
id: h.id,
|
|
1185
1189
|
payload: {
|
|
1186
1190
|
payload: h.payload,
|
|
1187
1191
|
display: h.display
|
|
1188
1192
|
}
|
|
1189
1193
|
};
|
|
1190
|
-
|
|
1191
|
-
id:
|
|
1192
|
-
params:
|
|
1194
|
+
i.push({
|
|
1195
|
+
id: Oe.id,
|
|
1196
|
+
params: _
|
|
1193
1197
|
}), s.push({
|
|
1194
|
-
id:
|
|
1198
|
+
id: Oe.id,
|
|
1195
1199
|
params: l
|
|
1196
1200
|
});
|
|
1197
1201
|
}), {
|
|
1198
1202
|
undos: s,
|
|
1199
|
-
redos:
|
|
1203
|
+
redos: i
|
|
1200
1204
|
};
|
|
1201
1205
|
}
|
|
1202
1206
|
return {
|
|
@@ -1209,21 +1213,21 @@ let Ce = class extends T {
|
|
|
1209
1213
|
_initClearSelectionCommandInterceptor() {
|
|
1210
1214
|
this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
|
|
1211
1215
|
getMutations: (t) => {
|
|
1212
|
-
if (t.id ===
|
|
1213
|
-
const e = [], n = [],
|
|
1214
|
-
if (
|
|
1215
|
-
const { unitId: s, subUnitId: o } =
|
|
1216
|
-
|
|
1216
|
+
if (t.id === gn.id || t.id === mn.id) {
|
|
1217
|
+
const e = [], n = [], r = this._selectionManagerService.getFirst(), i = Ct(this._univerInstanceService);
|
|
1218
|
+
if (r && i) {
|
|
1219
|
+
const { unitId: s, subUnitId: o } = i;
|
|
1220
|
+
qe.foreach(r.range, (c, a) => {
|
|
1217
1221
|
const p = this._hyperLinkModel.getHyperLinkByLocation(s, o, c, a);
|
|
1218
1222
|
p && (e.push({
|
|
1219
|
-
id:
|
|
1223
|
+
id: x.id,
|
|
1220
1224
|
params: {
|
|
1221
1225
|
unitId: s,
|
|
1222
1226
|
subUnitId: o,
|
|
1223
1227
|
id: p.id
|
|
1224
1228
|
}
|
|
1225
1229
|
}), n.push({
|
|
1226
|
-
id:
|
|
1230
|
+
id: j.id,
|
|
1227
1231
|
params: {
|
|
1228
1232
|
unitId: s,
|
|
1229
1233
|
subUnitId: o,
|
|
@@ -1245,26 +1249,26 @@ let Ce = class extends T {
|
|
|
1245
1249
|
}));
|
|
1246
1250
|
}
|
|
1247
1251
|
};
|
|
1248
|
-
|
|
1249
|
-
U
|
|
1250
|
-
re(0, g(
|
|
1251
|
-
re(1, g(
|
|
1252
|
-
re(2, g(
|
|
1253
|
-
re(3, g(
|
|
1254
|
-
re(4,
|
|
1255
|
-
],
|
|
1256
|
-
var
|
|
1257
|
-
for (var
|
|
1258
|
-
(o = t[s]) && (
|
|
1259
|
-
return
|
|
1260
|
-
},
|
|
1261
|
-
let
|
|
1252
|
+
Se = Fr([
|
|
1253
|
+
T(U.Starting, Se),
|
|
1254
|
+
re(0, g(Je)),
|
|
1255
|
+
re(1, g(Ue)),
|
|
1256
|
+
re(2, g(w)),
|
|
1257
|
+
re(3, g(Lt)),
|
|
1258
|
+
re(4, J)
|
|
1259
|
+
], Se);
|
|
1260
|
+
var Wr = Object.defineProperty, Zr = Object.getOwnPropertyDescriptor, zr = (t, e, n, r) => {
|
|
1261
|
+
for (var i = r > 1 ? void 0 : r ? Zr(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1262
|
+
(o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
|
|
1263
|
+
return r && i && Wr(e, n, i), i;
|
|
1264
|
+
}, _t = (t, e) => (n, r) => e(n, r, t);
|
|
1265
|
+
let Ce = class extends O {
|
|
1262
1266
|
constructor(t, e) {
|
|
1263
1267
|
super(), this._hoverManagerService = t, this._sheetsHyperLinkPopupService = e, this._initHoverListener();
|
|
1264
1268
|
}
|
|
1265
1269
|
_initHoverListener() {
|
|
1266
1270
|
this.disposeWithMe(
|
|
1267
|
-
this._hoverManagerService.currentCell$.pipe(
|
|
1271
|
+
this._hoverManagerService.currentCell$.pipe(An(100)).subscribe((t) => {
|
|
1268
1272
|
if (!t) {
|
|
1269
1273
|
this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
1270
1274
|
return;
|
|
@@ -1274,135 +1278,135 @@ let Le = class extends T {
|
|
|
1274
1278
|
);
|
|
1275
1279
|
}
|
|
1276
1280
|
};
|
|
1277
|
-
|
|
1278
|
-
U
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
],
|
|
1282
|
-
const
|
|
1281
|
+
Ce = zr([
|
|
1282
|
+
T(U.Rendered, Ce),
|
|
1283
|
+
_t(0, g(Ln)),
|
|
1284
|
+
_t(1, g($))
|
|
1285
|
+
], Ce);
|
|
1286
|
+
const Kr = (t) => ({
|
|
1283
1287
|
id: $e.id,
|
|
1284
|
-
type:
|
|
1285
|
-
positions: [
|
|
1288
|
+
type: Et.BUTTON,
|
|
1289
|
+
positions: [Mt.CONTEXT_MENU],
|
|
1286
1290
|
title: "hyperLink.menu.add",
|
|
1287
|
-
hidden$:
|
|
1291
|
+
hidden$: xt(t, M.UNIVER_SHEET),
|
|
1288
1292
|
icon: "LinkSingle",
|
|
1289
|
-
disabled$:
|
|
1290
|
-
}),
|
|
1293
|
+
disabled$: Pt(t, { workbookTypes: [Qe], worksheetTypes: [et, tt, nt], rangeTypes: [rt] })
|
|
1294
|
+
}), Yr = (t) => ({
|
|
1291
1295
|
tooltip: "hyperLink.form.addTitle",
|
|
1292
|
-
positions:
|
|
1293
|
-
group:
|
|
1294
|
-
id:
|
|
1295
|
-
type:
|
|
1296
|
+
positions: Mt.TOOLBAR_START,
|
|
1297
|
+
group: Tn.TOOLBAR_OTHERS,
|
|
1298
|
+
id: zt.id,
|
|
1299
|
+
type: Et.BUTTON,
|
|
1296
1300
|
icon: "LinkSingle",
|
|
1297
|
-
hidden$:
|
|
1298
|
-
disabled$:
|
|
1299
|
-
}),
|
|
1301
|
+
hidden$: xt(t, M.UNIVER_SHEET),
|
|
1302
|
+
disabled$: Pt(t, { workbookTypes: [Qe], worksheetTypes: [et, tt, nt], rangeTypes: [rt] })
|
|
1303
|
+
}), Kt = {
|
|
1300
1304
|
id: $e.id,
|
|
1301
|
-
binding:
|
|
1302
|
-
preconditions:
|
|
1305
|
+
binding: xn.K | jn.CTRL_COMMAND,
|
|
1306
|
+
preconditions: In
|
|
1303
1307
|
};
|
|
1304
|
-
var
|
|
1305
|
-
for (var
|
|
1306
|
-
(o = t[s]) && (
|
|
1307
|
-
return
|
|
1308
|
-
},
|
|
1309
|
-
let se = class extends
|
|
1310
|
-
constructor(t, e, n,
|
|
1311
|
-
super(), this._config = t, this._componentManager = e, this._commandService = n, this._localeService =
|
|
1308
|
+
var Gr = Object.defineProperty, Xr = Object.getOwnPropertyDescriptor, qr = (t, e, n, r) => {
|
|
1309
|
+
for (var i = r > 1 ? void 0 : r ? Xr(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1310
|
+
(o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
|
|
1311
|
+
return r && i && Gr(e, n, i), i;
|
|
1312
|
+
}, X = (t, e) => (n, r) => e(n, r, t);
|
|
1313
|
+
let se = class extends O {
|
|
1314
|
+
constructor(t, e, n, r, i, s, o) {
|
|
1315
|
+
super(), this._config = t, this._componentManager = e, this._commandService = n, this._localeService = r, this._menuService = i, this._injector = s, this._shortcutService = o, this._initComponents(), this._initCommands(), this._initMenus(), this._initShortCut();
|
|
1312
1316
|
}
|
|
1313
1317
|
_initComponents() {
|
|
1314
1318
|
[
|
|
1315
|
-
[
|
|
1316
|
-
[
|
|
1317
|
-
[
|
|
1319
|
+
[xe, xe.componentKey],
|
|
1320
|
+
[Ee, Ee.componentKey],
|
|
1321
|
+
[we, "LinkSingle"]
|
|
1318
1322
|
].forEach(([t, e]) => {
|
|
1319
1323
|
this._componentManager.register(e, t);
|
|
1320
1324
|
});
|
|
1321
1325
|
}
|
|
1322
1326
|
_initCommands() {
|
|
1323
1327
|
[
|
|
1324
|
-
|
|
1325
|
-
|
|
1328
|
+
ot,
|
|
1329
|
+
Me,
|
|
1326
1330
|
$e,
|
|
1327
|
-
|
|
1331
|
+
zt
|
|
1328
1332
|
].forEach((t) => {
|
|
1329
1333
|
this._commandService.registerCommand(t);
|
|
1330
1334
|
});
|
|
1331
1335
|
}
|
|
1332
1336
|
_initMenus() {
|
|
1333
|
-
var t, e, n,
|
|
1334
|
-
this._menuService.addMenuItem(
|
|
1337
|
+
var t, e, n, r;
|
|
1338
|
+
this._menuService.addMenuItem(Kr(this._injector), (e = (t = this._config) == null ? void 0 : t.menu) != null ? e : {}), this._menuService.addMenuItem(Yr(this._injector), (r = (n = this._config) == null ? void 0 : n.menu) != null ? r : {});
|
|
1335
1339
|
}
|
|
1336
1340
|
_initShortCut() {
|
|
1337
|
-
this._shortcutService.registerShortcut(
|
|
1341
|
+
this._shortcutService.registerShortcut(Kt);
|
|
1338
1342
|
}
|
|
1339
1343
|
};
|
|
1340
|
-
se =
|
|
1341
|
-
U
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1344
|
+
se = qr([
|
|
1345
|
+
T(U.Ready, se),
|
|
1346
|
+
X(1, g(Un)),
|
|
1347
|
+
X(2, F),
|
|
1348
|
+
X(3, g(de)),
|
|
1349
|
+
X(4, $n),
|
|
1350
|
+
X(5, g(Ue)),
|
|
1351
|
+
X(6, g(Hn))
|
|
1348
1352
|
], se);
|
|
1349
|
-
var
|
|
1350
|
-
for (var
|
|
1351
|
-
(o = t[s]) && (
|
|
1352
|
-
return
|
|
1353
|
-
}, vt = (t, e) => (n,
|
|
1354
|
-
let
|
|
1353
|
+
var Jr = Object.defineProperty, Qr = Object.getOwnPropertyDescriptor, ei = (t, e, n, r) => {
|
|
1354
|
+
for (var i = r > 1 ? void 0 : r ? Qr(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1355
|
+
(o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
|
|
1356
|
+
return r && i && Jr(e, n, i), i;
|
|
1357
|
+
}, vt = (t, e) => (n, r) => e(n, r, t);
|
|
1358
|
+
let Le = class extends O {
|
|
1355
1359
|
constructor(t, e) {
|
|
1356
1360
|
super(), this._autoFillService = t, this._hyperLinkModel = e, this._initAutoFill();
|
|
1357
1361
|
}
|
|
1358
1362
|
// eslint-disable-next-line max-lines-per-function
|
|
1359
1363
|
_initAutoFill() {
|
|
1360
|
-
const t = () => ({ redos: [], undos: [] }), e = (
|
|
1361
|
-
const { source: s, target: o, unitId: c, subUnitId: a } =
|
|
1364
|
+
const t = () => ({ redos: [], undos: [] }), e = (r, i) => {
|
|
1365
|
+
const { source: s, target: o, unitId: c, subUnitId: a } = r, p = Ye([s, o]), [h, _] = p.ranges, { mapFunc: l } = p, f = {
|
|
1362
1366
|
row: h.startRow,
|
|
1363
1367
|
col: h.startColumn
|
|
1364
|
-
}, L =
|
|
1368
|
+
}, L = bn(h, _), y = [], S = [];
|
|
1365
1369
|
return L.forEach((I) => {
|
|
1366
|
-
const
|
|
1370
|
+
const v = I.repeatStartCell, K = I.relativeRange, N = {
|
|
1367
1371
|
startRow: f.row,
|
|
1368
1372
|
startColumn: f.col,
|
|
1369
1373
|
endColumn: f.col,
|
|
1370
1374
|
endRow: f.row
|
|
1371
1375
|
}, R = {
|
|
1372
|
-
startRow:
|
|
1373
|
-
startColumn:
|
|
1374
|
-
endColumn:
|
|
1375
|
-
endRow:
|
|
1376
|
+
startRow: v.row,
|
|
1377
|
+
startColumn: v.col,
|
|
1378
|
+
endColumn: v.col,
|
|
1379
|
+
endRow: v.row
|
|
1376
1380
|
};
|
|
1377
|
-
|
|
1381
|
+
qe.foreach(K, (Y, V) => {
|
|
1378
1382
|
const Q = oe.getPositionRange(
|
|
1379
1383
|
{
|
|
1380
|
-
startRow:
|
|
1384
|
+
startRow: Y,
|
|
1381
1385
|
startColumn: V,
|
|
1382
1386
|
endColumn: V,
|
|
1383
|
-
endRow:
|
|
1387
|
+
endRow: Y
|
|
1384
1388
|
},
|
|
1385
1389
|
N
|
|
1386
1390
|
), { row: ue, col: Ne } = l(Q.startRow, Q.startColumn), ee = this._hyperLinkModel.getHyperLinkByLocation(c, a, ue, Ne);
|
|
1387
1391
|
if (ee) {
|
|
1388
1392
|
const u = oe.getPositionRange(
|
|
1389
1393
|
{
|
|
1390
|
-
startRow:
|
|
1394
|
+
startRow: Y,
|
|
1391
1395
|
startColumn: V,
|
|
1392
1396
|
endColumn: V,
|
|
1393
|
-
endRow:
|
|
1397
|
+
endRow: Y
|
|
1394
1398
|
},
|
|
1395
1399
|
R
|
|
1396
1400
|
), { row: m, col: C } = l(u.startRow, u.startColumn), k = ae.generateRandomId(), D = this._hyperLinkModel.getHyperLinkByLocation(c, a, m, C);
|
|
1397
1401
|
D && y.push({
|
|
1398
|
-
id:
|
|
1402
|
+
id: x.id,
|
|
1399
1403
|
params: {
|
|
1400
1404
|
unitId: c,
|
|
1401
1405
|
subUnitId: a,
|
|
1402
1406
|
id: D.id
|
|
1403
1407
|
}
|
|
1404
|
-
}), he.COPY ===
|
|
1405
|
-
id:
|
|
1408
|
+
}), he.COPY === i && (y.push({
|
|
1409
|
+
id: j.id,
|
|
1406
1410
|
params: {
|
|
1407
1411
|
unitId: c,
|
|
1408
1412
|
subUnitId: a,
|
|
@@ -1414,14 +1418,14 @@ let Ie = class extends T {
|
|
|
1414
1418
|
}
|
|
1415
1419
|
}
|
|
1416
1420
|
}), S.push({
|
|
1417
|
-
id:
|
|
1421
|
+
id: x.id,
|
|
1418
1422
|
params: {
|
|
1419
1423
|
unitId: c,
|
|
1420
1424
|
subUnitId: a,
|
|
1421
1425
|
id: k
|
|
1422
1426
|
}
|
|
1423
1427
|
})), D && S.push({
|
|
1424
|
-
id:
|
|
1428
|
+
id: j.id,
|
|
1425
1429
|
params: {
|
|
1426
1430
|
unitId: c,
|
|
1427
1431
|
subUnitId: a,
|
|
@@ -1435,106 +1439,106 @@ let Ie = class extends T {
|
|
|
1435
1439
|
redos: y
|
|
1436
1440
|
};
|
|
1437
1441
|
}, n = {
|
|
1438
|
-
id:
|
|
1439
|
-
onFillData: (
|
|
1442
|
+
id: st,
|
|
1443
|
+
onFillData: (r, i, s) => s === he.COPY || s === he.ONLY_FORMAT || s === he.SERIES ? e(r, s) : t()
|
|
1440
1444
|
};
|
|
1441
1445
|
this.disposeWithMe(this._autoFillService.addHook(n));
|
|
1442
1446
|
}
|
|
1443
1447
|
};
|
|
1444
|
-
|
|
1445
|
-
U
|
|
1446
|
-
vt(0,
|
|
1447
|
-
vt(1, g(
|
|
1448
|
-
],
|
|
1449
|
-
var
|
|
1450
|
-
for (var
|
|
1451
|
-
(o = t[s]) && (
|
|
1452
|
-
return
|
|
1453
|
-
}, me = (t, e) => (n,
|
|
1454
|
-
let
|
|
1455
|
-
constructor(e, n,
|
|
1448
|
+
Le = ei([
|
|
1449
|
+
T(U.Ready, Le),
|
|
1450
|
+
vt(0, kn),
|
|
1451
|
+
vt(1, g(w))
|
|
1452
|
+
], Le);
|
|
1453
|
+
var ti = Object.defineProperty, ni = Object.getOwnPropertyDescriptor, ri = (t, e, n, r) => {
|
|
1454
|
+
for (var i = r > 1 ? void 0 : r ? ni(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1455
|
+
(o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
|
|
1456
|
+
return r && i && ti(e, n, i), i;
|
|
1457
|
+
}, me = (t, e) => (n, r) => e(n, r, t);
|
|
1458
|
+
let Ie = class extends O {
|
|
1459
|
+
constructor(e, n, r, i) {
|
|
1456
1460
|
super();
|
|
1457
|
-
|
|
1458
|
-
this._sheetClipboardService = e, this._hyperLinkModel = n, this._injector =
|
|
1461
|
+
H(this, "_copyInfo");
|
|
1462
|
+
this._sheetClipboardService = e, this._hyperLinkModel = n, this._injector = r, this._resolverService = i, this._initCopyPaste();
|
|
1459
1463
|
}
|
|
1460
1464
|
// eslint-disable-next-line max-lines-per-function
|
|
1461
1465
|
_initCopyPaste() {
|
|
1462
1466
|
this._sheetClipboardService.addClipboardHook({
|
|
1463
|
-
id:
|
|
1464
|
-
onBeforeCopy: (e, n,
|
|
1465
|
-
onPasteCells: (e, n,
|
|
1466
|
-
const { copyType: s =
|
|
1467
|
+
id: st,
|
|
1468
|
+
onBeforeCopy: (e, n, r) => this._collect(e, n, r),
|
|
1469
|
+
onPasteCells: (e, n, r, i) => {
|
|
1470
|
+
const { copyType: s = ht.COPY, pasteType: o } = i, { range: c } = e || {}, { range: a, unitId: p, subUnitId: h } = n;
|
|
1467
1471
|
return this._generateMutations(a, { copyType: s, pasteType: o, copyRange: c, unitId: p, subUnitId: h });
|
|
1468
1472
|
},
|
|
1469
1473
|
onPastePlainText: (e, n) => {
|
|
1470
1474
|
if (le(n)) {
|
|
1471
|
-
let
|
|
1472
|
-
const
|
|
1473
|
-
|
|
1474
|
-
const { range: o, unitId: c, subUnitId: a } = e, { ranges: [p], mapFunc: h } = Ye([o]),
|
|
1475
|
-
return
|
|
1475
|
+
let r = Zt(n);
|
|
1476
|
+
const i = new URL(r), s = n;
|
|
1477
|
+
i.hostname === location.hostname && i.port === location.port && i.protocol === location.protocol && i.pathname === location.pathname && i.hash && (r = i.hash);
|
|
1478
|
+
const { range: o, unitId: c, subUnitId: a } = e, { ranges: [p], mapFunc: h } = Ye([o]), _ = [], l = [];
|
|
1479
|
+
return qe.foreach(p, (f, L) => {
|
|
1476
1480
|
const { row: y, col: S } = h(f, L), I = this._hyperLinkModel.getHyperLinkByLocation(c, a, y, S);
|
|
1477
|
-
I &&
|
|
1478
|
-
id:
|
|
1481
|
+
I && _.push({
|
|
1482
|
+
id: x.id,
|
|
1479
1483
|
params: {
|
|
1480
1484
|
unitId: c,
|
|
1481
1485
|
subUnitId: a,
|
|
1482
1486
|
id: I.id
|
|
1483
1487
|
}
|
|
1484
1488
|
});
|
|
1485
|
-
const
|
|
1486
|
-
|
|
1487
|
-
id:
|
|
1489
|
+
const v = ae.generateRandomId();
|
|
1490
|
+
_.push({
|
|
1491
|
+
id: j.id,
|
|
1488
1492
|
params: {
|
|
1489
1493
|
unitId: c,
|
|
1490
1494
|
subUnitId: a,
|
|
1491
1495
|
link: {
|
|
1492
|
-
id:
|
|
1496
|
+
id: v,
|
|
1493
1497
|
row: y,
|
|
1494
1498
|
column: S,
|
|
1495
1499
|
display: s,
|
|
1496
|
-
payload:
|
|
1500
|
+
payload: r
|
|
1497
1501
|
}
|
|
1498
1502
|
}
|
|
1499
1503
|
}), l.push({
|
|
1500
|
-
id:
|
|
1504
|
+
id: x.id,
|
|
1501
1505
|
params: {
|
|
1502
1506
|
unitId: c,
|
|
1503
1507
|
subUnitId: a,
|
|
1504
|
-
id:
|
|
1508
|
+
id: v
|
|
1505
1509
|
}
|
|
1506
1510
|
}), I && l.push({
|
|
1507
|
-
id:
|
|
1511
|
+
id: j.id,
|
|
1508
1512
|
params: {
|
|
1509
1513
|
unitId: c,
|
|
1510
1514
|
subUnitId: a,
|
|
1511
1515
|
link: I
|
|
1512
1516
|
}
|
|
1513
1517
|
});
|
|
1514
|
-
}), { redos:
|
|
1518
|
+
}), { redos: _, undos: l };
|
|
1515
1519
|
}
|
|
1516
1520
|
return { undos: [], redos: [] };
|
|
1517
1521
|
}
|
|
1518
1522
|
});
|
|
1519
1523
|
}
|
|
1520
|
-
_collect(e, n,
|
|
1521
|
-
const
|
|
1524
|
+
_collect(e, n, r) {
|
|
1525
|
+
const i = new St();
|
|
1522
1526
|
this._copyInfo = {
|
|
1523
1527
|
unitId: e,
|
|
1524
1528
|
subUnitId: n,
|
|
1525
|
-
matrix:
|
|
1529
|
+
matrix: i
|
|
1526
1530
|
};
|
|
1527
1531
|
const s = {
|
|
1528
1532
|
get: this._injector.get.bind(this._injector)
|
|
1529
|
-
}, o =
|
|
1533
|
+
}, o = Rn(r, s, e, n);
|
|
1530
1534
|
if (!o)
|
|
1531
1535
|
return;
|
|
1532
1536
|
const { rows: c, cols: a } = o;
|
|
1533
1537
|
c.forEach((p, h) => {
|
|
1534
|
-
a.forEach((
|
|
1538
|
+
a.forEach((_, l) => {
|
|
1535
1539
|
var L;
|
|
1536
|
-
const f = this._hyperLinkModel.getHyperLinkByLocation(e, n, p,
|
|
1537
|
-
|
|
1540
|
+
const f = this._hyperLinkModel.getHyperLinkByLocation(e, n, p, _);
|
|
1541
|
+
i.setValue(h, l, (L = f == null ? void 0 : f.id) != null ? L : "");
|
|
1538
1542
|
});
|
|
1539
1543
|
});
|
|
1540
1544
|
}
|
|
@@ -1542,7 +1546,7 @@ let ke = class extends T {
|
|
|
1542
1546
|
_generateMutations(e, n) {
|
|
1543
1547
|
if (!this._copyInfo)
|
|
1544
1548
|
return { redos: [], undos: [] };
|
|
1545
|
-
if (n.copyType ===
|
|
1549
|
+
if (n.copyType === ht.CUT)
|
|
1546
1550
|
return this._copyInfo = null, { redos: [], undos: [] };
|
|
1547
1551
|
if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !n.copyRange)
|
|
1548
1552
|
return { redos: [], undos: [] };
|
|
@@ -1550,13 +1554,13 @@ let ke = class extends T {
|
|
|
1550
1554
|
We.SPECIAL_PASTE_COL_WIDTH,
|
|
1551
1555
|
We.SPECIAL_PASTE_VALUE,
|
|
1552
1556
|
We.SPECIAL_PASTE_FORMAT,
|
|
1553
|
-
|
|
1557
|
+
Zn
|
|
1554
1558
|
].includes(
|
|
1555
1559
|
n.pasteType
|
|
1556
1560
|
))
|
|
1557
1561
|
return { redos: [], undos: [] };
|
|
1558
|
-
const { unitId:
|
|
1559
|
-
return
|
|
1562
|
+
const { unitId: r, subUnitId: i } = this._copyInfo, s = [], o = [], { ranges: [c, a], mapFunc: p } = Ye([n.copyRange, e]);
|
|
1563
|
+
return Pn(c, a, !0).forEach(({ startRange: _ }) => {
|
|
1560
1564
|
var l;
|
|
1561
1565
|
(l = this._copyInfo) == null || l.matrix.forValue((f, L, y) => {
|
|
1562
1566
|
const S = oe.getPositionRange(
|
|
@@ -1566,36 +1570,36 @@ let ke = class extends T {
|
|
|
1566
1570
|
startColumn: L,
|
|
1567
1571
|
endColumn: L
|
|
1568
1572
|
},
|
|
1569
|
-
|
|
1570
|
-
), I = this._hyperLinkModel.getHyperLink(
|
|
1573
|
+
_
|
|
1574
|
+
), I = this._hyperLinkModel.getHyperLink(r, i, y), { row: v, col: K } = p(S.startRow, S.startColumn), N = this._hyperLinkModel.getHyperLinkByLocation(n.unitId, n.subUnitId, v, K), R = ae.generateRandomId();
|
|
1571
1575
|
N && s.push({
|
|
1572
|
-
id:
|
|
1576
|
+
id: x.id,
|
|
1573
1577
|
params: {
|
|
1574
1578
|
unitId: n.unitId,
|
|
1575
1579
|
subUnitId: n.subUnitId,
|
|
1576
1580
|
id: N.id
|
|
1577
1581
|
}
|
|
1578
1582
|
}), I && (s.push({
|
|
1579
|
-
id:
|
|
1583
|
+
id: j.id,
|
|
1580
1584
|
params: {
|
|
1581
1585
|
unitId: n.unitId,
|
|
1582
1586
|
subUnitId: n.subUnitId,
|
|
1583
1587
|
link: {
|
|
1584
1588
|
...I,
|
|
1585
1589
|
id: R,
|
|
1586
|
-
row:
|
|
1587
|
-
column:
|
|
1590
|
+
row: v,
|
|
1591
|
+
column: K
|
|
1588
1592
|
}
|
|
1589
1593
|
}
|
|
1590
1594
|
}), o.push({
|
|
1591
|
-
id:
|
|
1595
|
+
id: x.id,
|
|
1592
1596
|
params: {
|
|
1593
1597
|
unitId: n.unitId,
|
|
1594
1598
|
subUnitId: n.subUnitId,
|
|
1595
1599
|
id: R
|
|
1596
1600
|
}
|
|
1597
1601
|
})), N && o.push({
|
|
1598
|
-
id:
|
|
1602
|
+
id: j.id,
|
|
1599
1603
|
params: {
|
|
1600
1604
|
unitId: n.unitId,
|
|
1601
1605
|
subUnitId: n.subUnitId,
|
|
@@ -1609,19 +1613,19 @@ let ke = class extends T {
|
|
|
1609
1613
|
};
|
|
1610
1614
|
}
|
|
1611
1615
|
};
|
|
1612
|
-
|
|
1613
|
-
U
|
|
1614
|
-
me(0,
|
|
1615
|
-
me(1, g(
|
|
1616
|
-
me(2, g(
|
|
1616
|
+
Ie = ri([
|
|
1617
|
+
T(U.Ready, Ie),
|
|
1618
|
+
me(0, On),
|
|
1619
|
+
me(1, g(w)),
|
|
1620
|
+
me(2, g(Ue)),
|
|
1617
1621
|
me(3, g(B))
|
|
1618
|
-
],
|
|
1619
|
-
var
|
|
1620
|
-
for (var
|
|
1621
|
-
(o = t[s]) && (
|
|
1622
|
-
return
|
|
1623
|
-
},
|
|
1624
|
-
let
|
|
1622
|
+
], Ie);
|
|
1623
|
+
var ii = Object.defineProperty, si = Object.getOwnPropertyDescriptor, oi = (t, e, n, r) => {
|
|
1624
|
+
for (var i = r > 1 ? void 0 : r ? si(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1625
|
+
(o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
|
|
1626
|
+
return r && i && ii(e, n, i), i;
|
|
1627
|
+
}, ai = (t, e) => (n, r) => e(n, r, t);
|
|
1628
|
+
let ke = class extends O {
|
|
1625
1629
|
constructor(t) {
|
|
1626
1630
|
super(), this._resolverService = t, this._handleInitUrl();
|
|
1627
1631
|
}
|
|
@@ -1630,88 +1634,91 @@ let be = class extends T {
|
|
|
1630
1634
|
t && this._resolverService.parseHyperLink(t).handler();
|
|
1631
1635
|
}
|
|
1632
1636
|
};
|
|
1633
|
-
|
|
1634
|
-
U
|
|
1635
|
-
|
|
1636
|
-
],
|
|
1637
|
-
var
|
|
1638
|
-
for (var
|
|
1639
|
-
(o = t[s]) && (
|
|
1640
|
-
return
|
|
1641
|
-
}, Ke = (t, e) => (n,
|
|
1642
|
-
let
|
|
1637
|
+
ke = oi([
|
|
1638
|
+
T(U.Rendered, ke),
|
|
1639
|
+
ai(0, g(B))
|
|
1640
|
+
], ke);
|
|
1641
|
+
var ci = Object.defineProperty, li = Object.getOwnPropertyDescriptor, di = (t, e, n, r) => {
|
|
1642
|
+
for (var i = r > 1 ? void 0 : r ? li(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1643
|
+
(o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
|
|
1644
|
+
return r && i && ci(e, n, i), i;
|
|
1645
|
+
}, Ke = (t, e) => (n, r) => e(n, r, t);
|
|
1646
|
+
let be = class extends O {
|
|
1643
1647
|
constructor(t, e, n) {
|
|
1644
1648
|
super(), this._localeService = t, this._commandService = e, this._sheetPermissionInterceptorBaseController = n, this._commandExecutedListener();
|
|
1645
1649
|
}
|
|
1646
1650
|
_commandExecutedListener() {
|
|
1647
1651
|
this.disposeWithMe(
|
|
1648
1652
|
this._commandService.beforeCommandExecuted((t) => {
|
|
1649
|
-
t.id ===
|
|
1650
|
-
workbookTypes: [
|
|
1651
|
-
rangeTypes: [
|
|
1652
|
-
worksheetTypes: [
|
|
1653
|
+
t.id === Kt.id && (this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
|
1654
|
+
workbookTypes: [Qe],
|
|
1655
|
+
rangeTypes: [rt],
|
|
1656
|
+
worksheetTypes: [et, tt, nt]
|
|
1653
1657
|
}) || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.hyperLinkErr")));
|
|
1654
1658
|
})
|
|
1655
1659
|
);
|
|
1656
1660
|
}
|
|
1657
1661
|
};
|
|
1658
|
-
|
|
1659
|
-
U
|
|
1662
|
+
be = di([
|
|
1663
|
+
T(U.Rendered, be),
|
|
1660
1664
|
Ke(0, g(de)),
|
|
1661
|
-
Ke(1,
|
|
1662
|
-
Ke(2, g(
|
|
1663
|
-
],
|
|
1664
|
-
var
|
|
1665
|
-
for (var
|
|
1666
|
-
(o = t[s]) && (
|
|
1667
|
-
return
|
|
1668
|
-
},
|
|
1669
|
-
let
|
|
1670
|
-
constructor(t, e) {
|
|
1671
|
-
super(
|
|
1665
|
+
Ke(1, F),
|
|
1666
|
+
Ke(2, g(wn))
|
|
1667
|
+
], be);
|
|
1668
|
+
var Yt = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, pi = (t, e, n) => e in t ? Yt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, hi = (t, e, n, r) => {
|
|
1669
|
+
for (var i = r > 1 ? void 0 : r ? ui(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1670
|
+
(o = t[s]) && (i = (r ? o(e, n, i) : o(i)) || i);
|
|
1671
|
+
return r && i && Yt(e, n, i), i;
|
|
1672
|
+
}, yt = (t, e) => (n, r) => e(n, r, t), Gt = (t, e, n) => (pi(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
1673
|
+
let je = class extends on {
|
|
1674
|
+
constructor(t, e, n) {
|
|
1675
|
+
super(), this._config = t, this._injector = e, this._renderManagerService = n;
|
|
1672
1676
|
}
|
|
1673
1677
|
onStarting(t) {
|
|
1674
|
-
|
|
1678
|
+
[
|
|
1675
1679
|
[B],
|
|
1676
1680
|
[$],
|
|
1677
1681
|
[_e],
|
|
1682
|
+
[ve],
|
|
1678
1683
|
[ye],
|
|
1679
1684
|
[Se],
|
|
1680
1685
|
[Ce],
|
|
1681
|
-
[Le],
|
|
1682
1686
|
[
|
|
1683
1687
|
se,
|
|
1684
1688
|
{
|
|
1685
1689
|
useFactory: () => this._injector.createInstance(se, this._config)
|
|
1686
1690
|
}
|
|
1687
1691
|
],
|
|
1692
|
+
[Le],
|
|
1688
1693
|
[Ie],
|
|
1689
|
-
[
|
|
1690
|
-
[
|
|
1691
|
-
|
|
1692
|
-
].forEach((n) => {
|
|
1693
|
-
t.add(n);
|
|
1694
|
-
});
|
|
1694
|
+
[be],
|
|
1695
|
+
[ke]
|
|
1696
|
+
].forEach((n) => t.add(n)), this._renderManagerService.registerRenderController(M.UNIVER_SHEET, Xe);
|
|
1695
1697
|
}
|
|
1696
|
-
}
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1698
|
+
};
|
|
1699
|
+
Gt(je, "pluginName", st);
|
|
1700
|
+
Gt(je, "type", M.UNIVER_SHEET);
|
|
1701
|
+
je = hi([
|
|
1702
|
+
an(vn),
|
|
1703
|
+
yt(1, g(Ue)),
|
|
1704
|
+
yt(2, jt)
|
|
1705
|
+
], je);
|
|
1700
1706
|
export {
|
|
1701
|
-
|
|
1707
|
+
Me as CloseHyperLinkSidebarOperation,
|
|
1702
1708
|
$e as InsertHyperLinkOperation,
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1709
|
+
Kt as InsertLinkShortcut,
|
|
1710
|
+
ot as OpenHyperLinkSidebarOperation,
|
|
1711
|
+
Se as SheetHyperLinkSetRangeController,
|
|
1712
|
+
ke as SheetHyperLinkUrlController,
|
|
1713
|
+
Le as SheetsHyperLinkAutoFillController,
|
|
1714
|
+
Ie as SheetsHyperLinkCopyPasteController,
|
|
1715
|
+
Ce as SheetsHyperLinkPopupController,
|
|
1710
1716
|
$ as SheetsHyperLinkPopupService,
|
|
1711
|
-
|
|
1717
|
+
ve as SheetsHyperLinkRefRangeController,
|
|
1712
1718
|
_e as SheetsHyperLinkRemoveSheetController,
|
|
1713
|
-
|
|
1719
|
+
Xe as SheetsHyperLinkRenderController,
|
|
1720
|
+
ye as SheetsHyperLinkRenderManagerController,
|
|
1714
1721
|
B as SheetsHyperLinkResolverService,
|
|
1715
1722
|
se as SheetsHyperLinkUIController,
|
|
1716
|
-
|
|
1723
|
+
je as UniverSheetsHyperLinkUIPlugin
|
|
1717
1724
|
};
|