@univerjs/sheets-hyper-link-ui 0.1.15 → 0.1.16
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 +696 -658
- package/lib/locale/en-US.json +1 -1
- package/lib/types/controllers/popup.controller.d.ts +5 -3
- package/lib/types/controllers/set-range.controller.d.ts +1 -0
- package/lib/types/services/popup.service.d.ts +6 -1
- package/lib/umd/index.js +2 -2
- package/package.json +21 -21
package/lib/es/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { Disposable as O, UniverInstanceType as
|
|
5
|
-
import { RemoveSheetCommand as
|
|
6
|
-
import { Inject as
|
|
7
|
-
import { RemoveHyperLinkMutation as M, AddHyperLinkMutation as x, HyperLinkModel as T, ERROR_RANGE as
|
|
8
|
-
import { SheetSkeletonManagerService as
|
|
1
|
+
var Yt = Object.defineProperty;
|
|
2
|
+
var Gt = (e, t, n) => t in e ? Yt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var D = (e, t, n) => Gt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { Disposable as O, UniverInstanceType as w, OnLifecycle as N, LifecycleStages as $, IUniverInstanceService as ue, BooleanNumber as qt, ThemeService as Xt, isValidRange as Ye, LocaleService as pe, RANGE_TYPE as lt, Rectangle as ee, ICommandService as F, DEFAULT_EMPTY_DOCUMENT_VALUE as Jt, createInternalEditorID as Qt, Tools as le, CommandType as je, CellValueType as en, ObjectMatrix as _t, Range as Qe, IPermissionService as tn, Plugin as nn, DependentOn as rn } from "@univerjs/core";
|
|
5
|
+
import { RemoveSheetCommand as on, SheetInterceptorService as et, INTERCEPTOR_POINT as sn, SetSelectionsOperation as an, NORMAL_SELECTION_PLUGIN_NAME as cn, SetWorksheetActiveOperation as we, getSheetCommandTarget as Ct, SelectionManagerService as yt, SetRangeValuesMutation as fe, SetRangeValuesUndoMutationFactory as dt, SetRangeValuesCommand as ln, ClearSelectionContentCommand as dn, ClearSelectionAllCommand as un, ClearSelectionFormatCommand as pn, WorkbookViewPermission as hn, WorksheetViewPermission as mn, RangeProtectionPermissionViewPoint as gn, WorkbookEditablePermission as He, WorksheetEditPermission as Ne, WorksheetInsertHyperlinkPermission as $e, RangeProtectionPermissionEditPoint as Ae, WorkbookCopyPermission as fn, WorksheetCopyPermission as vn, WorksheetSetCellValuePermission as tt } from "@univerjs/sheets";
|
|
6
|
+
import { Inject as h, Injector as Be } from "@wendellhu/redi";
|
|
7
|
+
import { RemoveHyperLinkMutation as M, AddHyperLinkMutation as x, HyperLinkModel as T, ERROR_RANGE as Ge, UpdateHyperLinkCommand as St, AddHyperLinkCommand as Lt, CancelHyperLinkCommand as _n, UniverSheetsHyperLinkPlugin as Cn } from "@univerjs/sheets-hyper-link";
|
|
8
|
+
import { SheetSkeletonManagerService as It, ScrollToRangeOperation as kt, SheetCanvasPopManagerService as yn, HoverManagerService as Sn, SheetPermissionInterceptorBaseController as Pt, whenSheetEditorFocused as Ln, getCurrentRangeDisable$ as bt, APPLY_TYPE as ne, IAutoFillService as In, virtualizeDiscreteRanges as qe, getAutoFillRepeatRange as kn, COPY_TYPE as ut, rangeToDiscreteRange as Pn, PREDEFINED_HOOK_NAME as Fe, getRepeatRange as bn, ISheetClipboardService as Rn } from "@univerjs/sheets-ui";
|
|
9
9
|
import { IRenderManagerService as nt } from "@univerjs/engine-render";
|
|
10
|
-
import { Subject as
|
|
11
|
-
import
|
|
12
|
-
import { useDependency as k
|
|
13
|
-
import
|
|
14
|
-
import { MessageType as
|
|
15
|
-
import { IMessageService as
|
|
16
|
-
import { deserializeRangeWithSheet as
|
|
17
|
-
import { SPECIAL_PASTE_FORMULA as
|
|
18
|
-
var
|
|
19
|
-
for (var
|
|
20
|
-
(s = e[o]) && (
|
|
21
|
-
return
|
|
22
|
-
},
|
|
23
|
-
let
|
|
10
|
+
import { Subject as wn, BehaviorSubject as On, debounceTime as En } from "rxjs";
|
|
11
|
+
import Mn, { forwardRef as Z, useRef as Rt, createElement as z, useState as re, useEffect as xn, useMemo as Tn } from "react";
|
|
12
|
+
import { useDependency as k } from "@wendellhu/redi/react-bindings";
|
|
13
|
+
import pt from "clsx";
|
|
14
|
+
import { MessageType as ae, FormLayout as X, Input as ht, Select as Ze, Button as mt, Tooltip as ve } from "@univerjs/design";
|
|
15
|
+
import { IMessageService as wt, useObservable as Ot, useEvent as Un, RangeSelector as jn, ISidebarService as Et, KeyCode as Hn, MetaKeys as Nn, MenuItemType as Mt, MenuPosition as xt, getMenuHiddenObservable as Tt, MenuGroup as $n, ComponentManager as An, IShortcutService as Bn, IMenuService as Vn } from "@univerjs/ui";
|
|
16
|
+
import { deserializeRangeWithSheet as Oe, serializeRangeWithSheet as Ut, IDefinedNamesService as jt, serializeRangeToRefString as Dn, serializeRange as Wn } from "@univerjs/engine-formula";
|
|
17
|
+
import { SPECIAL_PASTE_FORMULA as Fn } from "@univerjs/sheets-formula";
|
|
18
|
+
var Zn = Object.defineProperty, zn = Object.getOwnPropertyDescriptor, Kn = (e, t, n, r) => {
|
|
19
|
+
for (var i = r > 1 ? void 0 : r ? zn(t, n) : t, o = e.length - 1, s; o >= 0; o--)
|
|
20
|
+
(s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
|
|
21
|
+
return r && i && Zn(t, n, i), i;
|
|
22
|
+
}, ze = (e, t) => (n, r) => t(n, r, e);
|
|
23
|
+
let Ce = class extends O {
|
|
24
24
|
constructor(e, t, n) {
|
|
25
25
|
super(), this._sheetInterceptorService = e, this._univerInstanceService = t, this._hyperLinkModel = n, this._initSheetChange();
|
|
26
26
|
}
|
|
@@ -28,26 +28,30 @@ let ve = class extends O {
|
|
|
28
28
|
this.disposeWithMe(
|
|
29
29
|
this._sheetInterceptorService.interceptCommand({
|
|
30
30
|
getMutations: (e) => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
var t;
|
|
32
|
+
if (e.id === on.id) {
|
|
33
|
+
const n = e.params, r = n.unitId ? this._univerInstanceService.getUnit(n.unitId) : this._univerInstanceService.getCurrentUnitForType(w.UNIVER_SHEET);
|
|
34
|
+
if (!r)
|
|
35
|
+
return { redos: [], undos: [] };
|
|
36
|
+
const i = r.getUnitId(), o = n.subUnitId || ((t = r.getActiveSheet()) == null ? void 0 : t.getSheetId());
|
|
37
|
+
if (!o)
|
|
34
38
|
return { redos: [], undos: [] };
|
|
35
|
-
const
|
|
39
|
+
const s = this._hyperLinkModel.getSubUnit(i, o), c = s.map((p) => ({
|
|
36
40
|
id: M.id,
|
|
37
41
|
params: {
|
|
38
42
|
unitId: i,
|
|
39
|
-
subUnitId:
|
|
40
|
-
id:
|
|
43
|
+
subUnitId: o,
|
|
44
|
+
id: p.id
|
|
41
45
|
}
|
|
42
|
-
})),
|
|
46
|
+
})), a = s.map((p) => ({
|
|
43
47
|
id: x.id,
|
|
44
48
|
params: {
|
|
45
49
|
unitId: i,
|
|
46
|
-
subUnitId:
|
|
47
|
-
link:
|
|
50
|
+
subUnitId: o,
|
|
51
|
+
link: p
|
|
48
52
|
}
|
|
49
53
|
}));
|
|
50
|
-
return { redos:
|
|
54
|
+
return { redos: c, undos: a };
|
|
51
55
|
}
|
|
52
56
|
return { redos: [], undos: [] };
|
|
53
57
|
}
|
|
@@ -55,52 +59,58 @@ let ve = class extends O {
|
|
|
55
59
|
);
|
|
56
60
|
}
|
|
57
61
|
};
|
|
58
|
-
|
|
59
|
-
N($.Ready,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
],
|
|
64
|
-
var
|
|
65
|
-
for (var
|
|
66
|
-
(s = e[o]) && (
|
|
67
|
-
return
|
|
68
|
-
}, Q = (e, t) => (n,
|
|
69
|
-
let
|
|
70
|
-
constructor(e, t, n,
|
|
71
|
-
super(), this._context = e, this._hyperLinkModel = t, this._sheetSkeletonManagerService = n, this._renderManagerService =
|
|
62
|
+
Ce = Kn([
|
|
63
|
+
N($.Ready, Ce),
|
|
64
|
+
ze(0, h(et)),
|
|
65
|
+
ze(1, ue),
|
|
66
|
+
ze(2, h(T))
|
|
67
|
+
], Ce);
|
|
68
|
+
var Yn = Object.defineProperty, Gn = Object.getOwnPropertyDescriptor, Ht = (e, t, n, r) => {
|
|
69
|
+
for (var i = r > 1 ? void 0 : r ? Gn(t, n) : t, o = e.length - 1, s; o >= 0; o--)
|
|
70
|
+
(s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
|
|
71
|
+
return r && i && Yn(t, n, i), i;
|
|
72
|
+
}, Q = (e, t) => (n, r) => t(n, r, e);
|
|
73
|
+
let Xe = class extends O {
|
|
74
|
+
constructor(e, t, n, r) {
|
|
75
|
+
super(), this._context = e, this._hyperLinkModel = t, this._sheetSkeletonManagerService = n, this._renderManagerService = r, this._initSkeletonChange();
|
|
72
76
|
}
|
|
73
77
|
_initSkeletonChange() {
|
|
74
78
|
const e = () => {
|
|
75
|
-
|
|
76
|
-
|
|
79
|
+
var s;
|
|
80
|
+
const t = this._context.unit, n = t.getUnitId(), r = (s = t.getActiveSheet()) == null ? void 0 : s.getSheetId();
|
|
81
|
+
if (!r) {
|
|
82
|
+
console.warn("No active sheet found");
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const i = this._sheetSkeletonManagerService.getOrCreateSkeleton({ sheetId: r }), o = this._renderManagerService.getRenderById(n);
|
|
86
|
+
i == null || i.makeDirty(!0), i == null || i.calculate(), o && o.mainComponent.makeForceDirty();
|
|
77
87
|
};
|
|
78
88
|
this.disposeWithMe(this._hyperLinkModel.linkUpdate$.subscribe(() => {
|
|
79
89
|
e();
|
|
80
90
|
}));
|
|
81
91
|
}
|
|
82
92
|
};
|
|
83
|
-
|
|
84
|
-
Q(1,
|
|
85
|
-
Q(2,
|
|
93
|
+
Xe = Ht([
|
|
94
|
+
Q(1, h(T)),
|
|
95
|
+
Q(2, h(It)),
|
|
86
96
|
Q(3, nt)
|
|
87
|
-
],
|
|
88
|
-
let
|
|
97
|
+
], Xe);
|
|
98
|
+
let ye = class extends O {
|
|
89
99
|
constructor(e, t, n) {
|
|
90
100
|
super(), this._sheetInterceptorService = e, this._hyperLinkModel = t, this._themeService = n, this._initViewModelIntercept();
|
|
91
101
|
}
|
|
92
102
|
_initViewModelIntercept() {
|
|
93
103
|
this.disposeWithMe(
|
|
94
104
|
this._sheetInterceptorService.intercept(
|
|
95
|
-
|
|
105
|
+
sn.CELL_CONTENT,
|
|
96
106
|
{
|
|
97
107
|
handler: (e, t, n) => {
|
|
98
|
-
const { row:
|
|
108
|
+
const { row: r, col: i, unitId: o, subUnitId: s } = t, c = this._hyperLinkModel.getHyperLinkByLocation(o, s, r, i), a = this._themeService.getCurrentTheme();
|
|
99
109
|
return n(c ? {
|
|
100
110
|
...e,
|
|
101
111
|
interceptorStyle: {
|
|
102
112
|
ul: {
|
|
103
|
-
s:
|
|
113
|
+
s: qt.TRUE
|
|
104
114
|
},
|
|
105
115
|
cl: {
|
|
106
116
|
rgb: a.blue500
|
|
@@ -114,13 +124,13 @@ let _e = class extends O {
|
|
|
114
124
|
);
|
|
115
125
|
}
|
|
116
126
|
};
|
|
117
|
-
|
|
118
|
-
N($.Ready,
|
|
119
|
-
Q(0,
|
|
120
|
-
Q(1,
|
|
121
|
-
Q(2,
|
|
122
|
-
],
|
|
123
|
-
var
|
|
127
|
+
ye = Ht([
|
|
128
|
+
N($.Ready, ye),
|
|
129
|
+
Q(0, h(et)),
|
|
130
|
+
Q(1, h(T)),
|
|
131
|
+
Q(2, h(Xt))
|
|
132
|
+
], ye);
|
|
133
|
+
var Nt = { exports: {} }, Ve = {};
|
|
124
134
|
/**
|
|
125
135
|
* @license React
|
|
126
136
|
* react-jsx-runtime.production.min.js
|
|
@@ -130,150 +140,145 @@ var Ht = { exports: {} }, je = {};
|
|
|
130
140
|
* This source code is licensed under the MIT license found in the
|
|
131
141
|
* LICENSE file in the root directory of this source tree.
|
|
132
142
|
*/
|
|
133
|
-
var
|
|
134
|
-
function
|
|
135
|
-
var
|
|
143
|
+
var qn = Mn, Xn = Symbol.for("react.element"), Jn = Symbol.for("react.fragment"), Qn = Object.prototype.hasOwnProperty, er = qn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, tr = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
144
|
+
function $t(e, t, n) {
|
|
145
|
+
var r, i = {}, o = null, s = null;
|
|
136
146
|
n !== void 0 && (o = "" + n), t.key !== void 0 && (o = "" + t.key), t.ref !== void 0 && (s = t.ref);
|
|
137
|
-
for (
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
for (i in t = e.defaultProps, t)
|
|
141
|
-
r[i] === void 0 && (r[i] = t[i]);
|
|
142
|
-
return { $$typeof: Zn, type: e, key: o, ref: s, props: r, _owner: Yn.current };
|
|
147
|
+
for (r in t) Qn.call(t, r) && !tr.hasOwnProperty(r) && (i[r] = t[r]);
|
|
148
|
+
if (e && e.defaultProps) for (r in t = e.defaultProps, t) i[r] === void 0 && (i[r] = t[r]);
|
|
149
|
+
return { $$typeof: Xn, type: e, key: o, ref: s, props: i, _owner: er.current };
|
|
143
150
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
var
|
|
149
|
-
return
|
|
150
|
-
for (var t, n = 1,
|
|
151
|
+
Ve.Fragment = Jn;
|
|
152
|
+
Ve.jsx = $t;
|
|
153
|
+
Ve.jsxs = $t;
|
|
154
|
+
Nt.exports = Ve;
|
|
155
|
+
var d = Nt.exports, b = function() {
|
|
156
|
+
return b = Object.assign || function(e) {
|
|
157
|
+
for (var t, n = 1, r = arguments.length; n < r; n++) {
|
|
151
158
|
t = arguments[n];
|
|
152
|
-
for (var
|
|
153
|
-
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
|
|
159
|
+
for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
154
160
|
}
|
|
155
161
|
return e;
|
|
156
|
-
},
|
|
157
|
-
},
|
|
162
|
+
}, b.apply(this, arguments);
|
|
163
|
+
}, nr = function(e, t) {
|
|
158
164
|
var n = {};
|
|
159
|
-
for (var
|
|
160
|
-
Object.prototype.hasOwnProperty.call(e, i) && t.indexOf(i) < 0 && (n[i] = e[i]);
|
|
165
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
161
166
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
162
|
-
for (var
|
|
163
|
-
t.indexOf(i
|
|
167
|
+
for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)
|
|
168
|
+
t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
|
|
164
169
|
return n;
|
|
165
170
|
}, K = Z(function(e, t) {
|
|
166
|
-
var n = e.icon,
|
|
167
|
-
return
|
|
171
|
+
var n = e.icon, r = e.id, i = e.className, o = e.extend, s = nr(e, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(r, " ").concat(i || "").trim(), a = Rt("_".concat(or()));
|
|
172
|
+
return At(n, "".concat(r), { defIds: n.defIds, idSuffix: a.current }, b({ ref: t, className: c }, s), o);
|
|
168
173
|
});
|
|
169
|
-
function
|
|
170
|
-
return z(e.tag,
|
|
171
|
-
return
|
|
174
|
+
function At(e, t, n, r, i) {
|
|
175
|
+
return z(e.tag, b(b({ key: t }, rr(e, n, i)), r), (ir(e, n).children || []).map(function(o, s) {
|
|
176
|
+
return At(o, "".concat(t, "-").concat(e.tag, "-").concat(s), n, void 0, i);
|
|
172
177
|
}));
|
|
173
178
|
}
|
|
174
|
-
function
|
|
175
|
-
var
|
|
176
|
-
n != null && n.colorChannel1 &&
|
|
177
|
-
var
|
|
178
|
-
return !
|
|
179
|
+
function rr(e, t, n) {
|
|
180
|
+
var r = b({}, e.attrs);
|
|
181
|
+
n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1);
|
|
182
|
+
var i = t.defIds;
|
|
183
|
+
return !i || i.length === 0 || (e.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + t.idSuffix), Object.entries(r).forEach(function(o) {
|
|
179
184
|
var s = o[0], c = o[1];
|
|
180
|
-
typeof c == "string" && (
|
|
181
|
-
})),
|
|
185
|
+
typeof c == "string" && (r[s] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
186
|
+
})), r;
|
|
182
187
|
}
|
|
183
|
-
function
|
|
184
|
-
var n,
|
|
185
|
-
return !
|
|
186
|
-
return typeof
|
|
188
|
+
function ir(e, t) {
|
|
189
|
+
var n, r = t.defIds;
|
|
190
|
+
return !r || r.length === 0 ? e : e.tag === "defs" && (!((n = e.children) === null || n === void 0) && n.length) ? b(b({}, e), { children: e.children.map(function(i) {
|
|
191
|
+
return typeof i.attrs.id == "string" && r && r.indexOf(i.attrs.id) > -1 ? b(b({}, i), { attrs: b(b({}, i.attrs), { id: i.attrs.id + t.idSuffix }) }) : i;
|
|
187
192
|
}) }) : e;
|
|
188
193
|
}
|
|
189
|
-
function
|
|
194
|
+
function or() {
|
|
190
195
|
return Math.random().toString(36).substring(2, 8);
|
|
191
196
|
}
|
|
192
197
|
K.displayName = "UniverIcon";
|
|
193
|
-
var
|
|
198
|
+
var sr = { 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" } }] }, Se = Z(function(e, t) {
|
|
194
199
|
return z(K, Object.assign({}, e, {
|
|
195
200
|
id: "all-border-single",
|
|
196
201
|
ref: t,
|
|
197
|
-
icon:
|
|
202
|
+
icon: sr
|
|
198
203
|
}));
|
|
199
204
|
});
|
|
200
|
-
|
|
201
|
-
var
|
|
205
|
+
Se.displayName = "AllBorderSingle";
|
|
206
|
+
var ar = { 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" } }] }, Bt = Z(function(e, t) {
|
|
202
207
|
return z(K, Object.assign({}, e, {
|
|
203
208
|
id: "copy-single",
|
|
204
209
|
ref: t,
|
|
205
|
-
icon:
|
|
210
|
+
icon: ar
|
|
206
211
|
}));
|
|
207
212
|
});
|
|
208
|
-
|
|
209
|
-
var
|
|
213
|
+
Bt.displayName = "CopySingle";
|
|
214
|
+
var cr = { 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" } }] }, Ee = Z(function(e, t) {
|
|
210
215
|
return z(K, Object.assign({}, e, {
|
|
211
216
|
id: "link-single",
|
|
212
217
|
ref: t,
|
|
213
|
-
icon:
|
|
218
|
+
icon: cr
|
|
214
219
|
}));
|
|
215
220
|
});
|
|
216
|
-
|
|
217
|
-
var
|
|
221
|
+
Ee.displayName = "LinkSingle";
|
|
222
|
+
var lr = { 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" } }] }, Vt = Z(function(e, t) {
|
|
218
223
|
return z(K, Object.assign({}, e, {
|
|
219
224
|
id: "unlink-single",
|
|
220
225
|
ref: t,
|
|
221
|
-
icon:
|
|
226
|
+
icon: lr
|
|
222
227
|
}));
|
|
223
228
|
});
|
|
224
|
-
|
|
225
|
-
var
|
|
229
|
+
Vt.displayName = "UnlinkSingle";
|
|
230
|
+
var dr = { 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" } }] }, Dt = Z(function(e, t) {
|
|
226
231
|
return z(K, Object.assign({}, e, {
|
|
227
232
|
id: "write-single",
|
|
228
233
|
ref: t,
|
|
229
|
-
icon:
|
|
234
|
+
icon: dr
|
|
230
235
|
}));
|
|
231
236
|
});
|
|
232
237
|
Dt.displayName = "WriteSingle";
|
|
233
|
-
var
|
|
238
|
+
var ur = { 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" } }] }, Je = Z(function(e, t) {
|
|
234
239
|
return z(K, Object.assign({}, e, {
|
|
235
240
|
id: "xlsx",
|
|
236
241
|
ref: t,
|
|
237
|
-
icon:
|
|
242
|
+
icon: ur
|
|
238
243
|
}));
|
|
239
244
|
});
|
|
240
|
-
|
|
241
|
-
var
|
|
242
|
-
for (var
|
|
243
|
-
(s = e[o]) && (
|
|
244
|
-
return
|
|
245
|
-
}, ie = (e, t) => (n,
|
|
246
|
-
function
|
|
247
|
-
const n = t.getMergeData(),
|
|
248
|
-
if (
|
|
245
|
+
Je.displayName = "Xlsx";
|
|
246
|
+
var pr = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, mr = (e, t, n, r) => {
|
|
247
|
+
for (var i = r > 1 ? void 0 : r ? hr(t, n) : t, o = e.length - 1, s; o >= 0; o--)
|
|
248
|
+
(s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
|
|
249
|
+
return r && i && pr(t, n, i), i;
|
|
250
|
+
}, ie = (e, t) => (n, r) => t(n, r, e);
|
|
251
|
+
function gr(e, t) {
|
|
252
|
+
const n = t.getMergeData(), r = t.getMaxColumns() - 1, i = t.getMaxRows() - 1;
|
|
253
|
+
if (r < e.endColumn && (e.endColumn = r), i < e.endRow && (e.endRow = i), e.rangeType === lt.COLUMN || lt.ROW)
|
|
249
254
|
return e;
|
|
250
255
|
const o = [];
|
|
251
256
|
return n.forEach((s) => {
|
|
252
257
|
ee.intersects(e, s) && o.push(s);
|
|
253
258
|
}), ee.realUnion(e, ...o);
|
|
254
259
|
}
|
|
255
|
-
let
|
|
256
|
-
constructor(e, t, n,
|
|
257
|
-
this._univerInstanceService = e, this._commandService = t, this._definedNamesService = n, this._messageService =
|
|
260
|
+
let W = class {
|
|
261
|
+
constructor(e, t, n, r, i) {
|
|
262
|
+
this._univerInstanceService = e, this._commandService = t, this._definedNamesService = n, this._messageService = r, this._localeService = i;
|
|
258
263
|
}
|
|
259
264
|
_getURLName(e) {
|
|
260
265
|
var c;
|
|
261
|
-
const { gid: t, range: n, rangeid:
|
|
262
|
-
if (!
|
|
266
|
+
const { gid: t, range: n, rangeid: r } = e, i = this._univerInstanceService.getCurrentUnitForType(w.UNIVER_SHEET);
|
|
267
|
+
if (!i)
|
|
263
268
|
return null;
|
|
264
|
-
const o = t ?
|
|
269
|
+
const o = t ? i.getSheetBySheetId(t) : i.getActiveSheet(), s = (c = o == null ? void 0 : o.getName()) != null ? c : "";
|
|
265
270
|
if (n) {
|
|
266
|
-
const a =
|
|
267
|
-
return
|
|
271
|
+
const a = Oe(n).range;
|
|
272
|
+
return Ye(a) && n !== Ge ? {
|
|
268
273
|
type: "range",
|
|
269
|
-
name:
|
|
274
|
+
name: Ut(s, a)
|
|
270
275
|
} : {
|
|
271
276
|
type: "range-error",
|
|
272
277
|
name: this._localeService.t("hyperLink.message.refError")
|
|
273
278
|
};
|
|
274
279
|
}
|
|
275
|
-
if (
|
|
276
|
-
const a = this._definedNamesService.getValueById(
|
|
280
|
+
if (r) {
|
|
281
|
+
const a = this._definedNamesService.getValueById(i.getUnitId(), r);
|
|
277
282
|
return a ? {
|
|
278
283
|
type: "defineName",
|
|
279
284
|
name: a.formulaOrRefString
|
|
@@ -283,7 +288,7 @@ let F = class {
|
|
|
283
288
|
};
|
|
284
289
|
}
|
|
285
290
|
if (t) {
|
|
286
|
-
const a =
|
|
291
|
+
const a = i.getSheetBySheetId(t);
|
|
287
292
|
return a ? {
|
|
288
293
|
type: "sheet",
|
|
289
294
|
name: a.getName()
|
|
@@ -295,26 +300,26 @@ let F = class {
|
|
|
295
300
|
return null;
|
|
296
301
|
}
|
|
297
302
|
navigateTo(e) {
|
|
298
|
-
const { gid: t, range: n, rangeid:
|
|
299
|
-
if (!
|
|
303
|
+
const { gid: t, range: n, rangeid: r } = e, i = this._univerInstanceService.getCurrentUnitForType(w.UNIVER_SHEET);
|
|
304
|
+
if (!i)
|
|
300
305
|
return;
|
|
301
|
-
const o =
|
|
302
|
-
if (
|
|
306
|
+
const o = i.getUnitId();
|
|
307
|
+
if (r && this.navigateToDefineName(o, r), !!t) {
|
|
303
308
|
if (n) {
|
|
304
|
-
const s =
|
|
305
|
-
|
|
309
|
+
const s = Oe(n);
|
|
310
|
+
Ye(s.range) && n !== Ge && this.navigateToRange(o, t, s.range);
|
|
306
311
|
return;
|
|
307
312
|
}
|
|
308
313
|
this.navigateToSheetById(o, t);
|
|
309
314
|
}
|
|
310
315
|
}
|
|
311
316
|
parseHyperLink(e) {
|
|
312
|
-
var t, n,
|
|
317
|
+
var t, n, r;
|
|
313
318
|
if (e != null && e.startsWith("#")) {
|
|
314
|
-
const
|
|
315
|
-
gid: (t =
|
|
316
|
-
range: (n =
|
|
317
|
-
rangeid: (
|
|
319
|
+
const i = new URLSearchParams(e.slice(1)), o = {
|
|
320
|
+
gid: (t = i.get("gid")) != null ? t : "",
|
|
321
|
+
range: (n = i.get("range")) != null ? n : "",
|
|
322
|
+
rangeid: (r = i.get("rangeid")) != null ? r : ""
|
|
318
323
|
}, s = this._getURLName(o);
|
|
319
324
|
return {
|
|
320
325
|
type: (s == null ? void 0 : s.type) || "link",
|
|
@@ -336,59 +341,61 @@ let F = class {
|
|
|
336
341
|
};
|
|
337
342
|
}
|
|
338
343
|
async navigateToRange(e, t, n) {
|
|
339
|
-
const
|
|
340
|
-
if (
|
|
341
|
-
const
|
|
344
|
+
const r = await this.navigateToSheetById(e, t);
|
|
345
|
+
if (r) {
|
|
346
|
+
const i = gr(n, r);
|
|
342
347
|
await this._commandService.executeCommand(
|
|
343
|
-
|
|
348
|
+
an.id,
|
|
344
349
|
{
|
|
345
350
|
unitId: e,
|
|
346
351
|
subUnitId: t,
|
|
347
|
-
pluginName:
|
|
352
|
+
pluginName: cn,
|
|
348
353
|
selections: [{
|
|
349
|
-
range:
|
|
354
|
+
range: i
|
|
350
355
|
}]
|
|
351
356
|
}
|
|
352
|
-
), await this._commandService.executeCommand(
|
|
353
|
-
range:
|
|
357
|
+
), await this._commandService.executeCommand(kt.id, {
|
|
358
|
+
range: i
|
|
354
359
|
});
|
|
355
360
|
}
|
|
356
361
|
}
|
|
357
362
|
async navigateToSheet(e, t) {
|
|
358
|
-
const n = this._univerInstanceService.getUnit(e,
|
|
363
|
+
const n = this._univerInstanceService.getUnit(e, w.UNIVER_SHEET);
|
|
359
364
|
if (!n)
|
|
360
365
|
return !1;
|
|
361
|
-
const
|
|
362
|
-
if ((
|
|
366
|
+
const r = n.getActiveSheet();
|
|
367
|
+
if ((r == null ? void 0 : r.getName()) === t)
|
|
363
368
|
return !0;
|
|
364
|
-
const
|
|
365
|
-
if (!
|
|
369
|
+
const i = n.getSheetBySheetName(t);
|
|
370
|
+
if (!i) {
|
|
366
371
|
this._messageService.show({
|
|
367
372
|
content: this._localeService.t("hyperLink.message.noSheet"),
|
|
368
|
-
type:
|
|
373
|
+
type: ae.Error
|
|
369
374
|
});
|
|
370
375
|
return;
|
|
371
376
|
}
|
|
372
|
-
const o =
|
|
377
|
+
const o = i.getSheetId();
|
|
373
378
|
return n.getHiddenWorksheets().indexOf(o) > -1 && this._messageService.show({
|
|
374
379
|
content: this._localeService.t("hyperLink.message.hiddenSheet"),
|
|
375
|
-
type:
|
|
376
|
-
}), await this._commandService.executeCommand(
|
|
380
|
+
type: ae.Error
|
|
381
|
+
}), await this._commandService.executeCommand(we.id, { unitId: e, subUnitId: o });
|
|
377
382
|
}
|
|
378
383
|
async navigateToSheetById(e, t) {
|
|
379
|
-
const n = this._univerInstanceService.getUnit(e,
|
|
384
|
+
const n = this._univerInstanceService.getUnit(e, w.UNIVER_SHEET);
|
|
380
385
|
if (!n)
|
|
381
386
|
return !1;
|
|
382
|
-
const
|
|
383
|
-
if (
|
|
384
|
-
return
|
|
385
|
-
|
|
386
|
-
|
|
387
|
+
const r = n.getActiveSheet();
|
|
388
|
+
if (!r)
|
|
389
|
+
return !1;
|
|
390
|
+
if (r.getSheetId() === t)
|
|
391
|
+
return r;
|
|
392
|
+
const i = n.getSheetBySheetId(t);
|
|
393
|
+
return i ? n.getHiddenWorksheets().indexOf(t) > -1 ? (this._messageService.show({
|
|
387
394
|
content: this._localeService.t("hyperLink.message.hiddenSheet"),
|
|
388
|
-
type:
|
|
389
|
-
}), !1) : await this._commandService.executeCommand(
|
|
395
|
+
type: ae.Error
|
|
396
|
+
}), !1) : await this._commandService.executeCommand(we.id, { unitId: e, subUnitId: t }) ? i : !1 : (this._messageService.show({
|
|
390
397
|
content: this._localeService.t("hyperLink.message.noSheet"),
|
|
391
|
-
type:
|
|
398
|
+
type: ae.Error
|
|
392
399
|
}), !1);
|
|
393
400
|
}
|
|
394
401
|
async navigateToDefineName(e, t) {
|
|
@@ -398,32 +405,31 @@ let F = class {
|
|
|
398
405
|
window.open(e, "_blank", "noopener noreferrer");
|
|
399
406
|
}
|
|
400
407
|
};
|
|
401
|
-
|
|
402
|
-
ie(0,
|
|
403
|
-
ie(1,
|
|
404
|
-
ie(2,
|
|
405
|
-
ie(3,
|
|
406
|
-
ie(4,
|
|
407
|
-
],
|
|
408
|
-
const
|
|
409
|
-
function
|
|
410
|
-
return Number.isNaN(+e) ? e.startsWith("http://localhost:3002") || e.startsWith("localhost:3002") ? !0 : !!e.match(
|
|
408
|
+
W = mr([
|
|
409
|
+
ie(0, ue),
|
|
410
|
+
ie(1, F),
|
|
411
|
+
ie(2, jt),
|
|
412
|
+
ie(3, wt),
|
|
413
|
+
ie(4, h(pe))
|
|
414
|
+
], W);
|
|
415
|
+
const fr = /[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi, vr = new RegExp(fr);
|
|
416
|
+
function de(e) {
|
|
417
|
+
return Number.isNaN(+e) ? e.startsWith("http://localhost:3002") || e.startsWith("localhost:3002") ? !0 : !!e.match(vr) : !1;
|
|
411
418
|
}
|
|
412
|
-
function
|
|
419
|
+
function _r(e) {
|
|
413
420
|
return /^[a-zA-Z]+:\/\//.test(e);
|
|
414
421
|
}
|
|
415
|
-
function
|
|
422
|
+
function Cr(e) {
|
|
416
423
|
return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e);
|
|
417
424
|
}
|
|
418
425
|
function rt(e) {
|
|
419
|
-
if (
|
|
420
|
-
const t =
|
|
421
|
-
|
|
422
|
-
return n.hash;
|
|
426
|
+
if (de(e)) {
|
|
427
|
+
const t = _r(e) ? e : Cr(e) ? `mailto://${e}` : `http://${e}`, n = new URL(t);
|
|
428
|
+
return n.hostname === location.hostname && n.port === location.port && n.protocol === location.protocol && n.pathname === location.pathname && n.hash && !n.search ? n.hash : t;
|
|
423
429
|
}
|
|
424
430
|
return e;
|
|
425
431
|
}
|
|
426
|
-
function
|
|
432
|
+
function yr(e) {
|
|
427
433
|
if (e === null)
|
|
428
434
|
return "";
|
|
429
435
|
if (e != null && e.p) {
|
|
@@ -431,32 +437,32 @@ function mr(e) {
|
|
|
431
437
|
if (t == null)
|
|
432
438
|
return "";
|
|
433
439
|
const n = t.dataStream;
|
|
434
|
-
return n.substring(n.length - 2, n.length) ===
|
|
440
|
+
return n.substring(n.length - 2, n.length) === Jt ? n.substring(0, n.length - 2) : n;
|
|
435
441
|
}
|
|
436
442
|
return e == null ? void 0 : e.v;
|
|
437
443
|
}
|
|
438
|
-
const
|
|
439
|
-
cellLinkEditButtons:
|
|
440
|
-
},
|
|
444
|
+
const Sr = "univer-cell-link-edit-buttons", Lr = {
|
|
445
|
+
cellLinkEditButtons: Sr
|
|
446
|
+
}, Me = () => {
|
|
441
447
|
var te;
|
|
442
|
-
const [e, t] = re(""), [n,
|
|
448
|
+
const [e, t] = re(""), [n, r] = re(""), [i, o] = re(
|
|
443
449
|
"link"
|
|
444
450
|
/* link */
|
|
445
|
-
), [s, c] = re(""), a = k(
|
|
446
|
-
|
|
447
|
-
var
|
|
451
|
+
), [s, c] = re(""), a = k(pe), p = k(jt), m = k(ue), f = k(H), l = Ot(f.currentEditing$), g = k(T), S = k(W), v = k(F), [I, V] = re(!1), y = Rt(!1);
|
|
452
|
+
xn(() => {
|
|
453
|
+
var u, C, L;
|
|
448
454
|
if ((l == null ? void 0 : l.row) !== void 0 && l.column !== void 0) {
|
|
449
|
-
const
|
|
450
|
-
if (
|
|
451
|
-
const
|
|
452
|
-
if (t(
|
|
455
|
+
const _ = g.getHyperLinkByLocationSync(l.unitId, l.subUnitId, l.row, l.column);
|
|
456
|
+
if (_) {
|
|
457
|
+
const ge = S.parseHyperLink(_.payload);
|
|
458
|
+
if (t(_.id), r(_.display), ge.type === "outer") {
|
|
453
459
|
o(
|
|
454
460
|
"link"
|
|
455
461
|
/* link */
|
|
456
|
-
), c(
|
|
462
|
+
), c(ge.url), ge.url === _.display && (y.current = !0);
|
|
457
463
|
return;
|
|
458
464
|
} else {
|
|
459
|
-
const j =
|
|
465
|
+
const j = ge.searchObj;
|
|
460
466
|
if (j.rangeid) {
|
|
461
467
|
o(
|
|
462
468
|
"rangeid"
|
|
@@ -465,15 +471,15 @@ const gr = "univer-cell-link-edit-buttons", fr = {
|
|
|
465
471
|
return;
|
|
466
472
|
}
|
|
467
473
|
if (j.range) {
|
|
468
|
-
const
|
|
474
|
+
const Kt = j.gid && (L = (C = (u = m.getUnit(l.unitId)) == null ? void 0 : u.getSheetBySheetId(j.gid)) == null ? void 0 : C.getName()) != null ? L : "";
|
|
469
475
|
if (o(
|
|
470
476
|
"range"
|
|
471
477
|
/* range */
|
|
472
|
-
), j.range ===
|
|
478
|
+
), j.range === Ge)
|
|
473
479
|
c("");
|
|
474
480
|
else {
|
|
475
|
-
const ct =
|
|
476
|
-
c(ct), ct ===
|
|
481
|
+
const ct = Ut(Kt, Oe(j.range).range);
|
|
482
|
+
c(ct), ct === _.display && (y.current = !0);
|
|
477
483
|
}
|
|
478
484
|
return;
|
|
479
485
|
}
|
|
@@ -486,19 +492,19 @@ const gr = "univer-cell-link-edit-buttons", fr = {
|
|
|
486
492
|
}
|
|
487
493
|
}
|
|
488
494
|
}
|
|
489
|
-
const U =
|
|
495
|
+
const U = m.getUnit(l.unitId), R = U == null ? void 0 : U.getSheetBySheetId(l.subUnitId), zt = R == null ? void 0 : R.getCellRaw(l.row, l.column), We = yr(zt);
|
|
490
496
|
o(
|
|
491
497
|
"link"
|
|
492
498
|
/* link */
|
|
493
|
-
), c(""),
|
|
499
|
+
), c(""), r((We != null ? We : "").toString()), t("");
|
|
494
500
|
return;
|
|
495
501
|
}
|
|
496
502
|
o(
|
|
497
503
|
"link"
|
|
498
504
|
/* link */
|
|
499
|
-
), c(""),
|
|
500
|
-
}, [l, g, S,
|
|
501
|
-
const Y =
|
|
505
|
+
), c(""), r(""), t("");
|
|
506
|
+
}, [l, g, S, m]);
|
|
507
|
+
const Y = Tn(() => s, [i]), A = [
|
|
502
508
|
{
|
|
503
509
|
label: a.t("hyperLink.form.link"),
|
|
504
510
|
value: "link"
|
|
@@ -519,168 +525,169 @@ const gr = "univer-cell-link-edit-buttons", fr = {
|
|
|
519
525
|
value: "rangeid"
|
|
520
526
|
/* definedName */
|
|
521
527
|
}
|
|
522
|
-
],
|
|
523
|
-
if (!
|
|
528
|
+
], P = m.getCurrentUnitForType(w.UNIVER_SHEET);
|
|
529
|
+
if (!P)
|
|
524
530
|
return;
|
|
525
|
-
const G =
|
|
526
|
-
label:
|
|
527
|
-
value:
|
|
528
|
-
})),
|
|
529
|
-
if (
|
|
530
|
-
return rt(
|
|
531
|
-
if (
|
|
532
|
-
const L =
|
|
533
|
-
if (
|
|
534
|
-
return `#gid=${
|
|
531
|
+
const G = P.getHiddenWorksheets(), B = P.getSheets().map((u) => ({ label: u.getName(), value: u.getSheetId() })).filter((u) => G.indexOf(u.value) === -1), q = Object.values((te = p.getDefinedNameMap(P.getUnitId())) != null ? te : {}).map((u) => ({
|
|
532
|
+
label: u.name,
|
|
533
|
+
value: u.id
|
|
534
|
+
})), he = (u, C) => {
|
|
535
|
+
if (u === "link")
|
|
536
|
+
return rt(C);
|
|
537
|
+
if (u === "range") {
|
|
538
|
+
const L = Oe(C), _ = P.getSheetBySheetName(L.sheetName);
|
|
539
|
+
if (_)
|
|
540
|
+
return `#gid=${_.getSheetId()}&range=${Wn(L.range)}`;
|
|
535
541
|
}
|
|
536
|
-
return `#${
|
|
537
|
-
},
|
|
538
|
-
|
|
539
|
-
|
|
542
|
+
return `#${u}=${C}`;
|
|
543
|
+
}, De = Un((u) => {
|
|
544
|
+
var _;
|
|
545
|
+
const C = u[0];
|
|
546
|
+
if (!C || !Ye(C.range))
|
|
540
547
|
return;
|
|
541
|
-
|
|
542
|
-
const L =
|
|
543
|
-
c(L), L && (
|
|
544
|
-
}),
|
|
545
|
-
if (l && (e ? await v.executeCommand(
|
|
548
|
+
C.sheetName || (C.sheetName = ((_ = P.getActiveSheet()) == null ? void 0 : _.getName()) || "");
|
|
549
|
+
const L = Dn(C);
|
|
550
|
+
c(L), L && (y.current || !n) && (r(L), y.current = !0);
|
|
551
|
+
}), me = async () => {
|
|
552
|
+
if (l && (e ? await v.executeCommand(St.id, {
|
|
546
553
|
unitId: l.unitId,
|
|
547
554
|
subUnitId: l.subUnitId,
|
|
548
555
|
id: e,
|
|
549
556
|
payload: {
|
|
550
557
|
display: n,
|
|
551
|
-
payload:
|
|
558
|
+
payload: he(i, s)
|
|
552
559
|
}
|
|
553
|
-
}) : await v.executeCommand(
|
|
560
|
+
}) : await v.executeCommand(Lt.id, {
|
|
554
561
|
unitId: l.unitId,
|
|
555
562
|
subUnitId: l.subUnitId,
|
|
556
563
|
link: {
|
|
557
|
-
id:
|
|
564
|
+
id: le.generateRandomId(),
|
|
558
565
|
row: l.row,
|
|
559
566
|
column: l.column,
|
|
560
|
-
payload:
|
|
567
|
+
payload: he(i, s),
|
|
561
568
|
display: n
|
|
562
569
|
}
|
|
563
570
|
})), l) {
|
|
564
|
-
await v.executeCommand(
|
|
571
|
+
await v.executeCommand(we.id, {
|
|
565
572
|
unitId: l.unitId,
|
|
566
573
|
subUnitId: l.subUnitId
|
|
567
574
|
});
|
|
568
|
-
const
|
|
569
|
-
await v.executeCommand(
|
|
575
|
+
const u = 5;
|
|
576
|
+
await v.executeCommand(kt.id, {
|
|
570
577
|
range: {
|
|
571
|
-
startRow: Math.max(l.row -
|
|
572
|
-
endRow: l.row +
|
|
573
|
-
startColumn: Math.max(l.column -
|
|
574
|
-
endColumn: l.column +
|
|
578
|
+
startRow: Math.max(l.row - u, 0),
|
|
579
|
+
endRow: l.row + u,
|
|
580
|
+
startColumn: Math.max(l.column - u, 0),
|
|
581
|
+
endColumn: l.column + u
|
|
575
582
|
}
|
|
576
583
|
});
|
|
577
584
|
}
|
|
578
|
-
v.executeCommand(
|
|
585
|
+
v.executeCommand(xe.id);
|
|
579
586
|
};
|
|
580
|
-
return /* @__PURE__ */
|
|
581
|
-
/* @__PURE__ */
|
|
587
|
+
return /* @__PURE__ */ d.jsxs("div", { children: [
|
|
588
|
+
/* @__PURE__ */ d.jsx(
|
|
582
589
|
X,
|
|
583
590
|
{
|
|
584
591
|
label: a.t("hyperLink.form.label"),
|
|
585
592
|
error: I && !n ? a.t("hyperLink.form.inputError") : "",
|
|
586
|
-
children: /* @__PURE__ */
|
|
587
|
-
|
|
593
|
+
children: /* @__PURE__ */ d.jsx(
|
|
594
|
+
ht,
|
|
588
595
|
{
|
|
589
596
|
value: n,
|
|
590
|
-
onChange: (
|
|
591
|
-
|
|
597
|
+
onChange: (u) => {
|
|
598
|
+
r(u), y.current = !1;
|
|
592
599
|
},
|
|
593
600
|
placeholder: a.t("hyperLink.form.labelPlaceholder")
|
|
594
601
|
}
|
|
595
602
|
)
|
|
596
603
|
}
|
|
597
604
|
),
|
|
598
|
-
/* @__PURE__ */
|
|
599
|
-
|
|
605
|
+
/* @__PURE__ */ d.jsx(X, { label: a.t("hyperLink.form.type"), children: /* @__PURE__ */ d.jsx(
|
|
606
|
+
Ze,
|
|
600
607
|
{
|
|
601
608
|
options: A,
|
|
602
|
-
value:
|
|
603
|
-
onChange: (
|
|
604
|
-
o(
|
|
609
|
+
value: i,
|
|
610
|
+
onChange: (u) => {
|
|
611
|
+
o(u), c("");
|
|
605
612
|
}
|
|
606
613
|
}
|
|
607
614
|
) }),
|
|
608
|
-
|
|
615
|
+
i === "link" && /* @__PURE__ */ d.jsx(
|
|
609
616
|
X,
|
|
610
617
|
{
|
|
611
|
-
error: I ? s ?
|
|
612
|
-
children: /* @__PURE__ */
|
|
613
|
-
|
|
618
|
+
error: I ? s ? de(s) ? "" : a.t("hyperLink.form.linkError") : a.t("hyperLink.form.inputError") : "",
|
|
619
|
+
children: /* @__PURE__ */ d.jsx(
|
|
620
|
+
ht,
|
|
614
621
|
{
|
|
615
622
|
value: s,
|
|
616
|
-
onChange: (
|
|
617
|
-
c(
|
|
623
|
+
onChange: (u) => {
|
|
624
|
+
c(u), u && (y.current || !n || n === s) && (r(u), y.current = !0);
|
|
618
625
|
},
|
|
619
626
|
placeholder: a.t("hyperLink.form.linkPlaceholder")
|
|
620
627
|
}
|
|
621
628
|
)
|
|
622
629
|
}
|
|
623
630
|
),
|
|
624
|
-
|
|
625
|
-
|
|
631
|
+
i === "range" && /* @__PURE__ */ d.jsx(X, { error: I && !s ? a.t("hyperLink.form.inputError") : "", children: /* @__PURE__ */ d.jsx(
|
|
632
|
+
jn,
|
|
626
633
|
{
|
|
627
|
-
openForSheetUnitId:
|
|
628
|
-
id:
|
|
634
|
+
openForSheetUnitId: P.getUnitId(),
|
|
635
|
+
id: Qt("hyper-link-edit"),
|
|
629
636
|
isSingleChoice: !0,
|
|
630
637
|
value: Y,
|
|
631
|
-
onChange:
|
|
638
|
+
onChange: De
|
|
632
639
|
}
|
|
633
640
|
) }),
|
|
634
|
-
|
|
635
|
-
|
|
641
|
+
i === "gid" && /* @__PURE__ */ d.jsx(X, { error: I && !s ? a.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ d.jsx(
|
|
642
|
+
Ze,
|
|
636
643
|
{
|
|
637
644
|
options: B,
|
|
638
645
|
value: s,
|
|
639
|
-
onChange: (
|
|
640
|
-
var
|
|
641
|
-
c(
|
|
642
|
-
const
|
|
643
|
-
|
|
646
|
+
onChange: (u) => {
|
|
647
|
+
var _, U;
|
|
648
|
+
c(u);
|
|
649
|
+
const C = (_ = B.find((R) => R.value === u)) == null ? void 0 : _.label, L = (U = B.find((R) => R.value === s)) == null ? void 0 : U.label;
|
|
650
|
+
C && (y.current || !n || n === L) && (r(C), y.current = !0);
|
|
644
651
|
}
|
|
645
652
|
}
|
|
646
653
|
) }),
|
|
647
|
-
|
|
648
|
-
|
|
654
|
+
i === "rangeid" && /* @__PURE__ */ d.jsx(X, { error: I && !s ? a.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ d.jsx(
|
|
655
|
+
Ze,
|
|
649
656
|
{
|
|
650
657
|
options: q,
|
|
651
658
|
value: s,
|
|
652
|
-
onChange: (
|
|
653
|
-
var
|
|
654
|
-
c(
|
|
655
|
-
const
|
|
656
|
-
|
|
659
|
+
onChange: (u) => {
|
|
660
|
+
var _, U;
|
|
661
|
+
c(u);
|
|
662
|
+
const C = (_ = q.find((R) => R.value === u)) == null ? void 0 : _.label, L = (U = q.find((R) => R.value === s)) == null ? void 0 : U.label;
|
|
663
|
+
C && (y.current || !n || n === L) && (r(C), y.current = !0);
|
|
657
664
|
}
|
|
658
665
|
}
|
|
659
666
|
) }),
|
|
660
|
-
/* @__PURE__ */
|
|
661
|
-
/* @__PURE__ */
|
|
662
|
-
|
|
667
|
+
/* @__PURE__ */ d.jsxs("div", { className: Lr.cellLinkEditButtons, children: [
|
|
668
|
+
/* @__PURE__ */ d.jsx(
|
|
669
|
+
mt,
|
|
663
670
|
{
|
|
664
671
|
onClick: () => {
|
|
665
|
-
l && v.executeCommand(
|
|
672
|
+
l && v.executeCommand(we.id, {
|
|
666
673
|
unitId: l.unitId,
|
|
667
674
|
subUnitId: l.subUnitId
|
|
668
|
-
}), v.executeCommand(
|
|
675
|
+
}), v.executeCommand(xe.id);
|
|
669
676
|
},
|
|
670
677
|
children: a.t("hyperLink.form.cancel")
|
|
671
678
|
}
|
|
672
679
|
),
|
|
673
|
-
/* @__PURE__ */
|
|
674
|
-
|
|
680
|
+
/* @__PURE__ */ d.jsx(
|
|
681
|
+
mt,
|
|
675
682
|
{
|
|
676
683
|
type: "primary",
|
|
677
684
|
style: { marginLeft: 8 },
|
|
678
685
|
onClick: async () => {
|
|
679
|
-
if (!n || !s ||
|
|
680
|
-
|
|
686
|
+
if (!n || !s || i === "link" && !de(s)) {
|
|
687
|
+
V(!0);
|
|
681
688
|
return;
|
|
682
689
|
}
|
|
683
|
-
|
|
690
|
+
me();
|
|
684
691
|
},
|
|
685
692
|
children: a.t("hyperLink.form.ok")
|
|
686
693
|
}
|
|
@@ -688,42 +695,42 @@ const gr = "univer-cell-link-edit-buttons", fr = {
|
|
|
688
695
|
] })
|
|
689
696
|
] });
|
|
690
697
|
};
|
|
691
|
-
|
|
698
|
+
Me.componentKey = "univer.sheet.cell-link-edit";
|
|
692
699
|
const it = {
|
|
693
|
-
type:
|
|
700
|
+
type: je.OPERATION,
|
|
694
701
|
id: "sheet.operation.open-hyper-link-sidebar",
|
|
695
702
|
handler(e, t) {
|
|
696
703
|
if (!t)
|
|
697
704
|
return !1;
|
|
698
|
-
const { unitId: n, subUnitId:
|
|
705
|
+
const { unitId: n, subUnitId: r, row: i, column: o } = t, s = e.get(T), c = e.get(Et), a = e.get(H), p = s.getHyperLinkByLocation(n, r, i, o);
|
|
699
706
|
return a.startEditing(t), c.open({
|
|
700
707
|
header: {
|
|
701
708
|
title: p ? "hyperLink.form.editTitle" : "hyperLink.form.addTitle"
|
|
702
709
|
},
|
|
703
710
|
children: {
|
|
704
|
-
label:
|
|
711
|
+
label: Me.componentKey
|
|
705
712
|
}
|
|
706
713
|
}), !0;
|
|
707
714
|
}
|
|
708
|
-
},
|
|
709
|
-
type:
|
|
715
|
+
}, xe = {
|
|
716
|
+
type: je.OPERATION,
|
|
710
717
|
id: "sheet.operation.close-hyper-link-sidebar",
|
|
711
718
|
handler(e) {
|
|
712
|
-
const t = e.get(
|
|
719
|
+
const t = e.get(Et), n = e.get(H);
|
|
713
720
|
return t.close(), n.endEditing(), !0;
|
|
714
721
|
}
|
|
715
722
|
}, ot = {
|
|
716
|
-
type:
|
|
723
|
+
type: je.OPERATION,
|
|
717
724
|
id: "sheet.operation.insert-hyper-link",
|
|
718
725
|
handler(e) {
|
|
719
|
-
const t = e.get(
|
|
726
|
+
const t = e.get(ue), n = Ct(t);
|
|
720
727
|
if (!n)
|
|
721
728
|
return !1;
|
|
722
|
-
const
|
|
729
|
+
const r = e.get(F), o = e.get(yt).getFirst();
|
|
723
730
|
if (!(o != null && o.primary))
|
|
724
731
|
return !1;
|
|
725
732
|
const s = o.primary.startRow, c = o.primary.startColumn;
|
|
726
|
-
return
|
|
733
|
+
return r.executeCommand(it.id, {
|
|
727
734
|
unitId: n.unitId,
|
|
728
735
|
subUnitId: n.subUnitId,
|
|
729
736
|
row: s,
|
|
@@ -731,47 +738,47 @@ const it = {
|
|
|
731
738
|
});
|
|
732
739
|
}
|
|
733
740
|
}, st = {
|
|
734
|
-
type:
|
|
741
|
+
type: je.OPERATION,
|
|
735
742
|
id: "sheet.operation.insert-hyper-link-toolbar",
|
|
736
743
|
handler(e) {
|
|
737
|
-
const t = e.get(
|
|
738
|
-
return e.get(H).currentEditing ? t.executeCommand(
|
|
744
|
+
const t = e.get(F);
|
|
745
|
+
return e.get(H).currentEditing ? t.executeCommand(xe.id) : t.executeCommand(ot.id);
|
|
739
746
|
}
|
|
740
|
-
},
|
|
741
|
-
cellLink:
|
|
742
|
-
cellLinkType:
|
|
743
|
-
cellLinkContent:
|
|
744
|
-
cellLinkContentError:
|
|
745
|
-
cellLinkUrl:
|
|
746
|
-
cellLinkOperations:
|
|
747
|
-
cellLinkOperation:
|
|
748
|
-
cellLinkOperationError:
|
|
749
|
-
},
|
|
750
|
-
outer: /* @__PURE__ */
|
|
751
|
-
link: /* @__PURE__ */
|
|
752
|
-
sheet: /* @__PURE__ */
|
|
753
|
-
range: /* @__PURE__ */
|
|
754
|
-
defineName: /* @__PURE__ */
|
|
755
|
-
"range-error": /* @__PURE__ */
|
|
756
|
-
"sheet-error": /* @__PURE__ */
|
|
757
|
-
},
|
|
758
|
-
const e = k(H), t = k(T), n = k(
|
|
747
|
+
}, Ir = "univer-cell-link", kr = "univer-cell-link-type", Pr = "univer-cell-link-content", br = "univer-cell-link-content-error", Rr = "univer-cell-link-url", wr = "univer-cell-link-operations", Or = "univer-cell-link-operation", Er = "univer-cell-link-operation-error", E = {
|
|
748
|
+
cellLink: Ir,
|
|
749
|
+
cellLinkType: kr,
|
|
750
|
+
cellLinkContent: Pr,
|
|
751
|
+
cellLinkContentError: br,
|
|
752
|
+
cellLinkUrl: Rr,
|
|
753
|
+
cellLinkOperations: wr,
|
|
754
|
+
cellLinkOperation: Or,
|
|
755
|
+
cellLinkOperationError: Er
|
|
756
|
+
}, Mr = {
|
|
757
|
+
outer: /* @__PURE__ */ d.jsx(Ee, {}),
|
|
758
|
+
link: /* @__PURE__ */ d.jsx(Ee, {}),
|
|
759
|
+
sheet: /* @__PURE__ */ d.jsx(Je, {}),
|
|
760
|
+
range: /* @__PURE__ */ d.jsx(Se, {}),
|
|
761
|
+
defineName: /* @__PURE__ */ d.jsx(Se, {}),
|
|
762
|
+
"range-error": /* @__PURE__ */ d.jsx(Se, {}),
|
|
763
|
+
"sheet-error": /* @__PURE__ */ d.jsx(Je, {})
|
|
764
|
+
}, Te = () => {
|
|
765
|
+
const e = k(H), t = k(T), n = k(F), r = k(wt), i = k(pe), o = Ot(e.currentPopup$, e.currentPopup), s = k(W);
|
|
759
766
|
if (!o)
|
|
760
767
|
return null;
|
|
761
|
-
const { unitId: c, subUnitId: a, id: p } = o,
|
|
762
|
-
if (!
|
|
768
|
+
const { unitId: c, subUnitId: a, id: p } = o, m = t.getHyperLink(c, a, p);
|
|
769
|
+
if (!m)
|
|
763
770
|
return null;
|
|
764
|
-
const f = s.parseHyperLink(
|
|
765
|
-
return /* @__PURE__ */
|
|
766
|
-
/* @__PURE__ */
|
|
767
|
-
/* @__PURE__ */
|
|
768
|
-
/* @__PURE__ */
|
|
771
|
+
const f = s.parseHyperLink(m.payload), l = f.type.indexOf("error") > -1;
|
|
772
|
+
return /* @__PURE__ */ d.jsxs("div", { className: E.cellLink, onClick: () => e.hideCurrentPopup(), children: [
|
|
773
|
+
/* @__PURE__ */ d.jsxs("div", { className: pt(E.cellLinkContent, { [E.cellLinkContentError]: l }), onClick: f.handler, children: [
|
|
774
|
+
/* @__PURE__ */ d.jsx("div", { className: E.cellLinkType, children: Mr[f.type] }),
|
|
775
|
+
/* @__PURE__ */ d.jsx(ve, { showIfEllipsis: !0, title: f.name, children: /* @__PURE__ */ d.jsx("span", { className: E.cellLinkUrl, children: f.name }) })
|
|
769
776
|
] }),
|
|
770
|
-
/* @__PURE__ */
|
|
771
|
-
/* @__PURE__ */
|
|
777
|
+
/* @__PURE__ */ d.jsxs("div", { className: E.cellLinkOperations, children: [
|
|
778
|
+
o.copyPermission && /* @__PURE__ */ d.jsx(
|
|
772
779
|
"div",
|
|
773
780
|
{
|
|
774
|
-
className:
|
|
781
|
+
className: pt(E.cellLinkOperation, { [E.cellLinkOperationError]: l }),
|
|
775
782
|
onClick: () => {
|
|
776
783
|
if (!l) {
|
|
777
784
|
if (f.type !== "outer") {
|
|
@@ -779,62 +786,64 @@ const it = {
|
|
|
779
786
|
g.hash = f.url.slice(1), navigator.clipboard.writeText(g.href);
|
|
780
787
|
} else
|
|
781
788
|
navigator.clipboard.writeText(f.url);
|
|
782
|
-
|
|
783
|
-
content:
|
|
784
|
-
type:
|
|
789
|
+
r.show({
|
|
790
|
+
content: i.t("hyperLink.message.coped"),
|
|
791
|
+
type: ae.Info
|
|
785
792
|
});
|
|
786
793
|
}
|
|
787
794
|
},
|
|
788
|
-
children: /* @__PURE__ */
|
|
789
|
-
}
|
|
790
|
-
),
|
|
791
|
-
/* @__PURE__ */ u.jsx(
|
|
792
|
-
"div",
|
|
793
|
-
{
|
|
794
|
-
className: w.cellLinkOperation,
|
|
795
|
-
onClick: () => {
|
|
796
|
-
n.executeCommand(it.id, {
|
|
797
|
-
unitId: c,
|
|
798
|
-
subUnitId: a,
|
|
799
|
-
row: h.row,
|
|
800
|
-
column: h.column
|
|
801
|
-
});
|
|
802
|
-
},
|
|
803
|
-
children: /* @__PURE__ */ u.jsx(Be, { placement: "bottom", title: r.t("hyperLink.popup.edit"), children: /* @__PURE__ */ u.jsx(Dt, {}) })
|
|
795
|
+
children: /* @__PURE__ */ d.jsx(ve, { placement: "bottom", title: i.t("hyperLink.popup.copy"), children: /* @__PURE__ */ d.jsx(Bt, {}) })
|
|
804
796
|
}
|
|
805
797
|
),
|
|
806
|
-
/* @__PURE__ */
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
798
|
+
o.editPermission && /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
799
|
+
/* @__PURE__ */ d.jsx(
|
|
800
|
+
"div",
|
|
801
|
+
{
|
|
802
|
+
className: E.cellLinkOperation,
|
|
803
|
+
onClick: () => {
|
|
804
|
+
n.executeCommand(it.id, {
|
|
805
|
+
unitId: c,
|
|
806
|
+
subUnitId: a,
|
|
807
|
+
row: m.row,
|
|
808
|
+
column: m.column
|
|
809
|
+
});
|
|
810
|
+
},
|
|
811
|
+
children: /* @__PURE__ */ d.jsx(ve, { placement: "bottom", title: i.t("hyperLink.popup.edit"), children: /* @__PURE__ */ d.jsx(Dt, {}) })
|
|
812
|
+
}
|
|
813
|
+
),
|
|
814
|
+
/* @__PURE__ */ d.jsx(
|
|
815
|
+
"div",
|
|
816
|
+
{
|
|
817
|
+
className: E.cellLinkOperation,
|
|
818
|
+
onClick: () => {
|
|
819
|
+
n.executeCommand(_n.id, {
|
|
820
|
+
unitId: c,
|
|
821
|
+
subUnitId: a,
|
|
822
|
+
id: m.id
|
|
823
|
+
});
|
|
824
|
+
},
|
|
825
|
+
children: /* @__PURE__ */ d.jsx(ve, { placement: "bottom", title: i.t("hyperLink.popup.cancel"), children: /* @__PURE__ */ d.jsx(Vt, {}) })
|
|
826
|
+
}
|
|
827
|
+
)
|
|
828
|
+
] })
|
|
820
829
|
] })
|
|
821
830
|
] });
|
|
822
831
|
};
|
|
823
|
-
|
|
824
|
-
var
|
|
825
|
-
for (var
|
|
826
|
-
(s = e[o]) && (
|
|
827
|
-
return
|
|
828
|
-
},
|
|
829
|
-
const
|
|
832
|
+
Te.componentKey = "univer.sheet.cell-link-popup";
|
|
833
|
+
var xr = Object.defineProperty, Tr = Object.getOwnPropertyDescriptor, Ur = (e, t, n, r) => {
|
|
834
|
+
for (var i = r > 1 ? void 0 : r ? Tr(t, n) : t, o = e.length - 1, s; o >= 0; o--)
|
|
835
|
+
(s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
|
|
836
|
+
return r && i && xr(t, n, i), i;
|
|
837
|
+
}, gt = (e, t) => (n, r) => t(n, r, e);
|
|
838
|
+
const jr = (e, t) => e.unitId === t.unitId && e.subUnitId === t.subUnitId && e.row === t.row && e.col === t.col;
|
|
830
839
|
let H = class extends O {
|
|
831
840
|
constructor(t, n) {
|
|
832
841
|
super();
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
842
|
+
D(this, "_currentPopup", null);
|
|
843
|
+
D(this, "_currentPopup$", new wn());
|
|
844
|
+
D(this, "currentPopup$", this._currentPopup$.asObservable());
|
|
845
|
+
D(this, "_currentEditing$", new On(null));
|
|
846
|
+
D(this, "currentEditing$", this._currentEditing$.asObservable());
|
|
838
847
|
this._hyperLinkModel = t, this._sheetCanvasPopManagerService = n, this.disposeWithMe(() => {
|
|
839
848
|
this.hideCurrentPopup(), this.endEditing(), this._currentEditing$.complete(), this._currentPopup$.complete();
|
|
840
849
|
});
|
|
@@ -846,24 +855,29 @@ let H = class extends O {
|
|
|
846
855
|
return this._currentEditing$.getValue();
|
|
847
856
|
}
|
|
848
857
|
showPopup(t) {
|
|
849
|
-
if (this._currentPopup &&
|
|
858
|
+
if (this._currentPopup && jr(t, this._currentPopup))
|
|
850
859
|
return;
|
|
851
860
|
this.hideCurrentPopup();
|
|
852
|
-
const { unitId: n, subUnitId:
|
|
861
|
+
const { unitId: n, subUnitId: r, row: i, col: o } = t, s = this._hyperLinkModel.getHyperLinkByLocation(n, r, i, o);
|
|
853
862
|
if (!s)
|
|
854
863
|
return;
|
|
855
|
-
const c = this._sheetCanvasPopManagerService.attachPopupToCell(
|
|
856
|
-
componentKey:
|
|
864
|
+
const c = this._sheetCanvasPopManagerService.attachPopupToCell(i, o, {
|
|
865
|
+
componentKey: Te.componentKey,
|
|
857
866
|
direction: "bottom",
|
|
858
|
-
closeOnSelfTarget: !0
|
|
867
|
+
closeOnSelfTarget: !0,
|
|
868
|
+
onClickOutside: () => {
|
|
869
|
+
this.hideCurrentPopup();
|
|
870
|
+
}
|
|
859
871
|
});
|
|
860
872
|
c && (this._currentPopup = {
|
|
861
873
|
unitId: n,
|
|
862
|
-
subUnitId:
|
|
874
|
+
subUnitId: r,
|
|
863
875
|
id: s.id,
|
|
864
876
|
disposable: c,
|
|
865
|
-
row:
|
|
866
|
-
col: o
|
|
877
|
+
row: i,
|
|
878
|
+
col: o,
|
|
879
|
+
editPermission: !!t.editPermission,
|
|
880
|
+
copyPermission: !!t.copyPermission
|
|
867
881
|
}, this._currentPopup$.next(this._currentPopup));
|
|
868
882
|
}
|
|
869
883
|
hideCurrentPopup() {
|
|
@@ -877,18 +891,18 @@ let H = class extends O {
|
|
|
877
891
|
this._currentEditing$.next(null);
|
|
878
892
|
}
|
|
879
893
|
};
|
|
880
|
-
H =
|
|
881
|
-
|
|
882
|
-
|
|
894
|
+
H = Ur([
|
|
895
|
+
gt(0, h(T)),
|
|
896
|
+
gt(1, h(yn))
|
|
883
897
|
], H);
|
|
884
|
-
var
|
|
885
|
-
for (var
|
|
886
|
-
(s = e[o]) && (
|
|
887
|
-
return
|
|
888
|
-
}, oe = (e, t) => (n,
|
|
889
|
-
let
|
|
890
|
-
constructor(e, t, n,
|
|
891
|
-
super(), this._sheetInterceptorService = e, this._injector = t, this._hyperLinkModel = n, this._selectionManagerService =
|
|
898
|
+
var Hr = Object.defineProperty, Nr = Object.getOwnPropertyDescriptor, $r = (e, t, n, r) => {
|
|
899
|
+
for (var i = r > 1 ? void 0 : r ? Nr(t, n) : t, o = e.length - 1, s; o >= 0; o--)
|
|
900
|
+
(s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
|
|
901
|
+
return r && i && Hr(t, n, i), i;
|
|
902
|
+
}, oe = (e, t) => (n, r) => t(n, r, e);
|
|
903
|
+
let Le = class extends O {
|
|
904
|
+
constructor(e, t, n, r, i) {
|
|
905
|
+
super(), this._sheetInterceptorService = e, this._injector = t, this._hyperLinkModel = n, this._selectionManagerService = r, this._univerInstanceService = i, this._initCommandInterceptor();
|
|
892
906
|
}
|
|
893
907
|
_initCommandInterceptor() {
|
|
894
908
|
this._initAddHyperLinkCommandInterceptor(), this._initSetRangeValuesCommandInterceptor(), this._initUpdateHyperLinkCommandInterceptor(), this._initClearSelectionCommandInterceptor();
|
|
@@ -896,28 +910,31 @@ let Ce = class extends O {
|
|
|
896
910
|
_initAddHyperLinkCommandInterceptor() {
|
|
897
911
|
this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
|
|
898
912
|
getMutations: (e) => {
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
913
|
+
var t;
|
|
914
|
+
if (e.id === Lt.id) {
|
|
915
|
+
const n = e.params, { unitId: r, subUnitId: i, link: o } = n, s = this._getCurrentCell(r, i, o.row, o.column), c = {
|
|
916
|
+
unitId: r,
|
|
902
917
|
subUnitId: i,
|
|
903
918
|
cellValue: {
|
|
904
|
-
[
|
|
905
|
-
[
|
|
906
|
-
v:
|
|
907
|
-
t:
|
|
908
|
-
p: null
|
|
919
|
+
[o.row]: {
|
|
920
|
+
[o.column]: {
|
|
921
|
+
v: o.display,
|
|
922
|
+
// t: CellValueType.STRING, // Setting a link to a number is still a number
|
|
923
|
+
p: null,
|
|
924
|
+
t: (t = s == null ? void 0 : s.t) != null ? t : void 0
|
|
925
|
+
// Keep force string type
|
|
909
926
|
}
|
|
910
927
|
}
|
|
911
928
|
}
|
|
912
929
|
};
|
|
913
930
|
return {
|
|
914
931
|
redos: [{
|
|
915
|
-
id:
|
|
916
|
-
params:
|
|
932
|
+
id: fe.id,
|
|
933
|
+
params: c
|
|
917
934
|
}],
|
|
918
935
|
undos: [{
|
|
919
|
-
id:
|
|
920
|
-
params:
|
|
936
|
+
id: fe.id,
|
|
937
|
+
params: dt(this._injector, c)
|
|
921
938
|
}]
|
|
922
939
|
};
|
|
923
940
|
}
|
|
@@ -931,17 +948,17 @@ let Ce = class extends O {
|
|
|
931
948
|
_initUpdateHyperLinkCommandInterceptor() {
|
|
932
949
|
this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
|
|
933
950
|
getMutations: (e) => {
|
|
934
|
-
if (e.id ===
|
|
935
|
-
const t = e.params, { unitId: n, subUnitId:
|
|
951
|
+
if (e.id === St.id) {
|
|
952
|
+
const t = e.params, { unitId: n, subUnitId: r, id: i, payload: o } = t, s = this._hyperLinkModel.getHyperLink(n, r, i);
|
|
936
953
|
if (s && s.display !== o.display) {
|
|
937
954
|
const c = {
|
|
938
955
|
unitId: n,
|
|
939
|
-
subUnitId:
|
|
956
|
+
subUnitId: r,
|
|
940
957
|
cellValue: {
|
|
941
958
|
[s.row]: {
|
|
942
959
|
[s.column]: {
|
|
943
960
|
v: o.display,
|
|
944
|
-
t:
|
|
961
|
+
t: en.STRING,
|
|
945
962
|
p: null
|
|
946
963
|
}
|
|
947
964
|
}
|
|
@@ -949,12 +966,12 @@ let Ce = class extends O {
|
|
|
949
966
|
};
|
|
950
967
|
return {
|
|
951
968
|
redos: [{
|
|
952
|
-
id:
|
|
969
|
+
id: fe.id,
|
|
953
970
|
params: c
|
|
954
971
|
}],
|
|
955
972
|
undos: [{
|
|
956
|
-
id:
|
|
957
|
-
params:
|
|
973
|
+
id: fe.id,
|
|
974
|
+
params: dt(this._injector, c)
|
|
958
975
|
}]
|
|
959
976
|
};
|
|
960
977
|
}
|
|
@@ -969,56 +986,56 @@ let Ce = class extends O {
|
|
|
969
986
|
_initSetRangeValuesCommandInterceptor() {
|
|
970
987
|
this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
|
|
971
988
|
getMutations: (e) => {
|
|
972
|
-
if (e.id ===
|
|
973
|
-
const t = e.params, { unitId: n, subUnitId:
|
|
974
|
-
return t.cellValue && new
|
|
989
|
+
if (e.id === ln.id) {
|
|
990
|
+
const t = e.params, { unitId: n, subUnitId: r } = t, i = [], o = [];
|
|
991
|
+
return t.cellValue && new _t(t.cellValue).forValue((s, c, a) => {
|
|
975
992
|
var l, g, S;
|
|
976
|
-
const p = (S = a == null ? void 0 : a.v) != null ? S : (g = (l = a == null ? void 0 : a.p) == null ? void 0 : l.body) == null ? void 0 : g.dataStream.slice(0, -2),
|
|
993
|
+
const p = (S = a == null ? void 0 : a.v) != null ? S : (g = (l = a == null ? void 0 : a.p) == null ? void 0 : l.body) == null ? void 0 : g.dataStream.slice(0, -2), m = (p != null ? p : "").toString(), f = this._hyperLinkModel.getHyperLinkByLocation(n, r, s, c);
|
|
977
994
|
if (!f) {
|
|
978
|
-
if (
|
|
979
|
-
const v =
|
|
995
|
+
if (de(m)) {
|
|
996
|
+
const v = le.generateRandomId();
|
|
980
997
|
o.push({
|
|
981
998
|
id: M.id,
|
|
982
999
|
params: {
|
|
983
1000
|
unitId: n,
|
|
984
|
-
subUnitId:
|
|
1001
|
+
subUnitId: r,
|
|
985
1002
|
id: v
|
|
986
1003
|
}
|
|
987
|
-
}),
|
|
1004
|
+
}), i.push({
|
|
988
1005
|
id: x.id,
|
|
989
1006
|
params: {
|
|
990
1007
|
unitId: n,
|
|
991
|
-
subUnitId:
|
|
1008
|
+
subUnitId: r,
|
|
992
1009
|
link: {
|
|
993
1010
|
id: v,
|
|
994
1011
|
row: s,
|
|
995
1012
|
column: c,
|
|
996
|
-
display:
|
|
997
|
-
payload: rt(
|
|
1013
|
+
display: m,
|
|
1014
|
+
payload: rt(m)
|
|
998
1015
|
}
|
|
999
1016
|
}
|
|
1000
1017
|
});
|
|
1001
1018
|
}
|
|
1002
1019
|
return;
|
|
1003
1020
|
}
|
|
1004
|
-
p === "" && (
|
|
1021
|
+
p === "" && (i.push({
|
|
1005
1022
|
id: M.id,
|
|
1006
1023
|
params: {
|
|
1007
1024
|
unitId: n,
|
|
1008
|
-
subUnitId:
|
|
1025
|
+
subUnitId: r,
|
|
1009
1026
|
id: f.id
|
|
1010
1027
|
}
|
|
1011
1028
|
}), o.push({
|
|
1012
1029
|
id: x.id,
|
|
1013
1030
|
params: {
|
|
1014
1031
|
unitId: n,
|
|
1015
|
-
subUnitId:
|
|
1032
|
+
subUnitId: r,
|
|
1016
1033
|
link: f
|
|
1017
1034
|
}
|
|
1018
1035
|
}));
|
|
1019
1036
|
}), {
|
|
1020
1037
|
undos: o,
|
|
1021
|
-
redos:
|
|
1038
|
+
redos: i
|
|
1022
1039
|
};
|
|
1023
1040
|
}
|
|
1024
1041
|
return {
|
|
@@ -1031,11 +1048,11 @@ let Ce = class extends O {
|
|
|
1031
1048
|
_initClearSelectionCommandInterceptor() {
|
|
1032
1049
|
this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
|
|
1033
1050
|
getMutations: (e) => {
|
|
1034
|
-
if (e.id ===
|
|
1035
|
-
const t = [], n = [],
|
|
1036
|
-
if (
|
|
1037
|
-
const { unitId: o, subUnitId: s } =
|
|
1038
|
-
|
|
1051
|
+
if (e.id === dn.id || e.id === un.id || e.id === pn.id) {
|
|
1052
|
+
const t = [], n = [], r = this._selectionManagerService.getFirst(), i = Ct(this._univerInstanceService);
|
|
1053
|
+
if (r && i) {
|
|
1054
|
+
const { unitId: o, subUnitId: s } = i;
|
|
1055
|
+
Qe.foreach(r.range, (c, a) => {
|
|
1039
1056
|
const p = this._hyperLinkModel.getHyperLinkByLocation(o, s, c, a);
|
|
1040
1057
|
p && (t.push({
|
|
1041
1058
|
id: M.id,
|
|
@@ -1066,87 +1083,108 @@ let Ce = class extends O {
|
|
|
1066
1083
|
}
|
|
1067
1084
|
}));
|
|
1068
1085
|
}
|
|
1086
|
+
_getCurrentCell(e, t, n, r) {
|
|
1087
|
+
var i, o;
|
|
1088
|
+
return (o = (i = this._univerInstanceService.getUnit(e, w.UNIVER_SHEET)) == null ? void 0 : i.getSheetBySheetId(t)) == null ? void 0 : o.getCell(n, r);
|
|
1089
|
+
}
|
|
1069
1090
|
};
|
|
1070
|
-
|
|
1071
|
-
N($.Starting,
|
|
1072
|
-
oe(0,
|
|
1073
|
-
oe(1,
|
|
1074
|
-
oe(2,
|
|
1075
|
-
oe(3,
|
|
1076
|
-
oe(4,
|
|
1077
|
-
],
|
|
1078
|
-
var
|
|
1079
|
-
for (var
|
|
1080
|
-
(s = e[o]) && (
|
|
1081
|
-
return
|
|
1082
|
-
},
|
|
1083
|
-
let
|
|
1084
|
-
constructor(e, t, n) {
|
|
1085
|
-
super(), this._hoverManagerService = e, this._sheetsHyperLinkPopupService = t, this._renderManagerService = n, this._initHoverListener();
|
|
1091
|
+
Le = $r([
|
|
1092
|
+
N($.Starting, Le),
|
|
1093
|
+
oe(0, h(et)),
|
|
1094
|
+
oe(1, h(Be)),
|
|
1095
|
+
oe(2, h(T)),
|
|
1096
|
+
oe(3, h(yt)),
|
|
1097
|
+
oe(4, ue)
|
|
1098
|
+
], Le);
|
|
1099
|
+
var Ar = Object.defineProperty, Br = Object.getOwnPropertyDescriptor, Vr = (e, t, n, r) => {
|
|
1100
|
+
for (var i = r > 1 ? void 0 : r ? Br(t, n) : t, o = e.length - 1, s; o >= 0; o--)
|
|
1101
|
+
(s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
|
|
1102
|
+
return r && i && Ar(t, n, i), i;
|
|
1103
|
+
}, se = (e, t) => (n, r) => t(n, r, e);
|
|
1104
|
+
let Ie = class extends O {
|
|
1105
|
+
constructor(e, t, n, r, i) {
|
|
1106
|
+
super(), this._hoverManagerService = e, this._sheetsHyperLinkPopupService = t, this._renderManagerService = n, this._permissionService = r, this._sheetPermissionInterceptorBaseController = i, this._initHoverListener();
|
|
1086
1107
|
}
|
|
1087
1108
|
_initHoverListener() {
|
|
1088
1109
|
this.disposeWithMe(
|
|
1089
|
-
this._hoverManagerService.currentCell$.pipe(
|
|
1090
|
-
var
|
|
1110
|
+
this._hoverManagerService.currentCell$.pipe(En(100)).subscribe((e) => {
|
|
1111
|
+
var f, l;
|
|
1091
1112
|
if (!e) {
|
|
1092
1113
|
this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
1093
1114
|
return;
|
|
1094
1115
|
}
|
|
1095
|
-
const t = (
|
|
1096
|
-
let
|
|
1097
|
-
t && t.overflowCache.forValue((
|
|
1098
|
-
ee.contains(
|
|
1099
|
-
}), this.
|
|
1116
|
+
const t = (l = (f = this._renderManagerService.getRenderById(e.location.unitId)) == null ? void 0 : f.with(It).getUnitSkeleton(e.location.unitId, e.location.subUnitId)) == null ? void 0 : l.skeleton, n = e.location.col, r = e.location.row;
|
|
1117
|
+
let i = r, o = n;
|
|
1118
|
+
if (t && t.overflowCache.forValue((g, S, v) => {
|
|
1119
|
+
ee.contains(v, { startColumn: n, endColumn: n, startRow: r, endRow: r }) && (i = g, o = S);
|
|
1120
|
+
}), !this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
|
1121
|
+
workbookTypes: [hn],
|
|
1122
|
+
worksheetTypes: [mn],
|
|
1123
|
+
rangeTypes: [gn]
|
|
1124
|
+
}, [{ startRow: r, startColumn: n, endRow: r, endColumn: n }])) {
|
|
1125
|
+
this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
1126
|
+
return;
|
|
1127
|
+
}
|
|
1128
|
+
const c = this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
|
1129
|
+
workbookTypes: [He],
|
|
1130
|
+
worksheetTypes: [Ne, $e],
|
|
1131
|
+
rangeTypes: [Ae]
|
|
1132
|
+
}, [{ startRow: r, startColumn: n, endRow: r, endColumn: n }]), a = e.location.unitId, p = e.location.subUnitId, m = this._permissionService.composePermission([new fn(a).id, new vn(a, p).id]).every((g) => g.value);
|
|
1133
|
+
this._sheetsHyperLinkPopupService.showPopup({
|
|
1100
1134
|
...e.location,
|
|
1101
|
-
row:
|
|
1102
|
-
col: o
|
|
1135
|
+
row: i,
|
|
1136
|
+
col: o,
|
|
1137
|
+
editPermission: c,
|
|
1138
|
+
copyPermission: m
|
|
1103
1139
|
});
|
|
1104
1140
|
})
|
|
1105
1141
|
);
|
|
1106
1142
|
}
|
|
1107
1143
|
};
|
|
1108
|
-
|
|
1109
|
-
N($.Rendered,
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1144
|
+
Ie = Vr([
|
|
1145
|
+
N($.Rendered, Ie),
|
|
1146
|
+
se(0, h(Sn)),
|
|
1147
|
+
se(1, h(H)),
|
|
1148
|
+
se(2, h(nt)),
|
|
1149
|
+
se(3, h(tn)),
|
|
1150
|
+
se(4, h(Pt))
|
|
1151
|
+
], Ie);
|
|
1152
|
+
const Dr = (e) => ({
|
|
1115
1153
|
id: ot.id,
|
|
1116
|
-
type:
|
|
1117
|
-
positions: [
|
|
1154
|
+
type: Mt.BUTTON,
|
|
1155
|
+
positions: [xt.CONTEXT_MENU],
|
|
1118
1156
|
title: "hyperLink.menu.add",
|
|
1119
|
-
hidden$:
|
|
1157
|
+
hidden$: Tt(e, w.UNIVER_SHEET),
|
|
1120
1158
|
icon: "LinkSingle",
|
|
1121
|
-
disabled$:
|
|
1122
|
-
}),
|
|
1159
|
+
disabled$: bt(e, { workbookTypes: [He], worksheetTypes: [Ne, tt, $e], rangeTypes: [Ae] })
|
|
1160
|
+
}), Wr = (e) => ({
|
|
1123
1161
|
tooltip: "hyperLink.form.addTitle",
|
|
1124
|
-
positions:
|
|
1125
|
-
group:
|
|
1162
|
+
positions: xt.TOOLBAR_START,
|
|
1163
|
+
group: $n.TOOLBAR_OTHERS,
|
|
1126
1164
|
id: st.id,
|
|
1127
|
-
type:
|
|
1165
|
+
type: Mt.BUTTON,
|
|
1128
1166
|
icon: "LinkSingle",
|
|
1129
|
-
hidden$:
|
|
1130
|
-
disabled$:
|
|
1131
|
-
}),
|
|
1167
|
+
hidden$: Tt(e, w.UNIVER_SHEET),
|
|
1168
|
+
disabled$: bt(e, { workbookTypes: [He], worksheetTypes: [Ne, tt, $e], rangeTypes: [Ae] })
|
|
1169
|
+
}), Wt = {
|
|
1132
1170
|
id: st.id,
|
|
1133
|
-
binding:
|
|
1134
|
-
preconditions:
|
|
1171
|
+
binding: Hn.K | Nn.CTRL_COMMAND,
|
|
1172
|
+
preconditions: Ln
|
|
1135
1173
|
};
|
|
1136
|
-
var
|
|
1137
|
-
for (var
|
|
1138
|
-
(s = e[o]) && (
|
|
1139
|
-
return
|
|
1140
|
-
}, J = (e, t) => (n,
|
|
1141
|
-
let
|
|
1142
|
-
constructor(e, t, n,
|
|
1143
|
-
super(), this._config = e, this._componentManager = t, this._commandService = n, this._localeService =
|
|
1174
|
+
var Fr = Object.defineProperty, Zr = Object.getOwnPropertyDescriptor, zr = (e, t, n, r) => {
|
|
1175
|
+
for (var i = r > 1 ? void 0 : r ? Zr(t, n) : t, o = e.length - 1, s; o >= 0; o--)
|
|
1176
|
+
(s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
|
|
1177
|
+
return r && i && Fr(t, n, i), i;
|
|
1178
|
+
}, J = (e, t) => (n, r) => t(n, r, e);
|
|
1179
|
+
let ce = class extends O {
|
|
1180
|
+
constructor(e, t, n, r, i, o, s) {
|
|
1181
|
+
super(), this._config = e, this._componentManager = t, this._commandService = n, this._localeService = r, this._menuService = i, this._injector = o, this._shortcutService = s, this._initComponents(), this._initCommands(), this._initMenus(), this._initShortCut();
|
|
1144
1182
|
}
|
|
1145
1183
|
_initComponents() {
|
|
1146
1184
|
[
|
|
1185
|
+
[Te, Te.componentKey],
|
|
1147
1186
|
[Me, Me.componentKey],
|
|
1148
|
-
[
|
|
1149
|
-
[Oe, "LinkSingle"]
|
|
1187
|
+
[Ee, "LinkSingle"]
|
|
1150
1188
|
].forEach(([e, t]) => {
|
|
1151
1189
|
this._componentManager.register(t, e);
|
|
1152
1190
|
});
|
|
@@ -1154,7 +1192,7 @@ let ae = class extends O {
|
|
|
1154
1192
|
_initCommands() {
|
|
1155
1193
|
[
|
|
1156
1194
|
it,
|
|
1157
|
-
|
|
1195
|
+
xe,
|
|
1158
1196
|
ot,
|
|
1159
1197
|
st
|
|
1160
1198
|
].forEach((e) => {
|
|
@@ -1162,52 +1200,52 @@ let ae = class extends O {
|
|
|
1162
1200
|
});
|
|
1163
1201
|
}
|
|
1164
1202
|
_initMenus() {
|
|
1165
|
-
var e, t, n,
|
|
1166
|
-
this._menuService.addMenuItem(
|
|
1203
|
+
var e, t, n, r;
|
|
1204
|
+
this._menuService.addMenuItem(Dr(this._injector), (t = (e = this._config) == null ? void 0 : e.menu) != null ? t : {}), this._menuService.addMenuItem(Wr(this._injector), (r = (n = this._config) == null ? void 0 : n.menu) != null ? r : {});
|
|
1167
1205
|
}
|
|
1168
1206
|
_initShortCut() {
|
|
1169
|
-
this._shortcutService.registerShortcut(
|
|
1207
|
+
this._shortcutService.registerShortcut(Wt);
|
|
1170
1208
|
}
|
|
1171
1209
|
};
|
|
1172
|
-
|
|
1173
|
-
N($.Ready,
|
|
1174
|
-
J(1,
|
|
1175
|
-
J(2,
|
|
1176
|
-
J(3,
|
|
1177
|
-
J(4,
|
|
1178
|
-
J(5,
|
|
1179
|
-
J(6,
|
|
1180
|
-
],
|
|
1210
|
+
ce = zr([
|
|
1211
|
+
N($.Ready, ce),
|
|
1212
|
+
J(1, h(An)),
|
|
1213
|
+
J(2, F),
|
|
1214
|
+
J(3, h(pe)),
|
|
1215
|
+
J(4, Vn),
|
|
1216
|
+
J(5, h(Be)),
|
|
1217
|
+
J(6, h(Bn))
|
|
1218
|
+
], ce);
|
|
1181
1219
|
const at = "SHEET_HYPER_LINK_UI_PLUGIN";
|
|
1182
|
-
var
|
|
1183
|
-
for (var
|
|
1184
|
-
(s = e[o]) && (
|
|
1185
|
-
return
|
|
1186
|
-
},
|
|
1187
|
-
let
|
|
1220
|
+
var Kr = Object.defineProperty, Yr = Object.getOwnPropertyDescriptor, Gr = (e, t, n, r) => {
|
|
1221
|
+
for (var i = r > 1 ? void 0 : r ? Yr(t, n) : t, o = e.length - 1, s; o >= 0; o--)
|
|
1222
|
+
(s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
|
|
1223
|
+
return r && i && Kr(t, n, i), i;
|
|
1224
|
+
}, ft = (e, t) => (n, r) => t(n, r, e);
|
|
1225
|
+
let ke = class extends O {
|
|
1188
1226
|
constructor(e, t) {
|
|
1189
1227
|
super(), this._autoFillService = e, this._hyperLinkModel = t, this._initAutoFill();
|
|
1190
1228
|
}
|
|
1191
1229
|
// eslint-disable-next-line max-lines-per-function
|
|
1192
1230
|
_initAutoFill() {
|
|
1193
|
-
const e = () => ({ redos: [], undos: [] }), t = (
|
|
1194
|
-
const { source: o, target: s, unitId: c, subUnitId: a } =
|
|
1195
|
-
row:
|
|
1196
|
-
col:
|
|
1197
|
-
}, S =
|
|
1198
|
-
return S.forEach((
|
|
1199
|
-
const
|
|
1231
|
+
const e = () => ({ redos: [], undos: [] }), t = (r, i) => {
|
|
1232
|
+
const { source: o, target: s, unitId: c, subUnitId: a } = r, p = qe([o, s]), [m, f] = p.ranges, { mapFunc: l } = p, g = {
|
|
1233
|
+
row: m.startRow,
|
|
1234
|
+
col: m.startColumn
|
|
1235
|
+
}, S = kn(m, f), v = [], I = [];
|
|
1236
|
+
return S.forEach((V) => {
|
|
1237
|
+
const y = V.repeatStartCell, Y = V.relativeRange, A = {
|
|
1200
1238
|
startRow: g.row,
|
|
1201
1239
|
startColumn: g.col,
|
|
1202
1240
|
endColumn: g.col,
|
|
1203
1241
|
endRow: g.row
|
|
1204
|
-
},
|
|
1205
|
-
startRow:
|
|
1206
|
-
startColumn:
|
|
1207
|
-
endColumn:
|
|
1208
|
-
endRow:
|
|
1242
|
+
}, P = {
|
|
1243
|
+
startRow: y.row,
|
|
1244
|
+
startColumn: y.col,
|
|
1245
|
+
endColumn: y.col,
|
|
1246
|
+
endRow: y.row
|
|
1209
1247
|
};
|
|
1210
|
-
|
|
1248
|
+
Qe.foreach(Y, (G, B) => {
|
|
1211
1249
|
const q = ee.getPositionRange(
|
|
1212
1250
|
{
|
|
1213
1251
|
startRow: G,
|
|
@@ -1216,8 +1254,8 @@ let Le = class extends O {
|
|
|
1216
1254
|
endRow: G
|
|
1217
1255
|
},
|
|
1218
1256
|
A
|
|
1219
|
-
), { row:
|
|
1220
|
-
if (
|
|
1257
|
+
), { row: he, col: De } = l(q.startRow, q.startColumn), me = this._hyperLinkModel.getHyperLinkByLocation(c, a, he, De);
|
|
1258
|
+
if (me) {
|
|
1221
1259
|
const te = ee.getPositionRange(
|
|
1222
1260
|
{
|
|
1223
1261
|
startRow: G,
|
|
@@ -1225,25 +1263,25 @@ let Le = class extends O {
|
|
|
1225
1263
|
endColumn: B,
|
|
1226
1264
|
endRow: G
|
|
1227
1265
|
},
|
|
1228
|
-
|
|
1229
|
-
), { row:
|
|
1230
|
-
|
|
1266
|
+
P
|
|
1267
|
+
), { row: u, col: C } = l(te.startRow, te.startColumn), L = le.generateRandomId(), _ = this._hyperLinkModel.getHyperLinkByLocation(c, a, u, C);
|
|
1268
|
+
_ && v.push({
|
|
1231
1269
|
id: M.id,
|
|
1232
1270
|
params: {
|
|
1233
1271
|
unitId: c,
|
|
1234
1272
|
subUnitId: a,
|
|
1235
|
-
id:
|
|
1273
|
+
id: _.id
|
|
1236
1274
|
}
|
|
1237
|
-
}), (ne.COPY ===
|
|
1275
|
+
}), (ne.COPY === i || ne.SERIES === i) && (v.push({
|
|
1238
1276
|
id: x.id,
|
|
1239
1277
|
params: {
|
|
1240
1278
|
unitId: c,
|
|
1241
1279
|
subUnitId: a,
|
|
1242
1280
|
link: {
|
|
1243
|
-
...
|
|
1281
|
+
...me,
|
|
1244
1282
|
id: L,
|
|
1245
|
-
row:
|
|
1246
|
-
column:
|
|
1283
|
+
row: u,
|
|
1284
|
+
column: C
|
|
1247
1285
|
}
|
|
1248
1286
|
}
|
|
1249
1287
|
}), I.push({
|
|
@@ -1253,12 +1291,12 @@ let Le = class extends O {
|
|
|
1253
1291
|
subUnitId: a,
|
|
1254
1292
|
id: L
|
|
1255
1293
|
}
|
|
1256
|
-
})),
|
|
1294
|
+
})), _ && I.push({
|
|
1257
1295
|
id: x.id,
|
|
1258
1296
|
params: {
|
|
1259
1297
|
unitId: c,
|
|
1260
1298
|
subUnitId: a,
|
|
1261
|
-
link:
|
|
1299
|
+
link: _
|
|
1262
1300
|
}
|
|
1263
1301
|
});
|
|
1264
1302
|
}
|
|
@@ -1269,39 +1307,39 @@ let Le = class extends O {
|
|
|
1269
1307
|
};
|
|
1270
1308
|
}, n = {
|
|
1271
1309
|
id: at,
|
|
1272
|
-
onFillData: (
|
|
1310
|
+
onFillData: (r, i, o) => o === ne.COPY || o === ne.ONLY_FORMAT || o === ne.SERIES ? t(r, o) : e()
|
|
1273
1311
|
};
|
|
1274
1312
|
this.disposeWithMe(this._autoFillService.addHook(n));
|
|
1275
1313
|
}
|
|
1276
1314
|
};
|
|
1277
|
-
|
|
1278
|
-
N($.Ready,
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
],
|
|
1282
|
-
var
|
|
1283
|
-
for (var
|
|
1284
|
-
(s = e[o]) && (
|
|
1285
|
-
return
|
|
1286
|
-
},
|
|
1287
|
-
let
|
|
1288
|
-
constructor(t, n,
|
|
1315
|
+
ke = Gr([
|
|
1316
|
+
N($.Ready, ke),
|
|
1317
|
+
ft(0, In),
|
|
1318
|
+
ft(1, h(T))
|
|
1319
|
+
], ke);
|
|
1320
|
+
var qr = Object.defineProperty, Xr = Object.getOwnPropertyDescriptor, Jr = (e, t, n, r) => {
|
|
1321
|
+
for (var i = r > 1 ? void 0 : r ? Xr(t, n) : t, o = e.length - 1, s; o >= 0; o--)
|
|
1322
|
+
(s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
|
|
1323
|
+
return r && i && qr(t, n, i), i;
|
|
1324
|
+
}, _e = (e, t) => (n, r) => t(n, r, e);
|
|
1325
|
+
let Pe = class extends O {
|
|
1326
|
+
constructor(t, n, r, i) {
|
|
1289
1327
|
super();
|
|
1290
|
-
|
|
1291
|
-
this._sheetClipboardService = t, this._hyperLinkModel = n, this._injector =
|
|
1328
|
+
D(this, "_copyInfo");
|
|
1329
|
+
this._sheetClipboardService = t, this._hyperLinkModel = n, this._injector = r, this._resolverService = i, this._initCopyPaste();
|
|
1292
1330
|
}
|
|
1293
1331
|
_initCopyPaste() {
|
|
1294
1332
|
this._sheetClipboardService.addClipboardHook({
|
|
1295
1333
|
id: at,
|
|
1296
|
-
onBeforeCopy: (t, n,
|
|
1297
|
-
onPasteCells: (t, n,
|
|
1298
|
-
const { copyType: o =
|
|
1299
|
-
return this._generateMutations(a, { copyType: o, pasteType: s, copyRange: c, unitId: p, subUnitId:
|
|
1334
|
+
onBeforeCopy: (t, n, r) => this._collect(t, n, r),
|
|
1335
|
+
onPasteCells: (t, n, r, i) => {
|
|
1336
|
+
const { copyType: o = ut.COPY, pasteType: s } = i, { range: c } = t || {}, { range: a, unitId: p, subUnitId: m } = n;
|
|
1337
|
+
return this._generateMutations(a, { copyType: o, pasteType: s, copyRange: c, unitId: p, subUnitId: m });
|
|
1300
1338
|
},
|
|
1301
1339
|
onPastePlainText: (t, n) => {
|
|
1302
|
-
if (
|
|
1303
|
-
const
|
|
1304
|
-
return
|
|
1340
|
+
if (de(n)) {
|
|
1341
|
+
const r = rt(n), { range: i, unitId: o, subUnitId: s } = t, { ranges: [c], mapFunc: a } = qe([i]), p = [], m = [];
|
|
1342
|
+
return Qe.foreach(c, (f, l) => {
|
|
1305
1343
|
const { row: g, col: S } = a(f, l), v = this._hyperLinkModel.getHyperLinkByLocation(o, s, g, S);
|
|
1306
1344
|
v && p.push({
|
|
1307
1345
|
id: M.id,
|
|
@@ -1311,7 +1349,7 @@ let Ie = class extends O {
|
|
|
1311
1349
|
id: v.id
|
|
1312
1350
|
}
|
|
1313
1351
|
});
|
|
1314
|
-
const I =
|
|
1352
|
+
const I = le.generateRandomId();
|
|
1315
1353
|
p.push({
|
|
1316
1354
|
id: x.id,
|
|
1317
1355
|
params: {
|
|
@@ -1321,17 +1359,17 @@ let Ie = class extends O {
|
|
|
1321
1359
|
id: I,
|
|
1322
1360
|
row: g,
|
|
1323
1361
|
column: S,
|
|
1324
|
-
payload:
|
|
1362
|
+
payload: r
|
|
1325
1363
|
}
|
|
1326
1364
|
}
|
|
1327
|
-
}),
|
|
1365
|
+
}), m.push({
|
|
1328
1366
|
id: M.id,
|
|
1329
1367
|
params: {
|
|
1330
1368
|
unitId: o,
|
|
1331
1369
|
subUnitId: s,
|
|
1332
1370
|
id: I
|
|
1333
1371
|
}
|
|
1334
|
-
}), v &&
|
|
1372
|
+
}), v && m.push({
|
|
1335
1373
|
id: x.id,
|
|
1336
1374
|
params: {
|
|
1337
1375
|
unitId: o,
|
|
@@ -1339,30 +1377,30 @@ let Ie = class extends O {
|
|
|
1339
1377
|
link: v
|
|
1340
1378
|
}
|
|
1341
1379
|
});
|
|
1342
|
-
}), { redos: p, undos:
|
|
1380
|
+
}), { redos: p, undos: m };
|
|
1343
1381
|
}
|
|
1344
1382
|
return { undos: [], redos: [] };
|
|
1345
1383
|
}
|
|
1346
1384
|
});
|
|
1347
1385
|
}
|
|
1348
|
-
_collect(t, n,
|
|
1349
|
-
const
|
|
1386
|
+
_collect(t, n, r) {
|
|
1387
|
+
const i = new _t();
|
|
1350
1388
|
this._copyInfo = {
|
|
1351
1389
|
unitId: t,
|
|
1352
1390
|
subUnitId: n,
|
|
1353
|
-
matrix:
|
|
1391
|
+
matrix: i
|
|
1354
1392
|
};
|
|
1355
1393
|
const o = {
|
|
1356
1394
|
get: this._injector.get.bind(this._injector)
|
|
1357
|
-
}, s =
|
|
1395
|
+
}, s = Pn(r, o, t, n);
|
|
1358
1396
|
if (!s)
|
|
1359
1397
|
return;
|
|
1360
1398
|
const { rows: c, cols: a } = s;
|
|
1361
|
-
c.forEach((p,
|
|
1399
|
+
c.forEach((p, m) => {
|
|
1362
1400
|
a.forEach((f, l) => {
|
|
1363
1401
|
var S;
|
|
1364
1402
|
const g = this._hyperLinkModel.getHyperLinkByLocation(t, n, p, f);
|
|
1365
|
-
|
|
1403
|
+
i.setValue(m, l, (S = g == null ? void 0 : g.id) != null ? S : "");
|
|
1366
1404
|
});
|
|
1367
1405
|
});
|
|
1368
1406
|
}
|
|
@@ -1370,21 +1408,21 @@ let Ie = class extends O {
|
|
|
1370
1408
|
_generateMutations(t, n) {
|
|
1371
1409
|
if (!this._copyInfo)
|
|
1372
1410
|
return { redos: [], undos: [] };
|
|
1373
|
-
if (n.copyType ===
|
|
1411
|
+
if (n.copyType === ut.CUT)
|
|
1374
1412
|
return this._copyInfo = null, { redos: [], undos: [] };
|
|
1375
1413
|
if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !n.copyRange)
|
|
1376
1414
|
return { redos: [], undos: [] };
|
|
1377
1415
|
if ([
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1416
|
+
Fe.SPECIAL_PASTE_COL_WIDTH,
|
|
1417
|
+
Fe.SPECIAL_PASTE_VALUE,
|
|
1418
|
+
Fe.SPECIAL_PASTE_FORMAT,
|
|
1419
|
+
Fn
|
|
1382
1420
|
].includes(
|
|
1383
1421
|
n.pasteType
|
|
1384
1422
|
))
|
|
1385
1423
|
return { redos: [], undos: [] };
|
|
1386
|
-
const { unitId:
|
|
1387
|
-
return
|
|
1424
|
+
const { unitId: r, subUnitId: i } = this._copyInfo, o = [], s = [], { ranges: [c, a], mapFunc: p } = qe([n.copyRange, t]);
|
|
1425
|
+
return bn(c, a, !0).forEach(({ startRange: f }) => {
|
|
1388
1426
|
var l;
|
|
1389
1427
|
(l = this._copyInfo) == null || l.matrix.forValue((g, S, v) => {
|
|
1390
1428
|
const I = ee.getPositionRange(
|
|
@@ -1395,7 +1433,7 @@ let Ie = class extends O {
|
|
|
1395
1433
|
endColumn: S
|
|
1396
1434
|
},
|
|
1397
1435
|
f
|
|
1398
|
-
),
|
|
1436
|
+
), V = this._hyperLinkModel.getHyperLink(r, i, v), { row: y, col: Y } = p(I.startRow, I.startColumn), A = this._hyperLinkModel.getHyperLinkByLocation(n.unitId, n.subUnitId, y, Y), P = le.generateRandomId();
|
|
1399
1437
|
A && o.push({
|
|
1400
1438
|
id: M.id,
|
|
1401
1439
|
params: {
|
|
@@ -1403,15 +1441,15 @@ let Ie = class extends O {
|
|
|
1403
1441
|
subUnitId: n.subUnitId,
|
|
1404
1442
|
id: A.id
|
|
1405
1443
|
}
|
|
1406
|
-
}),
|
|
1444
|
+
}), V && (o.push({
|
|
1407
1445
|
id: x.id,
|
|
1408
1446
|
params: {
|
|
1409
1447
|
unitId: n.unitId,
|
|
1410
1448
|
subUnitId: n.subUnitId,
|
|
1411
1449
|
link: {
|
|
1412
|
-
...
|
|
1413
|
-
id:
|
|
1414
|
-
row:
|
|
1450
|
+
...V,
|
|
1451
|
+
id: P,
|
|
1452
|
+
row: y,
|
|
1415
1453
|
column: Y
|
|
1416
1454
|
}
|
|
1417
1455
|
}
|
|
@@ -1420,7 +1458,7 @@ let Ie = class extends O {
|
|
|
1420
1458
|
params: {
|
|
1421
1459
|
unitId: n.unitId,
|
|
1422
1460
|
subUnitId: n.subUnitId,
|
|
1423
|
-
id:
|
|
1461
|
+
id: P
|
|
1424
1462
|
}
|
|
1425
1463
|
})), A && s.push({
|
|
1426
1464
|
id: x.id,
|
|
@@ -1437,19 +1475,19 @@ let Ie = class extends O {
|
|
|
1437
1475
|
};
|
|
1438
1476
|
}
|
|
1439
1477
|
};
|
|
1440
|
-
|
|
1441
|
-
N($.Ready,
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
],
|
|
1447
|
-
var
|
|
1448
|
-
for (var
|
|
1449
|
-
(s = e[o]) && (
|
|
1450
|
-
return
|
|
1451
|
-
},
|
|
1452
|
-
let
|
|
1478
|
+
Pe = Jr([
|
|
1479
|
+
N($.Ready, Pe),
|
|
1480
|
+
_e(0, Rn),
|
|
1481
|
+
_e(1, h(T)),
|
|
1482
|
+
_e(2, h(Be)),
|
|
1483
|
+
_e(3, h(W))
|
|
1484
|
+
], Pe);
|
|
1485
|
+
var Qr = Object.defineProperty, ei = Object.getOwnPropertyDescriptor, ti = (e, t, n, r) => {
|
|
1486
|
+
for (var i = r > 1 ? void 0 : r ? ei(t, n) : t, o = e.length - 1, s; o >= 0; o--)
|
|
1487
|
+
(s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
|
|
1488
|
+
return r && i && Qr(t, n, i), i;
|
|
1489
|
+
}, ni = (e, t) => (n, r) => t(n, r, e);
|
|
1490
|
+
let be = class extends O {
|
|
1453
1491
|
constructor(e) {
|
|
1454
1492
|
super(), this._resolverService = e, this._handleInitUrl();
|
|
1455
1493
|
}
|
|
@@ -1458,89 +1496,89 @@ let ke = class extends O {
|
|
|
1458
1496
|
e && this._resolverService.parseHyperLink(e).handler();
|
|
1459
1497
|
}
|
|
1460
1498
|
};
|
|
1461
|
-
|
|
1462
|
-
N($.Rendered,
|
|
1463
|
-
|
|
1464
|
-
],
|
|
1465
|
-
var
|
|
1466
|
-
for (var
|
|
1467
|
-
(s = e[o]) && (
|
|
1468
|
-
return
|
|
1469
|
-
},
|
|
1470
|
-
let
|
|
1499
|
+
be = ti([
|
|
1500
|
+
N($.Rendered, be),
|
|
1501
|
+
ni(0, h(W))
|
|
1502
|
+
], be);
|
|
1503
|
+
var ri = Object.defineProperty, ii = Object.getOwnPropertyDescriptor, oi = (e, t, n, r) => {
|
|
1504
|
+
for (var i = r > 1 ? void 0 : r ? ii(t, n) : t, o = e.length - 1, s; o >= 0; o--)
|
|
1505
|
+
(s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
|
|
1506
|
+
return r && i && ri(t, n, i), i;
|
|
1507
|
+
}, Ke = (e, t) => (n, r) => t(n, r, e);
|
|
1508
|
+
let Re = class extends O {
|
|
1471
1509
|
constructor(e, t, n) {
|
|
1472
1510
|
super(), this._localeService = e, this._commandService = t, this._sheetPermissionInterceptorBaseController = n, this._commandExecutedListener();
|
|
1473
1511
|
}
|
|
1474
1512
|
_commandExecutedListener() {
|
|
1475
1513
|
this.disposeWithMe(
|
|
1476
1514
|
this._commandService.beforeCommandExecuted((e) => {
|
|
1477
|
-
e.id ===
|
|
1478
|
-
workbookTypes: [
|
|
1479
|
-
rangeTypes: [
|
|
1480
|
-
worksheetTypes: [
|
|
1515
|
+
e.id === Wt.id && (this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({
|
|
1516
|
+
workbookTypes: [He],
|
|
1517
|
+
rangeTypes: [Ae],
|
|
1518
|
+
worksheetTypes: [Ne, tt, $e]
|
|
1481
1519
|
}) || this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.hyperLinkErr")));
|
|
1482
1520
|
})
|
|
1483
1521
|
);
|
|
1484
1522
|
}
|
|
1485
1523
|
};
|
|
1486
|
-
|
|
1487
|
-
N($.Rendered,
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
],
|
|
1492
|
-
var Ft = Object.defineProperty,
|
|
1493
|
-
for (var
|
|
1494
|
-
(s = e[o]) && (
|
|
1495
|
-
return
|
|
1496
|
-
},
|
|
1497
|
-
let
|
|
1524
|
+
Re = oi([
|
|
1525
|
+
N($.Rendered, Re),
|
|
1526
|
+
Ke(0, h(pe)),
|
|
1527
|
+
Ke(1, F),
|
|
1528
|
+
Ke(2, h(Pt))
|
|
1529
|
+
], Re);
|
|
1530
|
+
var Ft = Object.defineProperty, si = Object.getOwnPropertyDescriptor, ai = (e, t, n) => t in e ? Ft(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, ci = (e, t, n, r) => {
|
|
1531
|
+
for (var i = r > 1 ? void 0 : r ? si(t, n) : t, o = e.length - 1, s; o >= 0; o--)
|
|
1532
|
+
(s = e[o]) && (i = (r ? s(t, n, i) : s(i)) || i);
|
|
1533
|
+
return r && i && Ft(t, n, i), i;
|
|
1534
|
+
}, vt = (e, t) => (n, r) => t(n, r, e), Zt = (e, t, n) => ai(e, typeof t != "symbol" ? t + "" : t, n);
|
|
1535
|
+
let Ue = class extends nn {
|
|
1498
1536
|
constructor(e, t, n) {
|
|
1499
1537
|
super(), this._config = e, this._injector = t, this._renderManagerService = n;
|
|
1500
1538
|
}
|
|
1501
1539
|
onStarting(e) {
|
|
1502
1540
|
[
|
|
1503
|
-
[
|
|
1541
|
+
[W],
|
|
1504
1542
|
[H],
|
|
1505
|
-
[ve],
|
|
1506
|
-
[_e],
|
|
1507
1543
|
[Ce],
|
|
1508
|
-
[
|
|
1544
|
+
[ye],
|
|
1545
|
+
[Le],
|
|
1546
|
+
[Ie],
|
|
1509
1547
|
[
|
|
1510
|
-
|
|
1548
|
+
ce,
|
|
1511
1549
|
{
|
|
1512
|
-
useFactory: () => this._injector.createInstance(
|
|
1550
|
+
useFactory: () => this._injector.createInstance(ce, this._config)
|
|
1513
1551
|
}
|
|
1514
1552
|
],
|
|
1515
|
-
[
|
|
1516
|
-
[
|
|
1517
|
-
[
|
|
1518
|
-
[
|
|
1519
|
-
].forEach((n) => e.add(n)), this._renderManagerService.registerRenderController(
|
|
1553
|
+
[ke],
|
|
1554
|
+
[Pe],
|
|
1555
|
+
[Re],
|
|
1556
|
+
[be]
|
|
1557
|
+
].forEach((n) => e.add(n)), this._renderManagerService.registerRenderController(w.UNIVER_SHEET, Xe);
|
|
1520
1558
|
}
|
|
1521
1559
|
};
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
],
|
|
1560
|
+
Zt(Ue, "pluginName", at);
|
|
1561
|
+
Zt(Ue, "type", w.UNIVER_SHEET);
|
|
1562
|
+
Ue = ci([
|
|
1563
|
+
rn(Cn),
|
|
1564
|
+
vt(1, h(Be)),
|
|
1565
|
+
vt(2, nt)
|
|
1566
|
+
], Ue);
|
|
1529
1567
|
export {
|
|
1530
|
-
|
|
1568
|
+
xe as CloseHyperLinkSidebarOperation,
|
|
1531
1569
|
ot as InsertHyperLinkOperation,
|
|
1532
|
-
|
|
1570
|
+
Wt as InsertLinkShortcut,
|
|
1533
1571
|
it as OpenHyperLinkSidebarOperation,
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1572
|
+
Le as SheetHyperLinkSetRangeController,
|
|
1573
|
+
be as SheetHyperLinkUrlController,
|
|
1574
|
+
ke as SheetsHyperLinkAutoFillController,
|
|
1575
|
+
Pe as SheetsHyperLinkCopyPasteController,
|
|
1576
|
+
Ie as SheetsHyperLinkPopupController,
|
|
1539
1577
|
H as SheetsHyperLinkPopupService,
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1578
|
+
Ce as SheetsHyperLinkRemoveSheetController,
|
|
1579
|
+
Xe as SheetsHyperLinkRenderController,
|
|
1580
|
+
ye as SheetsHyperLinkRenderManagerController,
|
|
1581
|
+
W as SheetsHyperLinkResolverService,
|
|
1582
|
+
ce as SheetsHyperLinkUIController,
|
|
1583
|
+
Ue as UniverSheetsHyperLinkUIPlugin
|
|
1546
1584
|
};
|