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