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