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