@univerjs/sheets-hyper-link-ui 0.8.0-beta.0 → 0.8.0-beta.1
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 +1 -1
- package/lib/es/index.js +328 -328
- package/lib/index.css +1 -1
- package/lib/index.js +328 -328
- package/lib/umd/index.js +1 -1
- package/package.json +15 -15
package/lib/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
var qn = Object.defineProperty;
|
|
2
2
|
var Jn = (t, e, n) => e in t ? qn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var $ = (t, e, n) => Jn(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
-
import { Tools as
|
|
5
|
-
import { SetSelectionsOperation as En, SetWorksheetActiveOperation as Rn, rangeToDiscreteRange as dr, SheetsSelectionsService as kt, getSheetCommandTarget as Tt, RangeProtectionPermissionEditPoint as Ot, WorksheetEditPermission as
|
|
6
|
-
import { SheetHyperLinkType as C, ERROR_RANGE as yr, HyperLinkModel as pt, RemoveHyperLinkMutation as Ne, AddHyperLinkMutation as
|
|
7
|
-
import { ScrollToRangeOperation as
|
|
8
|
-
import { MessageType as Te, clsx as
|
|
9
|
-
import { IDefinedNamesService as kn, deserializeRangeWithSheet as
|
|
10
|
-
import { IMessageService as Tn, useDependency as
|
|
11
|
-
import { DocSelectionRenderService as
|
|
12
|
-
import { IRenderManagerService as
|
|
13
|
-
import { Subject as si, BehaviorSubject as oi, of as
|
|
14
|
-
import { DocSelectionManagerService as
|
|
15
|
-
import { jsxs as
|
|
4
|
+
import { Tools as Ce, IUniverInstanceService as K, ICommandService as ne, Inject as y, LocaleService as ut, IConfigService as Cn, UniverInstanceType as k, isValidRange as Sn, RANGE_TYPE as an, Rectangle as ye, Injector as lt, Disposable as Y, Range as yn, ObjectMatrix as Qn, IContextService as er, ThemeService as tr, DataStreamTreeTokenType as cn, CustomRangeType as xe, BuildTextUtils as _e, ColorKit as nr, DOCS_ZEN_EDITOR_UNIT_ID_KEY as x, DisposableCollection as rr, FOCUSING_SHEET as Ct, generateRandomId as ir, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Se, DataValidationType as St, CommandType as dt, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as sr, IPermissionService as or, InterceptorEffectEnum as ar, DependentOn as cr, Plugin as ur, merge as lr } from "@univerjs/core";
|
|
5
|
+
import { SetSelectionsOperation as En, SetWorksheetActiveOperation as Rn, rangeToDiscreteRange as dr, SheetsSelectionsService as kt, getSheetCommandTarget as Tt, RangeProtectionPermissionEditPoint as Ot, WorksheetEditPermission as xt, WorksheetSetCellValuePermission as Pn, WorksheetInsertHyperlinkPermission as Nt, WorkbookEditablePermission as Mt, SheetPermissionCheckController as Ln, RangeProtectionPermissionViewPoint as pr, WorksheetViewPermission as hr, WorkbookViewPermission as gr, WorkbookCopyPermission as vr, WorksheetCopyPermission as mr, ClearSelectionContentCommand as fr, ClearSelectionAllCommand as _r, ClearSelectionFormatCommand as Ir, SheetInterceptorService as Cr, INTERCEPTOR_POINT as Sr } from "@univerjs/sheets";
|
|
6
|
+
import { SheetHyperLinkType as C, ERROR_RANGE as yr, HyperLinkModel as pt, RemoveHyperLinkMutation as Ne, AddHyperLinkMutation as Me, SheetsHyperLinkParserService as Ut, UpdateRichHyperLinkCommand as Er, UpdateHyperLinkCommand as Rr, AddRichHyperLinkCommand as Pr, AddHyperLinkCommand as Lr, CancelRichHyperLinkCommand as wr, CancelHyperLinkCommand as br, UniverSheetsHyperLinkPlugin as kr } from "@univerjs/sheets-hyper-link";
|
|
7
|
+
import { ScrollToRangeOperation as wn, ISheetClipboardService as Tr, virtualizeDiscreteRanges as Pt, COPY_TYPE as Or, PREDEFINED_HOOK_NAME as Be, getRepeatRange as xr, IEditorBridgeService as te, IMarkSelectionService as Nr, SheetCanvasPopManagerService as Mr, getEditingCustomRangePosition as Ur, getCustomRangePosition as Hr, whenSheetEditorFocused as Dr, getCurrentRangeDisable$ as Ar, IAutoFillService as Vr, APPLY_TYPE as be, getAutoFillRepeatRange as $r, HoverManagerService as Br, HoverRenderController as Fr, SheetSkeletonManagerService as un } from "@univerjs/sheets-ui";
|
|
8
|
+
import { MessageType as Te, clsx as We, FormLayout as me, Input as ln, Select as yt, Button as dn, borderClassName as bn, Tooltip as Fe } from "@univerjs/design";
|
|
9
|
+
import { IDefinedNamesService as kn, deserializeRangeWithSheet as Ze, serializeRangeWithSheet as jr, serializeRangeToRefString as Wr, serializeRange as Zr } from "@univerjs/engine-formula";
|
|
10
|
+
import { IMessageService as Tn, useDependency as S, useObservable as Gr, IZenZoneService as ht, useEvent as Kr, KeyCode as Lt, MenuItemType as On, MetaKeys as Yr, getMenuHiddenObservable as gt, ContextMenuPosition as zr, ContextMenuGroup as Xr, RibbonInsertGroup as qr, ComponentManager as Jr, IMenuManagerService as Qr, IShortcutService as ei } from "@univerjs/ui";
|
|
11
|
+
import { DocSelectionRenderService as xn, DocBackScrollRenderController as ti, DocCanvasPopManagerService as ni, calcDocRangePositions as ri, DocEventManagerService as pn, UniverDocsUIPlugin as ii } from "@univerjs/docs-ui";
|
|
12
|
+
import { IRenderManagerService as De } from "@univerjs/engine-render";
|
|
13
|
+
import { Subject as si, BehaviorSubject as oi, of as ae, map as Ht, switchMap as Ue, combineLatest as ai, debounceTime as Ge, Observable as ci } from "rxjs";
|
|
14
|
+
import { DocSelectionManagerService as He } from "@univerjs/docs";
|
|
15
|
+
import { jsxs as Ie, jsx as m, Fragment as ui } from "react/jsx-runtime";
|
|
16
16
|
import { RangeSelector as li } from "@univerjs/sheets-formula-ui";
|
|
17
|
-
import { useState as Z, useMemo as Et, useRef as
|
|
17
|
+
import { useState as Z, useMemo as Et, useRef as Nn, useCallback as di, useEffect as ee, forwardRef as le, createElement as de } from "react";
|
|
18
18
|
import { SheetDataValidationModel as hn } from "@univerjs/sheets-data-validation";
|
|
19
19
|
function Ye(t) {
|
|
20
|
-
return
|
|
20
|
+
return Ce.isLegalUrl(t);
|
|
21
21
|
}
|
|
22
22
|
function pi(t) {
|
|
23
23
|
return /^[a-zA-Z]+:\/\//.test(t);
|
|
@@ -43,17 +43,17 @@ var vi = Object.getOwnPropertyDescriptor, mi = (t, e, n, i) => {
|
|
|
43
43
|
for (var r = i > 1 ? void 0 : i ? vi(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
44
44
|
(o = t[s]) && (r = o(r) || r);
|
|
45
45
|
return r;
|
|
46
|
-
},
|
|
46
|
+
}, fe = (t, e) => (n, i) => e(n, i, t);
|
|
47
47
|
function fi(t, e) {
|
|
48
48
|
const n = e.getMergeData(), i = e.getMaxColumns() - 1, r = e.getMaxRows() - 1;
|
|
49
49
|
if (i < t.endColumn && (t.endColumn = i), r < t.endRow && (t.endRow = r), t.rangeType === an.COLUMN || an.ROW)
|
|
50
50
|
return t;
|
|
51
51
|
const s = [];
|
|
52
52
|
return n.forEach((o) => {
|
|
53
|
-
|
|
54
|
-
}),
|
|
53
|
+
ye.intersects(t, o) && s.push(o);
|
|
54
|
+
}), ye.realUnion(t, ...s);
|
|
55
55
|
}
|
|
56
|
-
let
|
|
56
|
+
let ue = class {
|
|
57
57
|
constructor(t, e, n, i, r, s) {
|
|
58
58
|
this._univerInstanceService = t, this._commandService = e, this._definedNamesService = n, this._messageService = i, this._localeService = r, this._configService = s;
|
|
59
59
|
}
|
|
@@ -94,8 +94,8 @@ let ce = class {
|
|
|
94
94
|
}
|
|
95
95
|
if (e) {
|
|
96
96
|
if (n) {
|
|
97
|
-
const o =
|
|
98
|
-
|
|
97
|
+
const o = Ze(n);
|
|
98
|
+
Sn(o.range) && n !== yr && this.navigateToRange(s, e, o.range);
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
101
|
this.navigateToSheetById(s, e);
|
|
@@ -115,7 +115,7 @@ let ce = class {
|
|
|
115
115
|
primary: null
|
|
116
116
|
}]
|
|
117
117
|
}
|
|
118
|
-
), await this._commandService.executeCommand(
|
|
118
|
+
), await this._commandService.executeCommand(wn.id, {
|
|
119
119
|
range: s,
|
|
120
120
|
forceTop: i
|
|
121
121
|
});
|
|
@@ -150,20 +150,20 @@ let ce = class {
|
|
|
150
150
|
window.open(t, "_blank", "noopener noreferrer");
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
],
|
|
153
|
+
ue = mi([
|
|
154
|
+
fe(0, K),
|
|
155
|
+
fe(1, ne),
|
|
156
|
+
fe(2, kn),
|
|
157
|
+
fe(3, Tn),
|
|
158
|
+
fe(4, y(ut)),
|
|
159
|
+
fe(5, Cn)
|
|
160
|
+
], ue);
|
|
161
161
|
const Dt = "SHEET_HYPER_LINK_UI_PLUGIN";
|
|
162
|
-
var _i = Object.getOwnPropertyDescriptor,
|
|
162
|
+
var _i = Object.getOwnPropertyDescriptor, Ii = (t, e, n, i) => {
|
|
163
163
|
for (var r = i > 1 ? void 0 : i ? _i(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
164
164
|
(o = t[s]) && (r = o(r) || r);
|
|
165
165
|
return r;
|
|
166
|
-
},
|
|
166
|
+
}, je = (t, e) => (n, i) => e(n, i, t);
|
|
167
167
|
let ze = class extends Y {
|
|
168
168
|
constructor(e, n, i, r) {
|
|
169
169
|
super();
|
|
@@ -196,7 +196,7 @@ let ze = class extends Y {
|
|
|
196
196
|
if (Ye(n) && i) {
|
|
197
197
|
const { range: r, unitId: s, subUnitId: o } = e, { ranges: [c], mapFunc: u } = Pt([r]), p = [], l = [];
|
|
198
198
|
return yn.foreach(c, (g, d) => {
|
|
199
|
-
const { row: _, col:
|
|
199
|
+
const { row: _, col: I } = u(g, d), f = this._hyperLinkModel.getHyperLinkByLocation(s, o, _, I);
|
|
200
200
|
f && p.push({
|
|
201
201
|
id: Ne.id,
|
|
202
202
|
params: {
|
|
@@ -205,7 +205,7 @@ let ze = class extends Y {
|
|
|
205
205
|
id: f.id
|
|
206
206
|
}
|
|
207
207
|
}), f && l.push({
|
|
208
|
-
id:
|
|
208
|
+
id: Me.id,
|
|
209
209
|
params: {
|
|
210
210
|
unitId: s,
|
|
211
211
|
subUnitId: o,
|
|
@@ -245,25 +245,25 @@ let ze = class extends Y {
|
|
|
245
245
|
if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !n.copyRange)
|
|
246
246
|
return { redos: [], undos: [] };
|
|
247
247
|
if ([
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
248
|
+
Be.SPECIAL_PASTE_COL_WIDTH,
|
|
249
|
+
Be.SPECIAL_PASTE_VALUE,
|
|
250
|
+
Be.SPECIAL_PASTE_FORMAT,
|
|
251
|
+
Be.SPECIAL_PASTE_FORMULA
|
|
252
252
|
].includes(n.pasteType))
|
|
253
253
|
return { redos: [], undos: [] };
|
|
254
254
|
const { unitId: r, subUnitId: s } = this._copyInfo, o = [], c = [], { ranges: [u, p], mapFunc: l } = Pt([n.copyRange, e]);
|
|
255
|
-
return
|
|
255
|
+
return xr(u, p, !0).forEach(({ startRange: d }) => {
|
|
256
256
|
var _;
|
|
257
|
-
(_ = this._copyInfo) == null || _.matrix.forValue((
|
|
258
|
-
const a =
|
|
257
|
+
(_ = this._copyInfo) == null || _.matrix.forValue((I, f, w) => {
|
|
258
|
+
const a = ye.getPositionRange(
|
|
259
259
|
{
|
|
260
|
-
startRow:
|
|
261
|
-
endRow:
|
|
260
|
+
startRow: I,
|
|
261
|
+
endRow: I,
|
|
262
262
|
startColumn: f,
|
|
263
263
|
endColumn: f
|
|
264
264
|
},
|
|
265
265
|
d
|
|
266
|
-
),
|
|
266
|
+
), b = this._hyperLinkModel.getHyperLink(r, s, w), { row: M, col: T } = l(a.startRow, a.startColumn), P = this._hyperLinkModel.getHyperLinkByLocation(n.unitId, n.subUnitId, M, T), D = Ce.generateRandomId();
|
|
267
267
|
P && o.push({
|
|
268
268
|
id: Ne.id,
|
|
269
269
|
params: {
|
|
@@ -271,14 +271,14 @@ let ze = class extends Y {
|
|
|
271
271
|
subUnitId: n.subUnitId,
|
|
272
272
|
id: P.id
|
|
273
273
|
}
|
|
274
|
-
}),
|
|
275
|
-
id:
|
|
274
|
+
}), b && (o.push({
|
|
275
|
+
id: Me.id,
|
|
276
276
|
params: {
|
|
277
277
|
unitId: n.unitId,
|
|
278
278
|
subUnitId: n.subUnitId,
|
|
279
279
|
link: {
|
|
280
|
-
...
|
|
281
|
-
id:
|
|
280
|
+
...b,
|
|
281
|
+
id: D,
|
|
282
282
|
row: M,
|
|
283
283
|
column: T
|
|
284
284
|
}
|
|
@@ -288,10 +288,10 @@ let ze = class extends Y {
|
|
|
288
288
|
params: {
|
|
289
289
|
unitId: n.unitId,
|
|
290
290
|
subUnitId: n.subUnitId,
|
|
291
|
-
id:
|
|
291
|
+
id: D
|
|
292
292
|
}
|
|
293
293
|
})), P && c.push({
|
|
294
|
-
id:
|
|
294
|
+
id: Me.id,
|
|
295
295
|
params: {
|
|
296
296
|
unitId: n.unitId,
|
|
297
297
|
subUnitId: n.subUnitId,
|
|
@@ -302,11 +302,11 @@ let ze = class extends Y {
|
|
|
302
302
|
}), { redos: o, undos: c };
|
|
303
303
|
}
|
|
304
304
|
};
|
|
305
|
-
ze =
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
305
|
+
ze = Ii([
|
|
306
|
+
je(0, Tr),
|
|
307
|
+
je(1, y(pt)),
|
|
308
|
+
je(2, y(lt)),
|
|
309
|
+
je(3, y(ue))
|
|
310
310
|
], ze);
|
|
311
311
|
var v = /* @__PURE__ */ ((t) => (t.EDITING = "editing", t.VIEWING = "viewing", t.ZEN_EDITOR = "zen_mode", t))(v || {});
|
|
312
312
|
class Un extends Y {
|
|
@@ -339,47 +339,47 @@ class Un extends Y {
|
|
|
339
339
|
}
|
|
340
340
|
const Xe = () => {
|
|
341
341
|
var Zt;
|
|
342
|
-
const [t, e] = Z(""), [n, i] = Z(!1), [r, s] = Z(""), [o, c] = Z(!0), [u, p] = Z(C.URL), [l, g] = Z(""), d =
|
|
342
|
+
const [t, e] = Z(""), [n, i] = Z(!1), [r, s] = Z(""), [o, c] = Z(!0), [u, p] = Z(C.URL), [l, g] = Z(""), d = S(ut), _ = S(kn), I = S(te), f = S(K), w = S(G), a = Gr(w.currentEditing$), b = S(Ut), M = S(ue), T = S(ne), P = S(Un), D = Et(() => P.getOptions(), [P]), A = S(ht), z = S(De), re = S(Nr), Ae = S(He), ie = S(er), Ee = S(tr), Re = S(He), [Pe, Ve] = Z(!1), he = S(kt), Zn = Et(() => he.getCurrentSelections(), []), $e = Et(() => {
|
|
343
343
|
if (!P.isBuiltInLinkType(u))
|
|
344
344
|
return P.getCustomHyperLink(u);
|
|
345
|
-
}, [P, u]), [
|
|
345
|
+
}, [P, u]), [ge, Gn] = Z(!1), [Le, jt] = Z(!1), H = Nn(!1), B = f.getCurrentUnitForType(k.UNIVER_SHEET), Kn = (B == null ? void 0 : B.getActiveSheet().getSheetId()) || "", q = di((h) => {
|
|
346
346
|
s(h.replaceAll(cn.CUSTOM_RANGE_START, "").replaceAll(cn.CUSTOM_RANGE_END, ""));
|
|
347
347
|
}, [s]);
|
|
348
348
|
ee(() => {
|
|
349
|
-
var h, E, R, L,
|
|
349
|
+
var h, E, R, L, N, F, Gt, Kt, Yt, zt, Xt, qt, Jt, Qt, en, tn, nn;
|
|
350
350
|
if ((a == null ? void 0 : a.row) !== void 0 && a.col !== void 0) {
|
|
351
|
-
const { customRange:
|
|
351
|
+
const { customRange: se, row: _t, col: It } = a;
|
|
352
352
|
let { label: X } = a;
|
|
353
353
|
typeof X == "number" && (X = `${X}`);
|
|
354
354
|
let j;
|
|
355
|
-
if (
|
|
355
|
+
if (se)
|
|
356
356
|
j = {
|
|
357
|
-
id: (h =
|
|
357
|
+
id: (h = se == null ? void 0 : se.rangeId) != null ? h : "",
|
|
358
358
|
display: X != null ? X : "",
|
|
359
|
-
payload: (R = (E =
|
|
359
|
+
payload: (R = (E = se == null ? void 0 : se.properties) == null ? void 0 : E.url) != null ? R : "",
|
|
360
360
|
row: _t,
|
|
361
|
-
column:
|
|
361
|
+
column: It
|
|
362
362
|
};
|
|
363
363
|
else if (a.type === v.VIEWING) {
|
|
364
|
-
const O = f.getUnit(a.unitId), Q = O == null ? void 0 : O.getSheetBySheetId(a.subUnitId), U = Q == null ? void 0 : Q.getCellRaw(a.row, a.col),
|
|
364
|
+
const O = f.getUnit(a.unitId), Q = O == null ? void 0 : O.getSheetBySheetId(a.subUnitId), U = Q == null ? void 0 : Q.getCellRaw(a.row, a.col), ve = (F = (N = (L = U == null ? void 0 : U.p) == null ? void 0 : L.body) == null ? void 0 : N.customRanges) == null ? void 0 : F.find((sn) => {
|
|
365
365
|
var on;
|
|
366
|
-
return sn.rangeType ===
|
|
367
|
-
}),
|
|
368
|
-
U && (!
|
|
366
|
+
return sn.rangeType === xe.HYPERLINK && ((on = sn.properties) == null ? void 0 : on.url);
|
|
367
|
+
}), we = U == null ? void 0 : U.v;
|
|
368
|
+
U && (!_e.transform.isEmptyDocument((Kt = (Gt = U.p) == null ? void 0 : Gt.body) == null ? void 0 : Kt.dataStream) || Ce.isDefine(we)) && c(!1), j = {
|
|
369
369
|
id: "",
|
|
370
370
|
display: "",
|
|
371
|
-
payload: (zt = (Yt =
|
|
371
|
+
payload: (zt = (Yt = ve == null ? void 0 : ve.properties) == null ? void 0 : Yt.url) != null ? zt : "",
|
|
372
372
|
row: _t,
|
|
373
|
-
column:
|
|
373
|
+
column: It
|
|
374
374
|
};
|
|
375
375
|
} else {
|
|
376
|
-
const O = f.getCurrentUnitForType(k.UNIVER_DOC), Q =
|
|
376
|
+
const O = f.getCurrentUnitForType(k.UNIVER_DOC), Q = Ae.getActiveTextRange(), U = O == null ? void 0 : O.getBody(), ve = Q && U ? Q : null, we = ve && ((qt = _e.customRange.getCustomRangesInterestsWithSelection(ve, (Xt = U == null ? void 0 : U.customRanges) != null ? Xt : [])) == null ? void 0 : qt[0]);
|
|
377
377
|
c(!1), j = {
|
|
378
378
|
id: "",
|
|
379
379
|
display: X != null ? X : "",
|
|
380
|
-
payload: (Qt = (Jt =
|
|
380
|
+
payload: (Qt = (Jt = we == null ? void 0 : we.properties) == null ? void 0 : Jt.url) != null ? Qt : "",
|
|
381
381
|
row: _t,
|
|
382
|
-
column:
|
|
382
|
+
column: It
|
|
383
383
|
};
|
|
384
384
|
}
|
|
385
385
|
e(j.id);
|
|
@@ -390,14 +390,14 @@ const Xe = () => {
|
|
|
390
390
|
return;
|
|
391
391
|
}
|
|
392
392
|
q(j.display);
|
|
393
|
-
const J =
|
|
393
|
+
const J = b.parseHyperLink(j.payload);
|
|
394
394
|
switch (p(J.type === C.INVALID ? C.RANGE : J.type), J.type) {
|
|
395
395
|
case C.URL: {
|
|
396
396
|
g(J.url), J.url === j.display && (H.current = !0);
|
|
397
397
|
break;
|
|
398
398
|
}
|
|
399
399
|
case C.RANGE: {
|
|
400
|
-
const O = J.searchObj, Q = O.gid && (nn = (tn = (en = f.getUnit(a.unitId)) == null ? void 0 : en.getSheetBySheetId(O.gid)) == null ? void 0 : tn.getName()) != null ? nn : "", U = jr(Q,
|
|
400
|
+
const O = J.searchObj, Q = O.gid && (nn = (tn = (en = f.getUnit(a.unitId)) == null ? void 0 : en.getSheetBySheetId(O.gid)) == null ? void 0 : tn.getName()) != null ? nn : "", U = jr(Q, Ze(O.range).range);
|
|
401
401
|
g(U), U === j.display && (H.current = !0);
|
|
402
402
|
break;
|
|
403
403
|
}
|
|
@@ -416,11 +416,11 @@ const Xe = () => {
|
|
|
416
416
|
break;
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
}, [a, M, P,
|
|
419
|
+
}, [a, M, P, Ae, f]), ee(() => {
|
|
420
420
|
let h = null;
|
|
421
|
-
if (a && !a.customRangeId && a.type === v.VIEWING &&
|
|
422
|
-
const E = f.getUnit(a.unitId, k.UNIVER_SHEET), R = E == null ? void 0 : E.getSheetBySheetId(a.subUnitId), L = R == null ? void 0 : R.getMergedCell(a.row, a.col),
|
|
423
|
-
h =
|
|
421
|
+
if (a && !a.customRangeId && a.type === v.VIEWING && Ce.isDefine(a.row) && Ce.isDefine(a.col)) {
|
|
422
|
+
const E = f.getUnit(a.unitId, k.UNIVER_SHEET), R = E == null ? void 0 : E.getSheetBySheetId(a.subUnitId), L = R == null ? void 0 : R.getMergedCell(a.row, a.col), N = new nr(Ee.getColorFromTheme("primary.600")).toRgb();
|
|
423
|
+
h = re.addShape(
|
|
424
424
|
{
|
|
425
425
|
range: L != null ? L : {
|
|
426
426
|
startColumn: a.col,
|
|
@@ -430,7 +430,7 @@ const Xe = () => {
|
|
|
430
430
|
},
|
|
431
431
|
style: {
|
|
432
432
|
// hasAutoFill: false,
|
|
433
|
-
fill: `rgb(${
|
|
433
|
+
fill: `rgb(${N.r}, ${N.g}, ${N.b}, 0.12)`,
|
|
434
434
|
strokeWidth: 1,
|
|
435
435
|
stroke: "#FFBD37",
|
|
436
436
|
widgets: {}
|
|
@@ -442,31 +442,31 @@ const Xe = () => {
|
|
|
442
442
|
);
|
|
443
443
|
}
|
|
444
444
|
return () => {
|
|
445
|
-
h &&
|
|
445
|
+
h && re.removeShape(h);
|
|
446
446
|
};
|
|
447
|
-
}, [a,
|
|
447
|
+
}, [a, re, Ee, f]), ee(() => {
|
|
448
448
|
jt(u === C.RANGE);
|
|
449
449
|
}, [u]), ee(() => {
|
|
450
|
-
const h = (a == null ? void 0 : a.type) === v.ZEN_EDITOR ? z.getRenderById(
|
|
450
|
+
const h = (a == null ? void 0 : a.type) === v.ZEN_EDITOR ? z.getRenderById(x) : z.getRenderById(I.getCurrentEditorId()), E = new rr();
|
|
451
451
|
if (h) {
|
|
452
|
-
const R = h.with(
|
|
452
|
+
const R = h.with(xn);
|
|
453
453
|
R.setReserveRangesStatus(!0), E.add(() => {
|
|
454
454
|
R.setReserveRangesStatus(!1);
|
|
455
455
|
});
|
|
456
456
|
}
|
|
457
457
|
return () => {
|
|
458
|
-
|
|
458
|
+
I.disableForceKeepVisible(), E.dispose();
|
|
459
459
|
};
|
|
460
|
-
}, [a == null ? void 0 : a.type,
|
|
461
|
-
|
|
462
|
-
}), [Le, Pe,
|
|
463
|
-
|
|
464
|
-
}, [
|
|
460
|
+
}, [a == null ? void 0 : a.type, I, z]), ee(() => (Le && w.setIsKeepVisible(Le), w.setIsKeepVisible(Pe), () => {
|
|
461
|
+
w.setIsKeepVisible(!1);
|
|
462
|
+
}), [Le, Pe, w]), ee(() => () => {
|
|
463
|
+
A.temporaryHidden && (A.show(), ie.setContextValue(Ct, !1));
|
|
464
|
+
}, [ie, A]), ee(() => {
|
|
465
465
|
if (Le)
|
|
466
|
-
return
|
|
467
|
-
|
|
466
|
+
return I.enableForceKeepVisible(), () => {
|
|
467
|
+
I.disableForceKeepVisible();
|
|
468
468
|
};
|
|
469
|
-
}, [Le,
|
|
469
|
+
}, [Le, I]);
|
|
470
470
|
const Yn = [
|
|
471
471
|
{
|
|
472
472
|
label: d.t("hyperLink.form.link"),
|
|
@@ -484,7 +484,7 @@ const Xe = () => {
|
|
|
484
484
|
label: d.t("hyperLink.form.definedName"),
|
|
485
485
|
value: C.DEFINE_NAME
|
|
486
486
|
},
|
|
487
|
-
...
|
|
487
|
+
...D
|
|
488
488
|
];
|
|
489
489
|
if (!B)
|
|
490
490
|
return;
|
|
@@ -495,17 +495,17 @@ const Xe = () => {
|
|
|
495
495
|
if (h === C.URL)
|
|
496
496
|
return gi(E);
|
|
497
497
|
if (h === C.RANGE) {
|
|
498
|
-
const R =
|
|
498
|
+
const R = Ze(E), L = B.getSheetBySheetName(R.sheetName);
|
|
499
499
|
if (L)
|
|
500
500
|
return `#gid=${L.getSheetId()}&range=${Zr(R.range)}`;
|
|
501
501
|
}
|
|
502
502
|
return `#${h}=${E}`;
|
|
503
503
|
}, Xn = Kr((h) => {
|
|
504
|
-
var
|
|
505
|
-
const R = h.split(",").map(
|
|
506
|
-
if (!R || !
|
|
504
|
+
var N;
|
|
505
|
+
const R = h.split(",").map(Ze)[0];
|
|
506
|
+
if (!R || !Sn(R.range))
|
|
507
507
|
return;
|
|
508
|
-
R.sheetName || (R.sheetName = ((
|
|
508
|
+
R.sheetName || (R.sheetName = ((N = B.getActiveSheet()) == null ? void 0 : N.getName()) || "");
|
|
509
509
|
const L = Wr(R);
|
|
510
510
|
g(L), L && (H.current || !r) && (q(L), H.current = !0);
|
|
511
511
|
}), ft = async () => {
|
|
@@ -526,7 +526,7 @@ const Xe = () => {
|
|
|
526
526
|
},
|
|
527
527
|
row: a.row,
|
|
528
528
|
column: a.col,
|
|
529
|
-
documentId: a.type === v.ZEN_EDITOR ?
|
|
529
|
+
documentId: a.type === v.ZEN_EDITOR ? x : I.getCurrentEditorId()
|
|
530
530
|
});
|
|
531
531
|
} else {
|
|
532
532
|
const h = a.type === v.ZEN_EDITOR || a.type === v.EDITING ? Pr.id : Lr.id;
|
|
@@ -540,7 +540,7 @@ const Xe = () => {
|
|
|
540
540
|
payload: Wt(u, l),
|
|
541
541
|
display: o ? r : ""
|
|
542
542
|
},
|
|
543
|
-
documentId: a.type === v.ZEN_EDITOR ?
|
|
543
|
+
documentId: a.type === v.ZEN_EDITOR ? x : I.getCurrentEditorId()
|
|
544
544
|
});
|
|
545
545
|
}
|
|
546
546
|
if ((a == null ? void 0 : a.type) === v.VIEWING) {
|
|
@@ -549,7 +549,7 @@ const Xe = () => {
|
|
|
549
549
|
subUnitId: a.subUnitId
|
|
550
550
|
});
|
|
551
551
|
const h = 1;
|
|
552
|
-
await T.executeCommand(
|
|
552
|
+
await T.executeCommand(wn.id, {
|
|
553
553
|
range: {
|
|
554
554
|
startRow: Math.max(a.row - h, 0),
|
|
555
555
|
endRow: a.row + h,
|
|
@@ -560,16 +560,16 @@ const Xe = () => {
|
|
|
560
560
|
}
|
|
561
561
|
T.executeCommand(Je.id);
|
|
562
562
|
};
|
|
563
|
-
return a ? /* @__PURE__ */
|
|
563
|
+
return a ? /* @__PURE__ */ Ie(
|
|
564
564
|
"div",
|
|
565
565
|
{
|
|
566
|
-
className:
|
|
566
|
+
className: We("univer-box-border univer-w-[296px] univer-rounded-xl univer-bg-white univer-p-4 univer-shadow-md dark:!univer-bg-gray-900", bn),
|
|
567
567
|
children: [
|
|
568
568
|
o ? /* @__PURE__ */ m(
|
|
569
|
-
|
|
569
|
+
me,
|
|
570
570
|
{
|
|
571
571
|
label: d.t("hyperLink.form.label"),
|
|
572
|
-
error:
|
|
572
|
+
error: ge && !r ? d.t("hyperLink.form.inputError") : "",
|
|
573
573
|
children: /* @__PURE__ */ m(
|
|
574
574
|
ln,
|
|
575
575
|
{
|
|
@@ -586,7 +586,7 @@ const Xe = () => {
|
|
|
586
586
|
)
|
|
587
587
|
}
|
|
588
588
|
) : null,
|
|
589
|
-
/* @__PURE__ */ m(
|
|
589
|
+
/* @__PURE__ */ m(me, { label: d.t("hyperLink.form.type"), children: /* @__PURE__ */ m(
|
|
590
590
|
yt,
|
|
591
591
|
{
|
|
592
592
|
className: "univer-w-full",
|
|
@@ -598,9 +598,9 @@ const Xe = () => {
|
|
|
598
598
|
}
|
|
599
599
|
) }),
|
|
600
600
|
u === C.URL && /* @__PURE__ */ m(
|
|
601
|
-
|
|
601
|
+
me,
|
|
602
602
|
{
|
|
603
|
-
error:
|
|
603
|
+
error: ge ? l ? Ye(l) ? "" : d.t("hyperLink.form.linkError") : d.t("hyperLink.form.inputError") : "",
|
|
604
604
|
children: /* @__PURE__ */ m(
|
|
605
605
|
ln,
|
|
606
606
|
{
|
|
@@ -617,7 +617,7 @@ const Xe = () => {
|
|
|
617
617
|
)
|
|
618
618
|
}
|
|
619
619
|
),
|
|
620
|
-
u === C.RANGE && /* @__PURE__ */ m(
|
|
620
|
+
u === C.RANGE && /* @__PURE__ */ m(me, { error: ge && !l ? d.t("hyperLink.form.inputError") : "", children: /* @__PURE__ */ m(
|
|
621
621
|
li,
|
|
622
622
|
{
|
|
623
623
|
unitId: B.getUnitId(),
|
|
@@ -629,59 +629,59 @@ const Xe = () => {
|
|
|
629
629
|
onChange: (h, E) => Xn(E),
|
|
630
630
|
onRangeSelectorDialogVisibleChange: async (h) => {
|
|
631
631
|
var E, R;
|
|
632
|
-
if (
|
|
633
|
-
a.type === v.ZEN_EDITOR && (
|
|
632
|
+
if (Ve(h), h)
|
|
633
|
+
a.type === v.ZEN_EDITOR && (A.hide(), ie.setContextValue(Ct, !0)), a.type !== v.VIEWING && I.enableForceKeepVisible(), i(!0);
|
|
634
634
|
else {
|
|
635
635
|
if (await M.navigateToRange(a.unitId, a.subUnitId, { startRow: a.row, endRow: a.row, startColumn: a.col, endColumn: a.col }, !0), a.type === v.ZEN_EDITOR) {
|
|
636
636
|
await T.executeCommand(En.id, {
|
|
637
637
|
unitId: a.unitId,
|
|
638
638
|
subUnitId: a.subUnitId,
|
|
639
639
|
selections: [{ range: { startRow: a.row, endRow: a.row, startColumn: a.col, endColumn: a.col } }]
|
|
640
|
-
}),
|
|
641
|
-
const L = (E = z.getRenderById(
|
|
642
|
-
L &&
|
|
640
|
+
}), A.show(), ie.setContextValue(Ct, !1);
|
|
641
|
+
const L = (E = z.getRenderById(x)) == null ? void 0 : E.with(ti), N = (R = Re.getTextRanges({ unitId: x, subUnitId: x })) == null ? void 0 : R[0];
|
|
642
|
+
L && N && (L.scrollToRange(N), Re.refreshSelection({ unitId: x, subUnitId: x }));
|
|
643
643
|
}
|
|
644
|
-
|
|
644
|
+
I.disableForceKeepVisible(), i(!1);
|
|
645
645
|
}
|
|
646
646
|
},
|
|
647
647
|
onFocusChange: (h) => jt(h)
|
|
648
648
|
}
|
|
649
649
|
) }),
|
|
650
|
-
u === C.SHEET && /* @__PURE__ */ m(
|
|
650
|
+
u === C.SHEET && /* @__PURE__ */ m(me, { error: ge && !l ? d.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ m(
|
|
651
651
|
yt,
|
|
652
652
|
{
|
|
653
653
|
className: "univer-w-full",
|
|
654
654
|
options: vt,
|
|
655
655
|
value: l,
|
|
656
656
|
onChange: (h) => {
|
|
657
|
-
var L,
|
|
657
|
+
var L, N;
|
|
658
658
|
g(h);
|
|
659
|
-
const E = (L = vt.find((F) => F.value === h)) == null ? void 0 : L.label, R = (
|
|
659
|
+
const E = (L = vt.find((F) => F.value === h)) == null ? void 0 : L.label, R = (N = vt.find((F) => F.value === l)) == null ? void 0 : N.label;
|
|
660
660
|
E && (H.current || !r || r === R) && (q(E), H.current = !0);
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
663
|
) }),
|
|
664
|
-
u === C.DEFINE_NAME && /* @__PURE__ */ m(
|
|
664
|
+
u === C.DEFINE_NAME && /* @__PURE__ */ m(me, { error: ge && !l ? d.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ m(
|
|
665
665
|
yt,
|
|
666
666
|
{
|
|
667
667
|
className: "univer-w-full",
|
|
668
668
|
options: mt,
|
|
669
669
|
value: l,
|
|
670
670
|
onChange: (h) => {
|
|
671
|
-
var L,
|
|
671
|
+
var L, N;
|
|
672
672
|
g(h);
|
|
673
|
-
const E = (L = mt.find((F) => F.value === h)) == null ? void 0 : L.label, R = (
|
|
673
|
+
const E = (L = mt.find((F) => F.value === h)) == null ? void 0 : L.label, R = (N = mt.find((F) => F.value === l)) == null ? void 0 : N.label;
|
|
674
674
|
E && (H.current || !r || r === R) && (q(E), H.current = !0);
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
677
|
) }),
|
|
678
|
-
(
|
|
679
|
-
|
|
678
|
+
($e == null ? void 0 : $e.Form) && /* @__PURE__ */ m(
|
|
679
|
+
$e.Form,
|
|
680
680
|
{
|
|
681
681
|
linkId: t,
|
|
682
682
|
payload: l,
|
|
683
683
|
display: r,
|
|
684
|
-
showError:
|
|
684
|
+
showError: ge,
|
|
685
685
|
setByPayload: H,
|
|
686
686
|
setDisplay: (h) => {
|
|
687
687
|
q(h), H.current = !0;
|
|
@@ -689,7 +689,7 @@ const Xe = () => {
|
|
|
689
689
|
setPayload: g
|
|
690
690
|
}
|
|
691
691
|
),
|
|
692
|
-
/* @__PURE__ */
|
|
692
|
+
/* @__PURE__ */ Ie("div", { className: "univer-flex univer-flex-row univer-justify-end univer-gap-2", children: [
|
|
693
693
|
/* @__PURE__ */ m(
|
|
694
694
|
dn,
|
|
695
695
|
{
|
|
@@ -715,14 +715,14 @@ const Xe = () => {
|
|
|
715
715
|
) : null;
|
|
716
716
|
};
|
|
717
717
|
Xe.componentKey = "univer.sheet.cell-link-edit";
|
|
718
|
-
var
|
|
719
|
-
return
|
|
718
|
+
var V = function() {
|
|
719
|
+
return V = Object.assign || function(t) {
|
|
720
720
|
for (var e, n = 1, i = arguments.length; n < i; n++) {
|
|
721
721
|
e = arguments[n];
|
|
722
722
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
|
|
723
723
|
}
|
|
724
724
|
return t;
|
|
725
|
-
},
|
|
725
|
+
}, V.apply(this, arguments);
|
|
726
726
|
}, Ci = function(t, e) {
|
|
727
727
|
var n = {};
|
|
728
728
|
for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
|
|
@@ -730,17 +730,17 @@ var A = function() {
|
|
|
730
730
|
for (var r = 0, i = Object.getOwnPropertySymbols(t); r < i.length; r++)
|
|
731
731
|
e.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[r]) && (n[i[r]] = t[i[r]]);
|
|
732
732
|
return n;
|
|
733
|
-
},
|
|
734
|
-
var n = t.icon, i = t.id, r = t.className, s = t.extend, o = Ci(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), u =
|
|
735
|
-
return Hn(n, "".concat(i), { defIds: n.defIds, idSuffix: u.current },
|
|
733
|
+
}, pe = le(function(t, e) {
|
|
734
|
+
var n = t.icon, i = t.id, r = t.className, s = t.extend, o = Ci(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), u = Nn("_".concat(Ei()));
|
|
735
|
+
return Hn(n, "".concat(i), { defIds: n.defIds, idSuffix: u.current }, V({ ref: e, className: c }, o), s);
|
|
736
736
|
});
|
|
737
737
|
function Hn(t, e, n, i, r) {
|
|
738
|
-
return
|
|
738
|
+
return de(t.tag, V(V({ key: e }, Si(t, n, r)), i), (yi(t, n).children || []).map(function(s, o) {
|
|
739
739
|
return Hn(s, "".concat(e, "-").concat(t.tag, "-").concat(o), n, void 0, r);
|
|
740
740
|
}));
|
|
741
741
|
}
|
|
742
|
-
function
|
|
743
|
-
var i =
|
|
742
|
+
function Si(t, e, n) {
|
|
743
|
+
var i = V({}, t.attrs);
|
|
744
744
|
n != null && n.colorChannel1 && i.fill === "colorChannel1" && (i.fill = n.colorChannel1), t.tag === "mask" && i.id && (i.id = i.id + e.idSuffix), Object.entries(i).forEach(function(s) {
|
|
745
745
|
var o = s[0], c = s[1];
|
|
746
746
|
o === "mask" && typeof c == "string" && (i[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
@@ -753,86 +753,86 @@ function Ii(t, e, n) {
|
|
|
753
753
|
}
|
|
754
754
|
function yi(t, e) {
|
|
755
755
|
var n, i = e.defIds;
|
|
756
|
-
return !i || i.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ?
|
|
757
|
-
return typeof r.attrs.id == "string" && i && i.
|
|
756
|
+
return !i || i.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? V(V({}, t), { children: t.children.map(function(r) {
|
|
757
|
+
return typeof r.attrs.id == "string" && i && i.includes(r.attrs.id) ? V(V({}, r), { attrs: V(V({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
758
758
|
}) }) : t;
|
|
759
759
|
}
|
|
760
760
|
function Ei() {
|
|
761
761
|
return Math.random().toString(36).substring(2, 8);
|
|
762
762
|
}
|
|
763
|
-
|
|
764
|
-
var Ri = { 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" } }] },
|
|
765
|
-
return
|
|
766
|
-
id: "all-border-
|
|
763
|
+
pe.displayName = "UniverIcon";
|
|
764
|
+
var Ri = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", 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" } }] }, Ke = le(function(t, e) {
|
|
765
|
+
return de(pe, Object.assign({}, t, {
|
|
766
|
+
id: "all-border-icon",
|
|
767
767
|
ref: e,
|
|
768
768
|
icon: Ri
|
|
769
769
|
}));
|
|
770
770
|
});
|
|
771
|
-
|
|
772
|
-
var Pi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M4.1302 12.4251C4.25802 13.7417 5.36779 14.7708 6.71792 14.7708H11.7179C13.1539 14.7708 14.3179 13.6067 14.3179 12.1708V6.1708C14.3179 4.78586 13.2351 3.65383 11.8698 3.57517C11.742 2.25858 10.6323 1.22949 9.28213 1.22949H4.28213C2.84619 1.22949 1.68213 2.39355 1.68213 3.82949V9.82949C1.68213 11.2144 2.76497 12.3465 4.1302 12.4251ZM10.6583 3.5708H6.71792C5.28198 3.5708 4.11792 4.73486 4.11792 6.1708V11.22C3.4221 11.1387 2.88213 10.5471 2.88213 9.82949V3.82949C2.88213 3.05629 3.50893 2.42949 4.28213 2.42949H9.28213C9.96695 2.42949 10.5369 2.92119 10.6583 3.5708ZM13.1179 6.1708C13.1179 5.3976 12.4911 4.7708 11.7179 4.7708H6.71792C5.94472 4.7708 5.31792 5.3976 5.31792 6.1708V12.1708C5.31792 12.944 5.94472 13.5708 6.71792 13.5708H11.7179C12.4911 13.5708 13.1179 12.944 13.1179 12.1708V6.1708Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Dn =
|
|
773
|
-
return
|
|
774
|
-
id: "copy-
|
|
771
|
+
Ke.displayName = "AllBorderIcon";
|
|
772
|
+
var Pi = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M4.1302 12.4251C4.25802 13.7417 5.36779 14.7708 6.71792 14.7708H11.7179C13.1539 14.7708 14.3179 13.6067 14.3179 12.1708V6.1708C14.3179 4.78586 13.2351 3.65383 11.8698 3.57517C11.742 2.25858 10.6323 1.22949 9.28213 1.22949H4.28213C2.84619 1.22949 1.68213 2.39355 1.68213 3.82949V9.82949C1.68213 11.2144 2.76497 12.3465 4.1302 12.4251ZM10.6583 3.5708H6.71792C5.28198 3.5708 4.11792 4.73486 4.11792 6.1708V11.22C3.4221 11.1387 2.88213 10.5471 2.88213 9.82949V3.82949C2.88213 3.05629 3.50893 2.42949 4.28213 2.42949H9.28213C9.96695 2.42949 10.5369 2.92119 10.6583 3.5708ZM13.1179 6.1708C13.1179 5.3976 12.4911 4.7708 11.7179 4.7708H6.71792C5.94472 4.7708 5.31792 5.3976 5.31792 6.1708V12.1708C5.31792 12.944 5.94472 13.5708 6.71792 13.5708H11.7179C12.4911 13.5708 13.1179 12.944 13.1179 12.1708V6.1708Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Dn = le(function(t, e) {
|
|
773
|
+
return de(pe, Object.assign({}, t, {
|
|
774
|
+
id: "copy-icon",
|
|
775
775
|
ref: e,
|
|
776
776
|
icon: Pi
|
|
777
777
|
}));
|
|
778
778
|
});
|
|
779
|
-
Dn.displayName = "
|
|
780
|
-
var Li = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M9.8816 1.97978C11.0177 0.843607 12.862 0.884962 14.0004 2.02342C15.1389 3.16188 15.1803 5.00612 14.0441 6.14228L11.399 8.78737C11.1608 9.02559 10.7746 9.02559 10.5363 8.78737C10.2981 8.54915 10.2981 8.16292 10.5363 7.9247L13.1814 5.2796C13.8195 4.64155 13.8217 3.57006 13.1378 2.8861C12.4538 2.20211 11.3823 2.20438 10.7443 2.84245L7.6976 5.88911L7.69317 5.89349C7.05959 6.53211 7.05894 7.60014 7.74132 8.28252C7.97954 8.52074 7.97954 8.90697 7.74132 9.14519C7.5031 9.38341 7.11687 9.38341 6.87865 9.14519C5.74016 8.00671 5.69884 6.16251 6.83497 5.02633L6.84021 5.02116L9.8816 1.97978Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.61426 7.2364C4.85248 6.99818 5.23871 6.99818 5.47693 7.2364C5.71515 7.47462 5.71515 7.86085 5.47693 8.09907L2.83183 10.7442C2.19375 11.3823 2.1915 12.4537 2.87547 13.1377C3.55945 13.8217 4.6309 13.8194 5.26899 13.1813L8.31566 10.1347C8.32262 10.1277 8.32971 10.121 8.33691 10.1144C8.34408 10.1064 8.3515 10.0986 8.35916 10.091C8.99721 9.45291 8.99949 8.38145 8.3155 7.69746C8.07728 7.45924 8.07728 7.07301 8.3155 6.83479C8.55372 6.59657 8.93995 6.59657 9.17817 6.83479C10.3166 7.97327 10.358 9.81748 9.22183 10.9536C9.21487 10.9606 9.20779 10.9673 9.20058 10.9739C9.19341 10.9819 9.18599 10.9897 9.17833 10.9973L6.13166 14.044C4.99548 15.1802 3.15127 15.1389 2.01279 14.0004C0.874362 12.8619 0.83297 11.0177 1.96916 9.8815L4.61426 7.2364Z" } }] }, At =
|
|
781
|
-
return
|
|
782
|
-
id: "link-
|
|
779
|
+
Dn.displayName = "CopyIcon";
|
|
780
|
+
var Li = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M9.8816 1.97978C11.0177 0.843607 12.862 0.884962 14.0004 2.02342C15.1389 3.16188 15.1803 5.00612 14.0441 6.14228L11.399 8.78737C11.1608 9.02559 10.7746 9.02559 10.5363 8.78737C10.2981 8.54915 10.2981 8.16292 10.5363 7.9247L13.1814 5.2796C13.8195 4.64155 13.8217 3.57006 13.1378 2.8861C12.4538 2.20211 11.3823 2.20438 10.7443 2.84245L7.6976 5.88911L7.69317 5.89349C7.05959 6.53211 7.05894 7.60014 7.74132 8.28252C7.97954 8.52074 7.97954 8.90697 7.74132 9.14519C7.5031 9.38341 7.11687 9.38341 6.87865 9.14519C5.74016 8.00671 5.69884 6.16251 6.83497 5.02633L6.84021 5.02116L9.8816 1.97978Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.61426 7.2364C4.85248 6.99818 5.23871 6.99818 5.47693 7.2364C5.71515 7.47462 5.71515 7.86085 5.47693 8.09907L2.83183 10.7442C2.19375 11.3823 2.1915 12.4537 2.87547 13.1377C3.55945 13.8217 4.6309 13.8194 5.26899 13.1813L8.31566 10.1347C8.32262 10.1277 8.32971 10.121 8.33691 10.1144C8.34408 10.1064 8.3515 10.0986 8.35916 10.091C8.99721 9.45291 8.99949 8.38145 8.3155 7.69746C8.07728 7.45924 8.07728 7.07301 8.3155 6.83479C8.55372 6.59657 8.93995 6.59657 9.17817 6.83479C10.3166 7.97327 10.358 9.81748 9.22183 10.9536C9.21487 10.9606 9.20779 10.9673 9.20058 10.9739C9.19341 10.9819 9.18599 10.9897 9.17833 10.9973L6.13166 14.044C4.99548 15.1802 3.15127 15.1389 2.01279 14.0004C0.874362 12.8619 0.83297 11.0177 1.96916 9.8815L4.61426 7.2364Z" } }] }, At = le(function(t, e) {
|
|
781
|
+
return de(pe, Object.assign({}, t, {
|
|
782
|
+
id: "link-icon",
|
|
783
783
|
ref: e,
|
|
784
784
|
icon: Li
|
|
785
785
|
}));
|
|
786
786
|
});
|
|
787
|
-
At.displayName = "
|
|
788
|
-
var
|
|
789
|
-
return
|
|
790
|
-
id: "unlink-
|
|
787
|
+
At.displayName = "LinkIcon";
|
|
788
|
+
var wi = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", 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.76157C6.75249 4.52725 6.75249 4.14735 6.98681 3.91304L8.27535 2.62449C9.70209 1.19776 12.0153 1.19776 13.442 2.62449C14.8688 4.05123 14.8688 6.36442 13.442 7.79116L12.1535 9.0797C11.9192 9.31402 11.5393 9.31402 11.3049 9.0797C11.0706 8.84539 11.0706 8.46549 11.3049 8.23117L12.5935 6.94263C13.5516 5.98452 13.5516 4.43113 12.5935 3.47302Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M3.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.05395C4.4606 6.81963 4.0807 6.81963 3.84639 7.05395L2.55784 8.34249C1.13111 9.76923 1.13111 12.0824 2.55784 13.5092C3.98458 14.9359 6.29777 14.9359 7.72451 13.5092L9.01305 12.2206C9.24737 11.9863 9.24737 11.6064 9.01305 11.3721C8.77874 11.1378 8.39884 11.1378 8.16452 11.3721L6.87598 12.6606C5.91787 13.6187 4.36448 13.6187 3.40637 12.6606Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M3.5852 2.80332C3.35088 2.569 2.97098 2.569 2.73667 2.80332C2.50235 3.03763 2.50235 3.41753 2.73667 3.65185L12.4151 13.3302C12.6494 13.5646 13.0293 13.5646 13.2636 13.3302C13.4979 13.0959 13.4979 12.716 13.2636 12.4817L3.5852 2.80332Z" } }] }, An = le(function(t, e) {
|
|
789
|
+
return de(pe, Object.assign({}, t, {
|
|
790
|
+
id: "unlink-icon",
|
|
791
791
|
ref: e,
|
|
792
|
-
icon:
|
|
792
|
+
icon: wi
|
|
793
793
|
}));
|
|
794
794
|
});
|
|
795
|
-
An.displayName = "
|
|
796
|
-
var
|
|
797
|
-
return
|
|
798
|
-
id: "write-
|
|
795
|
+
An.displayName = "UnlinkIcon";
|
|
796
|
+
var bi = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", 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" } }] }, Vn = le(function(t, e) {
|
|
797
|
+
return de(pe, Object.assign({}, t, {
|
|
798
|
+
id: "write-icon",
|
|
799
799
|
ref: e,
|
|
800
|
-
icon:
|
|
800
|
+
icon: bi
|
|
801
801
|
}));
|
|
802
802
|
});
|
|
803
|
-
Vn.displayName = "
|
|
804
|
-
var ki = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "
|
|
805
|
-
return
|
|
806
|
-
id: "xlsx",
|
|
803
|
+
Vn.displayName = "WriteIcon";
|
|
804
|
+
var ki = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "#35BD4B", d: "M3.4535 1.12549C2.7002 1.12549 2.08954 1.73615 2.08954 2.48945V13.5104C2.08954 14.2637 2.7002 14.8744 3.4535 14.8744H12.5465C13.2998 14.8744 13.9105 14.2637 13.9105 13.5104V5.0992L10.0091 1.12549H3.4535Z" } }, { tag: "path", attrs: { fill: "#32A846", d: "M10.0075 1.12549L13.9104 5.09842H10.6742C10.306 5.09842 10.0075 4.79994 10.0075 4.43175V1.12549Z" } }, { tag: "path", attrs: { fill: "white", d: "M7.8088 10.2949L6.3764 12.403C6.26259 12.5705 6.03455 12.614 5.86705 12.5002C5.69955 12.3864 5.65603 12.1584 5.76984 11.9909L7.3655 9.64252L5.94042 7.54519C5.82661 7.37769 5.87013 7.14964 6.03763 7.03583C6.20512 6.92202 6.43317 6.96555 6.54698 7.13304L7.8088 8.9901L9.07062 7.13304C9.18443 6.96555 9.41248 6.92202 9.57997 7.03583C9.74747 7.14964 9.79099 7.37769 9.67718 7.54519L8.2521 9.64252L9.84776 11.9909C9.96157 12.1584 9.91805 12.3864 9.75055 12.5002C9.58305 12.614 9.35501 12.5705 9.2412 12.403L7.8088 10.2949Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, $n = le(function(t, e) {
|
|
805
|
+
return de(pe, Object.assign({}, t, {
|
|
806
|
+
id: "xlsx-multi-icon",
|
|
807
807
|
ref: e,
|
|
808
808
|
icon: ki
|
|
809
809
|
}));
|
|
810
810
|
});
|
|
811
|
-
$n.displayName = "
|
|
811
|
+
$n.displayName = "XlsxMultiIcon";
|
|
812
812
|
const Ti = {
|
|
813
813
|
[C.URL]: /* @__PURE__ */ m(At, {}),
|
|
814
|
-
[C.SHEET]: /* @__PURE__ */ m($n, {}),
|
|
815
|
-
[C.RANGE]: /* @__PURE__ */ m(
|
|
816
|
-
[C.DEFINE_NAME]: /* @__PURE__ */ m(
|
|
817
|
-
[C.INVALID]: /* @__PURE__ */ m(
|
|
814
|
+
[C.SHEET]: /* @__PURE__ */ m($n, { className: "univer-text-green-500" }),
|
|
815
|
+
[C.RANGE]: /* @__PURE__ */ m(Ke, {}),
|
|
816
|
+
[C.DEFINE_NAME]: /* @__PURE__ */ m(Ke, {}),
|
|
817
|
+
[C.INVALID]: /* @__PURE__ */ m(Ke, {})
|
|
818
818
|
}, vn = (t) => {
|
|
819
819
|
var M, T;
|
|
820
|
-
const e =
|
|
820
|
+
const e = S(G), n = S(ne), i = S(Tn), r = S(ut), s = S(ue), o = S(te), c = S(Ut), u = S(ht), { customRange: p, row: l, col: g, unitId: d, subUnitId: _, editPermission: I, copyPermission: f, type: w } = t;
|
|
821
821
|
if (!((M = p == null ? void 0 : p.properties) != null && M.url))
|
|
822
822
|
return null;
|
|
823
|
-
const a = c.parseHyperLink((T = p.properties.url) != null ? T : ""),
|
|
824
|
-
return /* @__PURE__ */
|
|
823
|
+
const a = c.parseHyperLink((T = p.properties.url) != null ? T : ""), b = a.type === C.INVALID;
|
|
824
|
+
return /* @__PURE__ */ Ie(
|
|
825
825
|
"div",
|
|
826
826
|
{
|
|
827
|
-
className:
|
|
827
|
+
className: We("univer-mb-1 univer-flex univer-max-w-80 univer-flex-row univer-items-center univer-justify-between univer-overflow-hidden univer-rounded-lg univer-bg-white univer-p-3 univer-shadow-md dark:!univer-bg-gray-900", bn),
|
|
828
828
|
onClick: () => e.hideCurrentPopup(),
|
|
829
829
|
children: [
|
|
830
|
-
/* @__PURE__ */
|
|
830
|
+
/* @__PURE__ */ Ie(
|
|
831
831
|
"div",
|
|
832
832
|
{
|
|
833
|
-
className:
|
|
833
|
+
className: We("univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-flex-row univer-items-center univer-truncate univer-text-sm univer-leading-5 univer-text-primary-600", { "univer-text-red-500": b }),
|
|
834
834
|
onClick: () => {
|
|
835
|
-
u.visible ||
|
|
835
|
+
u.visible || b || s.navigate(a);
|
|
836
836
|
},
|
|
837
837
|
children: [
|
|
838
838
|
/* @__PURE__ */ m(
|
|
@@ -842,11 +842,11 @@ const Ti = {
|
|
|
842
842
|
children: Ti[a.type]
|
|
843
843
|
}
|
|
844
844
|
),
|
|
845
|
-
/* @__PURE__ */ m(
|
|
845
|
+
/* @__PURE__ */ m(Fe, { showIfEllipsis: !0, title: a.name, asChild: !0, children: /* @__PURE__ */ m("span", { className: "univer-flex-1 univer-overflow-hidden univer-text-ellipsis", children: a.name }) })
|
|
846
846
|
]
|
|
847
847
|
}
|
|
848
848
|
),
|
|
849
|
-
/* @__PURE__ */
|
|
849
|
+
/* @__PURE__ */ Ie(
|
|
850
850
|
"div",
|
|
851
851
|
{
|
|
852
852
|
className: "univer-flex univer-h-6 univer-flex-none univer-flex-row univer-items-center univer-justify-center",
|
|
@@ -854,9 +854,9 @@ const Ti = {
|
|
|
854
854
|
f && /* @__PURE__ */ m(
|
|
855
855
|
"div",
|
|
856
856
|
{
|
|
857
|
-
className:
|
|
857
|
+
className: We("univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base dark:hover:!univer-bg-gray-700 hover:univer-bg-gray-100", { "univer-text-red-500": b }),
|
|
858
858
|
onClick: () => {
|
|
859
|
-
if (!
|
|
859
|
+
if (!b) {
|
|
860
860
|
if (a.type !== C.URL) {
|
|
861
861
|
const P = new URL(window.location.href);
|
|
862
862
|
P.hash = a.url.slice(1), navigator.clipboard.writeText(P.href);
|
|
@@ -868,10 +868,10 @@ const Ti = {
|
|
|
868
868
|
});
|
|
869
869
|
}
|
|
870
870
|
},
|
|
871
|
-
children: /* @__PURE__ */ m(
|
|
871
|
+
children: /* @__PURE__ */ m(Fe, { placement: "bottom", title: r.t("hyperLink.popup.copy"), children: /* @__PURE__ */ m(Dn, { className: "dark:!univer-text-white" }) })
|
|
872
872
|
}
|
|
873
873
|
),
|
|
874
|
-
|
|
874
|
+
I && /* @__PURE__ */ Ie(ui, { children: [
|
|
875
875
|
/* @__PURE__ */ m(
|
|
876
876
|
"div",
|
|
877
877
|
{
|
|
@@ -883,10 +883,10 @@ const Ti = {
|
|
|
883
883
|
row: l,
|
|
884
884
|
col: g,
|
|
885
885
|
customRangeId: p.rangeId,
|
|
886
|
-
type:
|
|
886
|
+
type: w
|
|
887
887
|
});
|
|
888
888
|
},
|
|
889
|
-
children: /* @__PURE__ */ m(
|
|
889
|
+
children: /* @__PURE__ */ m(Fe, { placement: "bottom", title: r.t("hyperLink.popup.edit"), children: /* @__PURE__ */ m(Vn, { className: "dark:!univer-text-white" }) })
|
|
890
890
|
}
|
|
891
891
|
),
|
|
892
892
|
/* @__PURE__ */ m(
|
|
@@ -894,17 +894,17 @@ const Ti = {
|
|
|
894
894
|
{
|
|
895
895
|
className: "univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base dark:hover:!univer-bg-gray-700 hover:univer-bg-gray-100",
|
|
896
896
|
onClick: () => {
|
|
897
|
-
const P =
|
|
897
|
+
const P = w === v.EDITING || w === v.ZEN_EDITOR ? wr.id : br.id;
|
|
898
898
|
n.syncExecuteCommand(P, {
|
|
899
899
|
unitId: d,
|
|
900
900
|
subUnitId: _,
|
|
901
901
|
id: p.rangeId,
|
|
902
902
|
row: l,
|
|
903
903
|
column: g,
|
|
904
|
-
documentId:
|
|
904
|
+
documentId: w === v.ZEN_EDITOR ? x : o.getCurrentEditorId()
|
|
905
905
|
}) && e.hideCurrentPopup(void 0, !0);
|
|
906
906
|
},
|
|
907
|
-
children: /* @__PURE__ */ m(
|
|
907
|
+
children: /* @__PURE__ */ m(Fe, { placement: "bottom", title: r.t("hyperLink.popup.cancel"), children: /* @__PURE__ */ m(An, { className: "dark:!univer-text-white" }) })
|
|
908
908
|
}
|
|
909
909
|
)
|
|
910
910
|
] })
|
|
@@ -916,7 +916,7 @@ const Ti = {
|
|
|
916
916
|
);
|
|
917
917
|
}, qe = () => {
|
|
918
918
|
var r, s;
|
|
919
|
-
const t =
|
|
919
|
+
const t = S(G), [e, n] = Z(null), i = S(K);
|
|
920
920
|
if (ee(() => {
|
|
921
921
|
n(t.currentPopup);
|
|
922
922
|
const o = t.currentPopup$.subscribe((c) => {
|
|
@@ -934,11 +934,11 @@ const Ti = {
|
|
|
934
934
|
return /* @__PURE__ */ m(vn, { ...e });
|
|
935
935
|
};
|
|
936
936
|
qe.componentKey = "univer.sheet.cell-link-popup";
|
|
937
|
-
var Oi = Object.getOwnPropertyDescriptor,
|
|
937
|
+
var Oi = Object.getOwnPropertyDescriptor, xi = (t, e, n, i) => {
|
|
938
938
|
for (var r = i > 1 ? void 0 : i ? Oi(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
939
939
|
(o = t[s]) && (r = o(r) || r);
|
|
940
940
|
return r;
|
|
941
|
-
},
|
|
941
|
+
}, oe = (t, e) => (n, i) => e(n, i, t);
|
|
942
942
|
const mn = (t, e) => {
|
|
943
943
|
var n, i;
|
|
944
944
|
return t.unitId === e.unitId && t.subUnitId === e.subUnitId && t.row === e.row && t.col === e.col && ((n = t.customRange) == null ? void 0 : n.rangeId) === ((i = e.customRange) == null ? void 0 : i.rangeId) && t.type === e.type;
|
|
@@ -1004,7 +1004,7 @@ let G = class extends Y {
|
|
|
1004
1004
|
collapsed: !1
|
|
1005
1005
|
},
|
|
1006
1006
|
l,
|
|
1007
|
-
|
|
1007
|
+
x
|
|
1008
1008
|
);
|
|
1009
1009
|
} else if (e.showAll)
|
|
1010
1010
|
p = this._sheetCanvasPopManagerService.attachPopupToCell(e.row, e.col, l, i, r);
|
|
@@ -1046,9 +1046,9 @@ let G = class extends Y {
|
|
|
1046
1046
|
startOffset: 0,
|
|
1047
1047
|
endOffset: c.dataStream.length - 2,
|
|
1048
1048
|
collapsed: c.dataStream.length - 2 === 0,
|
|
1049
|
-
label:
|
|
1049
|
+
label: _e.transform.getPlainText(c.dataStream)
|
|
1050
1050
|
};
|
|
1051
|
-
const u =
|
|
1051
|
+
const u = _e.customRange.getCustomRangesInterestsWithSelection(o, (s = (r = c.customRanges) == null ? void 0 : r.filter((g) => g.rangeType === xe.HYPERLINK)) != null ? s : []);
|
|
1052
1052
|
let p = o.startOffset, l = o.endOffset;
|
|
1053
1053
|
return u.forEach((g) => {
|
|
1054
1054
|
p = Math.min(p, g.startIndex), l = Math.max(l, g.endIndex + 1);
|
|
@@ -1056,7 +1056,7 @@ let G = class extends Y {
|
|
|
1056
1056
|
startOffset: p,
|
|
1057
1057
|
endOffset: l,
|
|
1058
1058
|
collapsed: p === l,
|
|
1059
|
-
label:
|
|
1059
|
+
label: _e.transform.getPlainText(c.dataStream.slice(p, l))
|
|
1060
1060
|
};
|
|
1061
1061
|
}
|
|
1062
1062
|
return null;
|
|
@@ -1078,7 +1078,7 @@ let G = class extends Y {
|
|
|
1078
1078
|
var s, o, c, u, p;
|
|
1079
1079
|
const { unitId: n, subUnitId: i, type: r } = e;
|
|
1080
1080
|
if (r === v.ZEN_EDITOR) {
|
|
1081
|
-
const l = this._univerInstanceService.getUnit(
|
|
1081
|
+
const l = this._univerInstanceService.getUnit(x, k.UNIVER_DOC);
|
|
1082
1082
|
if (!l)
|
|
1083
1083
|
return;
|
|
1084
1084
|
const g = this._textSelectionManagerService.getActiveTextRange();
|
|
@@ -1087,7 +1087,7 @@ let G = class extends Y {
|
|
|
1087
1087
|
this._currentEditingPopup = this._docCanvasPopManagerService.attachPopupToRange(
|
|
1088
1088
|
g,
|
|
1089
1089
|
this._editPopup,
|
|
1090
|
-
|
|
1090
|
+
x
|
|
1091
1091
|
);
|
|
1092
1092
|
const d = (s = l.getBody()) == null ? void 0 : s.dataStream.slice(g.startOffset, g.endOffset);
|
|
1093
1093
|
this._currentEditing$.next({
|
|
@@ -1098,8 +1098,8 @@ let G = class extends Y {
|
|
|
1098
1098
|
const l = this._getEditingRange();
|
|
1099
1099
|
if (!l)
|
|
1100
1100
|
return;
|
|
1101
|
-
this._textSelectionManagerService.replaceDocRanges([{ ...l }], { unitId:
|
|
1102
|
-
const g = this._injector.get(
|
|
1101
|
+
this._textSelectionManagerService.replaceDocRanges([{ ...l }], { unitId: Se, subUnitId: Se });
|
|
1102
|
+
const g = this._injector.get(De).getRenderById(Se);
|
|
1103
1103
|
if (!g)
|
|
1104
1104
|
return;
|
|
1105
1105
|
const d = ri(l, g);
|
|
@@ -1125,7 +1125,7 @@ let G = class extends Y {
|
|
|
1125
1125
|
const l = this._univerInstanceService.getUnit(n, k.UNIVER_SHEET), g = l == null ? void 0 : l.getSheetBySheetId(i), d = g == null ? void 0 : g.getCellRaw(e.row, e.col);
|
|
1126
1126
|
this._currentEditing$.next({
|
|
1127
1127
|
...e,
|
|
1128
|
-
label: d != null && d.p ?
|
|
1128
|
+
label: d != null && d.p ? _e.transform.getPlainText((u = (c = d.p.body) == null ? void 0 : c.dataStream) != null ? u : "") : ((p = d == null ? void 0 : d.v) != null ? p : "").toString()
|
|
1129
1129
|
});
|
|
1130
1130
|
}
|
|
1131
1131
|
}
|
|
@@ -1136,7 +1136,7 @@ let G = class extends Y {
|
|
|
1136
1136
|
const { unitId: n, subUnitId: i } = e;
|
|
1137
1137
|
let r, s;
|
|
1138
1138
|
if (e.type === v.ZEN_EDITOR) {
|
|
1139
|
-
const d = this._univerInstanceService.getUnit(
|
|
1139
|
+
const d = this._univerInstanceService.getUnit(x, k.UNIVER_DOC);
|
|
1140
1140
|
if (r = (u = (c = d == null ? void 0 : d.getBody()) == null ? void 0 : c.customRanges) == null ? void 0 : u.find((_) => _.rangeId === e.customRangeId), s = r ? (p = d == null ? void 0 : d.getBody()) == null ? void 0 : p.dataStream.slice(r.startIndex, r.endIndex + 1) : "", !r || !s)
|
|
1141
1141
|
return;
|
|
1142
1142
|
this._textSelectionManagerService.replaceTextRanges([
|
|
@@ -1151,7 +1151,7 @@ let G = class extends Y {
|
|
|
1151
1151
|
collapsed: !1
|
|
1152
1152
|
},
|
|
1153
1153
|
this._editPopup,
|
|
1154
|
-
|
|
1154
|
+
x
|
|
1155
1155
|
);
|
|
1156
1156
|
} else if (e.type === v.EDITING) {
|
|
1157
1157
|
const d = Ur(this._injector, e.unitId, e.subUnitId, e.row, e.col, e.customRangeId);
|
|
@@ -1169,10 +1169,10 @@ let G = class extends Y {
|
|
|
1169
1169
|
i
|
|
1170
1170
|
);
|
|
1171
1171
|
} else {
|
|
1172
|
-
const d = this._univerInstanceService.getUnit(n, k.UNIVER_SHEET), _ = d == null ? void 0 : d.getSheetBySheetId(i),
|
|
1172
|
+
const d = this._univerInstanceService.getUnit(n, k.UNIVER_SHEET), _ = d == null ? void 0 : d.getSheetBySheetId(i), I = _ == null ? void 0 : _.getCellRaw(e.row, e.col), f = d == null ? void 0 : d.getStyles().getStyleByCell(I), w = f == null ? void 0 : f.tr, a = Hr(this._injector, e.unitId, e.subUnitId, e.row, e.col, e.customRangeId);
|
|
1173
1173
|
if (!a || !((g = a.rects) != null && g.length))
|
|
1174
1174
|
return;
|
|
1175
|
-
r = a.customRange, s = a.label,
|
|
1175
|
+
r = a.customRange, s = a.label, w ? this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToCell(
|
|
1176
1176
|
e.row,
|
|
1177
1177
|
e.col,
|
|
1178
1178
|
this._editPopup,
|
|
@@ -1203,27 +1203,27 @@ let G = class extends Y {
|
|
|
1203
1203
|
n && (!e || e === n.type) && ((i = this._currentEditingPopup) == null || i.dispose(), this._currentEditing$.next(null));
|
|
1204
1204
|
}
|
|
1205
1205
|
};
|
|
1206
|
-
G =
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1206
|
+
G = xi([
|
|
1207
|
+
oe(0, y(Mr)),
|
|
1208
|
+
oe(1, y(lt)),
|
|
1209
|
+
oe(2, K),
|
|
1210
|
+
oe(3, te),
|
|
1211
|
+
oe(4, y(He)),
|
|
1212
|
+
oe(5, y(ni)),
|
|
1213
|
+
oe(6, ht)
|
|
1214
1214
|
], G);
|
|
1215
1215
|
var Oe = /* @__PURE__ */ ((t) => (t[t.ALLOWED = 0] = "ALLOWED", t[t.DISABLED_BY_CELL = 1] = "DISABLED_BY_CELL", t[t.ALLOW_ON_EDITING = 2] = "ALLOW_ON_EDITING", t))(Oe || {});
|
|
1216
|
-
const
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1216
|
+
const Ni = /* @__PURE__ */ new Set([
|
|
1217
|
+
St.CHECKBOX,
|
|
1218
|
+
St.LIST,
|
|
1219
|
+
St.LIST_MULTIPLE
|
|
1220
1220
|
]), Vt = (t, e, n, i) => {
|
|
1221
1221
|
var c, u, p, l, g;
|
|
1222
1222
|
const r = e.getCell(n, i);
|
|
1223
1223
|
if (r != null && r.f || r != null && r.si || (p = (u = (c = r == null ? void 0 : r.p) == null ? void 0 : c.body) == null ? void 0 : u.customBlocks) != null && p.length)
|
|
1224
1224
|
return 1;
|
|
1225
1225
|
const s = t.has(hn) ? t.get(hn) : null, o = s == null ? void 0 : s.getRuleByLocation(e.getUnitId(), e.getSheetId(), n, i);
|
|
1226
|
-
return o &&
|
|
1226
|
+
return o && Ni.has(o.type) ? !0 : (g = (l = r == null ? void 0 : r.p) == null ? void 0 : l.drawingsOrder) != null && g.length ? 2 : 0;
|
|
1227
1227
|
}, Mi = (t) => {
|
|
1228
1228
|
const e = t.get(K).getCurrentUnitForType(k.UNIVER_SHEET);
|
|
1229
1229
|
if (!e)
|
|
@@ -1234,7 +1234,7 @@ const xi = /* @__PURE__ */ new Set([
|
|
|
1234
1234
|
const r = i[0].range.startRow, s = i[0].range.startColumn;
|
|
1235
1235
|
return Vt(t, n, r, s) === 1;
|
|
1236
1236
|
}, Ui = (t) => {
|
|
1237
|
-
const e = t.get(
|
|
1237
|
+
const e = t.get(He), n = t.get(K), i = e.getTextRanges();
|
|
1238
1238
|
if (!(i != null && i.length))
|
|
1239
1239
|
return !0;
|
|
1240
1240
|
const r = n.getCurrentUnitForType(k.UNIVER_DOC);
|
|
@@ -1265,7 +1265,7 @@ const xi = /* @__PURE__ */ new Set([
|
|
|
1265
1265
|
const r = t.get(ne), o = t.get(kt).getCurrentLastSelection();
|
|
1266
1266
|
if (!o)
|
|
1267
1267
|
return !1;
|
|
1268
|
-
const c = o.range.startRow, u = o.range.startColumn, p = i.isVisible(), l = ((g = e.getFocusedUnit()) == null ? void 0 : g.getUnitId()) ===
|
|
1268
|
+
const c = o.range.startRow, u = o.range.startColumn, p = i.isVisible(), l = ((g = e.getFocusedUnit()) == null ? void 0 : g.getUnitId()) === x;
|
|
1269
1269
|
return r.executeCommand($t.id, {
|
|
1270
1270
|
unitId: n.unitId,
|
|
1271
1271
|
subUnitId: n.subUnitId,
|
|
@@ -1274,7 +1274,7 @@ const xi = /* @__PURE__ */ new Set([
|
|
|
1274
1274
|
type: l ? v.ZEN_EDITOR : p.visible ? v.EDITING : v.VIEWING
|
|
1275
1275
|
});
|
|
1276
1276
|
}
|
|
1277
|
-
},
|
|
1277
|
+
}, ce = {
|
|
1278
1278
|
type: dt.OPERATION,
|
|
1279
1279
|
id: "sheet.operation.insert-hyper-link-toolbar",
|
|
1280
1280
|
handler(t) {
|
|
@@ -1283,16 +1283,16 @@ const xi = /* @__PURE__ */ new Set([
|
|
|
1283
1283
|
const e = t.get(ne);
|
|
1284
1284
|
return t.get(G).currentEditing ? e.executeCommand(Je.id) : e.executeCommand(Bt.id);
|
|
1285
1285
|
}
|
|
1286
|
-
}, Ft = (t, e =
|
|
1286
|
+
}, Ft = (t, e = x) => {
|
|
1287
1287
|
var r;
|
|
1288
|
-
const n = t.get(K), i = (r = t.get(
|
|
1288
|
+
const n = t.get(K), i = (r = t.get(De).getRenderById(e)) == null ? void 0 : r.with(xn);
|
|
1289
1289
|
return i ? i.textSelectionInner$.pipe(Ht(() => {
|
|
1290
1290
|
const o = t.get(te).getEditCellState();
|
|
1291
1291
|
if (!o)
|
|
1292
1292
|
return !0;
|
|
1293
1293
|
const c = Tt(n, { unitId: o.unitId, subUnitId: o.sheetId });
|
|
1294
1294
|
return !(c != null && c.worksheet) || Vt(t, c.worksheet, o.row, o.column) === 1 ? !0 : Ui(t);
|
|
1295
|
-
})) :
|
|
1295
|
+
})) : ae(!0);
|
|
1296
1296
|
}, Bn = (t) => {
|
|
1297
1297
|
var r;
|
|
1298
1298
|
const e = t.get(K), n = t.has(te) ? t.get(te) : null;
|
|
@@ -1303,24 +1303,24 @@ const xi = /* @__PURE__ */ new Set([
|
|
|
1303
1303
|
const o = Tt(e, { unitId: s.unitId, subUnitId: s.sheetId });
|
|
1304
1304
|
return o ? Vt(t, o.worksheet, s.row, s.column) : Oe.DISABLED_BY_CELL;
|
|
1305
1305
|
}),
|
|
1306
|
-
|
|
1306
|
+
Ue((s) => {
|
|
1307
1307
|
if (s === Oe.DISABLED_BY_CELL)
|
|
1308
|
-
return
|
|
1309
|
-
const o = n ? n.visible$ :
|
|
1308
|
+
return ae(!0);
|
|
1309
|
+
const o = n ? n.visible$ : ae(null);
|
|
1310
1310
|
return ai([o, e.getCurrentTypeOfUnit$(k.UNIVER_DOC)]).pipe(
|
|
1311
|
-
|
|
1312
|
-
([c, u]) => c != null && c.visible ? (u == null ? void 0 : u.getUnitId()) === sr ?
|
|
1311
|
+
Ue(
|
|
1312
|
+
([c, u]) => c != null && c.visible ? (u == null ? void 0 : u.getUnitId()) === sr ? ae(!0) : Ft(t, Se) : ae(s !== Oe.ALLOWED)
|
|
1313
1313
|
)
|
|
1314
1314
|
);
|
|
1315
1315
|
})
|
|
1316
|
-
)) != null ? r :
|
|
1317
|
-
|
|
1316
|
+
)) != null ? r : ae(!0)).pipe(
|
|
1317
|
+
Ue((s) => s ? ae(!0) : Ar(t, { workbookTypes: [Mt], worksheetTypes: [xt, Pn, Nt], rangeTypes: [Ot] }, !0))
|
|
1318
1318
|
);
|
|
1319
1319
|
}, Qe = {
|
|
1320
1320
|
commandId: Bt.id,
|
|
1321
1321
|
type: On.BUTTON,
|
|
1322
1322
|
title: "hyperLink.menu.add",
|
|
1323
|
-
icon: "
|
|
1323
|
+
icon: "LinkIcon"
|
|
1324
1324
|
}, et = (t) => `${t}-zen-editor`, Hi = (t) => ({
|
|
1325
1325
|
...Qe,
|
|
1326
1326
|
id: Qe.commandId,
|
|
@@ -1330,13 +1330,13 @@ const xi = /* @__PURE__ */ new Set([
|
|
|
1330
1330
|
}), Di = (t) => ({
|
|
1331
1331
|
...Qe,
|
|
1332
1332
|
id: et(Qe.commandId),
|
|
1333
|
-
hidden$: gt(t, k.UNIVER_DOC,
|
|
1333
|
+
hidden$: gt(t, k.UNIVER_DOC, x),
|
|
1334
1334
|
disabled$: Ft(t)
|
|
1335
1335
|
}), tt = {
|
|
1336
1336
|
tooltip: "hyperLink.form.addTitle",
|
|
1337
|
-
commandId:
|
|
1337
|
+
commandId: ce.id,
|
|
1338
1338
|
type: On.BUTTON,
|
|
1339
|
-
icon: "
|
|
1339
|
+
icon: "LinkIcon"
|
|
1340
1340
|
}, Ai = (t) => ({
|
|
1341
1341
|
...tt,
|
|
1342
1342
|
id: tt.commandId,
|
|
@@ -1345,10 +1345,10 @@ const xi = /* @__PURE__ */ new Set([
|
|
|
1345
1345
|
}), Vi = (t) => ({
|
|
1346
1346
|
...tt,
|
|
1347
1347
|
id: et(tt.commandId),
|
|
1348
|
-
hidden$: gt(t, k.UNIVER_DOC,
|
|
1348
|
+
hidden$: gt(t, k.UNIVER_DOC, x),
|
|
1349
1349
|
disabled$: Ft(t)
|
|
1350
1350
|
}), Fn = {
|
|
1351
|
-
id:
|
|
1351
|
+
id: ce.id,
|
|
1352
1352
|
binding: Lt.K | Yr.CTRL_COMMAND,
|
|
1353
1353
|
preconditions: Dr
|
|
1354
1354
|
};
|
|
@@ -1367,79 +1367,79 @@ let nt = class extends Y {
|
|
|
1367
1367
|
const { source: s, target: o, unitId: c, subUnitId: u } = i, p = Pt([s, o]), [l, g] = p.ranges, { mapFunc: d } = p, _ = {
|
|
1368
1368
|
row: l.startRow,
|
|
1369
1369
|
col: l.startColumn
|
|
1370
|
-
},
|
|
1371
|
-
return
|
|
1372
|
-
const
|
|
1370
|
+
}, I = $r(l, g), f = [], w = [];
|
|
1371
|
+
return I.forEach((a) => {
|
|
1372
|
+
const b = a.repeatStartCell, M = a.relativeRange, T = {
|
|
1373
1373
|
startRow: _.row,
|
|
1374
1374
|
startColumn: _.col,
|
|
1375
1375
|
endColumn: _.col,
|
|
1376
1376
|
endRow: _.row
|
|
1377
1377
|
}, P = {
|
|
1378
|
-
startRow:
|
|
1379
|
-
startColumn:
|
|
1380
|
-
endColumn:
|
|
1381
|
-
endRow:
|
|
1378
|
+
startRow: b.row,
|
|
1379
|
+
startColumn: b.col,
|
|
1380
|
+
endColumn: b.col,
|
|
1381
|
+
endRow: b.row
|
|
1382
1382
|
};
|
|
1383
|
-
yn.foreach(M, (
|
|
1384
|
-
const z =
|
|
1383
|
+
yn.foreach(M, (D, A) => {
|
|
1384
|
+
const z = ye.getPositionRange(
|
|
1385
1385
|
{
|
|
1386
|
-
startRow:
|
|
1387
|
-
startColumn:
|
|
1388
|
-
endColumn:
|
|
1389
|
-
endRow:
|
|
1386
|
+
startRow: D,
|
|
1387
|
+
startColumn: A,
|
|
1388
|
+
endColumn: A,
|
|
1389
|
+
endRow: D
|
|
1390
1390
|
},
|
|
1391
1391
|
T
|
|
1392
|
-
), { row:
|
|
1392
|
+
), { row: re, col: Ae } = d(z.startRow, z.startColumn), ie = this._hyperLinkModel.getHyperLinkByLocation(c, u, re, Ae), Ee = ye.getPositionRange(
|
|
1393
1393
|
{
|
|
1394
|
-
startRow:
|
|
1395
|
-
startColumn:
|
|
1396
|
-
endColumn:
|
|
1397
|
-
endRow:
|
|
1394
|
+
startRow: D,
|
|
1395
|
+
startColumn: A,
|
|
1396
|
+
endColumn: A,
|
|
1397
|
+
endRow: D
|
|
1398
1398
|
},
|
|
1399
1399
|
P
|
|
1400
|
-
), { row: Re, col: Pe } = d(Ee.startRow, Ee.startColumn),
|
|
1401
|
-
|
|
1400
|
+
), { row: Re, col: Pe } = d(Ee.startRow, Ee.startColumn), Ve = Ce.generateRandomId(), he = this._hyperLinkModel.getHyperLinkByLocation(c, u, Re, Pe);
|
|
1401
|
+
he && f.push({
|
|
1402
1402
|
id: Ne.id,
|
|
1403
1403
|
params: {
|
|
1404
1404
|
unitId: c,
|
|
1405
1405
|
subUnitId: u,
|
|
1406
|
-
id:
|
|
1406
|
+
id: he.id
|
|
1407
1407
|
}
|
|
1408
|
-
}), (
|
|
1409
|
-
id:
|
|
1408
|
+
}), (be.COPY === r || be.SERIES === r) && ie && (f.push({
|
|
1409
|
+
id: Me.id,
|
|
1410
1410
|
params: {
|
|
1411
1411
|
unitId: c,
|
|
1412
1412
|
subUnitId: u,
|
|
1413
1413
|
link: {
|
|
1414
|
-
...
|
|
1415
|
-
id:
|
|
1414
|
+
...ie,
|
|
1415
|
+
id: Ve,
|
|
1416
1416
|
row: Re,
|
|
1417
1417
|
column: Pe
|
|
1418
1418
|
}
|
|
1419
1419
|
}
|
|
1420
|
-
}),
|
|
1420
|
+
}), w.push({
|
|
1421
1421
|
id: Ne.id,
|
|
1422
1422
|
params: {
|
|
1423
1423
|
unitId: c,
|
|
1424
1424
|
subUnitId: u,
|
|
1425
|
-
id:
|
|
1425
|
+
id: Ve
|
|
1426
1426
|
}
|
|
1427
|
-
})),
|
|
1428
|
-
id:
|
|
1427
|
+
})), he && w.push({
|
|
1428
|
+
id: Me.id,
|
|
1429
1429
|
params: {
|
|
1430
1430
|
unitId: c,
|
|
1431
1431
|
subUnitId: u,
|
|
1432
|
-
link:
|
|
1432
|
+
link: he
|
|
1433
1433
|
}
|
|
1434
1434
|
});
|
|
1435
1435
|
});
|
|
1436
1436
|
}), {
|
|
1437
|
-
undos:
|
|
1437
|
+
undos: w,
|
|
1438
1438
|
redos: f
|
|
1439
1439
|
};
|
|
1440
1440
|
}, n = {
|
|
1441
1441
|
id: Dt,
|
|
1442
|
-
onFillData: (i, r, s) => s ===
|
|
1442
|
+
onFillData: (i, r, s) => s === be.COPY || s === be.ONLY_FORMAT || s === be.SERIES ? e(i, s) : t()
|
|
1443
1443
|
};
|
|
1444
1444
|
this.disposeWithMe(this._autoFillService.addHook(n));
|
|
1445
1445
|
}
|
|
@@ -1463,7 +1463,7 @@ let rt = class extends Y {
|
|
|
1463
1463
|
t.id === Fn.id && (this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
1464
1464
|
workbookTypes: [Mt],
|
|
1465
1465
|
rangeTypes: [Ot],
|
|
1466
|
-
worksheetTypes: [
|
|
1466
|
+
worksheetTypes: [xt, Pn, Nt]
|
|
1467
1467
|
}) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.hyperLinkErr")));
|
|
1468
1468
|
})
|
|
1469
1469
|
);
|
|
@@ -1484,8 +1484,8 @@ let it = class extends Y {
|
|
|
1484
1484
|
super(), this._hoverManagerService = t, this._sheetsHyperLinkPopupService = e, this._renderManagerService = n, this._permissionService = i, this._sheetPermissionCheckController = r, this._commandService = s, this._editorBridgeService = o, this._textSelectionManagerService = c, this._univerInstanceService = u, this._zenZoneService = p, this._initHoverListener(), this._initCommandListener(), this._initHoverEditingListener(), this._initTextSelectionListener(), this._initZenEditor();
|
|
1485
1485
|
}
|
|
1486
1486
|
_getLinkPermission(t) {
|
|
1487
|
-
const { unitId: e, subUnitId: n, row: i, col: r } = t, s = this._univerInstanceService.getUnit(e, k.UNIVER_SHEET);
|
|
1488
|
-
if (!
|
|
1487
|
+
const { unitId: e, subUnitId: n, row: i, col: r } = t, s = this._univerInstanceService.getUnit(e, k.UNIVER_SHEET), o = s == null ? void 0 : s.getSheetBySheetId(n);
|
|
1488
|
+
if (!o)
|
|
1489
1489
|
return {
|
|
1490
1490
|
viewPermission: !1,
|
|
1491
1491
|
editPermission: !1,
|
|
@@ -1495,23 +1495,27 @@ let it = class extends Y {
|
|
|
1495
1495
|
workbookTypes: [gr],
|
|
1496
1496
|
worksheetTypes: [hr],
|
|
1497
1497
|
rangeTypes: [pr]
|
|
1498
|
-
}, [{ startRow: i, startColumn: r, endRow: i, endColumn: r }])
|
|
1498
|
+
}, [{ startRow: i, startColumn: r, endRow: i, endColumn: r }]);
|
|
1499
|
+
let u = this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
1499
1500
|
workbookTypes: [Mt],
|
|
1500
|
-
worksheetTypes: [
|
|
1501
|
+
worksheetTypes: [xt, Nt],
|
|
1501
1502
|
rangeTypes: [Ot]
|
|
1502
|
-
}, [{ startRow: i, startColumn: r, endRow: i, endColumn: r }])
|
|
1503
|
+
}, [{ startRow: i, startColumn: r, endRow: i, endColumn: r }]);
|
|
1504
|
+
const p = o.getCellRaw(i, r);
|
|
1505
|
+
p != null && p.f && p.f.startsWith("=HYPERLINK(") && (u = !1);
|
|
1506
|
+
const l = this._permissionService.composePermission([new vr(e).id, new mr(e, n).id]).every((g) => g.value);
|
|
1503
1507
|
return {
|
|
1504
1508
|
viewPermission: c,
|
|
1505
1509
|
editPermission: u,
|
|
1506
|
-
copyPermission:
|
|
1510
|
+
copyPermission: l
|
|
1507
1511
|
};
|
|
1508
1512
|
}
|
|
1509
1513
|
_initHoverListener() {
|
|
1510
1514
|
this.disposeWithMe(
|
|
1511
1515
|
// hover over not editing cell
|
|
1512
|
-
this._hoverManagerService.currentRichText$.pipe(
|
|
1513
|
-
var T, P;
|
|
1514
|
-
if (!t) {
|
|
1516
|
+
this._hoverManagerService.currentRichText$.pipe(Ge(200)).subscribe((t) => {
|
|
1517
|
+
var T, P, D;
|
|
1518
|
+
if (!t || ((T = t.customRange) == null ? void 0 : T.rangeType) !== xe.HYPERLINK) {
|
|
1515
1519
|
this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
1516
1520
|
return;
|
|
1517
1521
|
}
|
|
@@ -1525,17 +1529,17 @@ let it = class extends Y {
|
|
|
1525
1529
|
this._sheetsHyperLinkPopupService.hideCurrentPopup(v.VIEWING);
|
|
1526
1530
|
return;
|
|
1527
1531
|
}
|
|
1528
|
-
const p = (
|
|
1532
|
+
const p = (P = s == null ? void 0 : s.with(un).getSkeletonParam(n)) == null ? void 0 : P.skeleton, l = r, g = i;
|
|
1529
1533
|
let d = g, _ = l;
|
|
1530
|
-
p && p.overflowCache.forValue((
|
|
1531
|
-
|
|
1534
|
+
p && p.overflowCache.forValue((A, z, re) => {
|
|
1535
|
+
ye.contains(re, { startColumn: l, endColumn: l, startRow: g, endRow: g }) && (d = A, _ = z);
|
|
1532
1536
|
});
|
|
1533
|
-
const { viewPermission:
|
|
1534
|
-
if (!
|
|
1537
|
+
const { viewPermission: I, editPermission: f, copyPermission: w } = this._getLinkPermission(t);
|
|
1538
|
+
if (!I) {
|
|
1535
1539
|
this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
1536
1540
|
return;
|
|
1537
1541
|
}
|
|
1538
|
-
const a = c.getCellStyleOnly(d, _),
|
|
1542
|
+
const a = c.getCellStyleOnly(d, _), b = o.getStyles().getStyleByCell(a), M = (D = b == null ? void 0 : b.tr) == null ? void 0 : D.a;
|
|
1539
1543
|
if (!M && !t.customRange) {
|
|
1540
1544
|
this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
1541
1545
|
return;
|
|
@@ -1544,7 +1548,7 @@ let it = class extends Y {
|
|
|
1544
1548
|
row: d,
|
|
1545
1549
|
col: _,
|
|
1546
1550
|
editPermission: f,
|
|
1547
|
-
copyPermission:
|
|
1551
|
+
copyPermission: w,
|
|
1548
1552
|
customRange: t.customRange,
|
|
1549
1553
|
customRangeRect: t.rect,
|
|
1550
1554
|
type: v.VIEWING,
|
|
@@ -1558,8 +1562,8 @@ let it = class extends Y {
|
|
|
1558
1562
|
_initHoverEditingListener() {
|
|
1559
1563
|
let t = null;
|
|
1560
1564
|
this.disposeWithMe(
|
|
1561
|
-
this._editorBridgeService.currentEditCellState$.pipe(
|
|
1562
|
-
if (!n || n.editorUnitId !==
|
|
1565
|
+
this._editorBridgeService.currentEditCellState$.pipe(Ue((e) => this._editorBridgeService.visible$.pipe(Ht((n) => ({ visible: n, state: e }))))).subscribe(({ visible: e, state: n }) => {
|
|
1566
|
+
if (!n || n.editorUnitId !== Se)
|
|
1563
1567
|
return;
|
|
1564
1568
|
if (!e.visible) {
|
|
1565
1569
|
t == null || t.unsubscribe(), this._sheetsHyperLinkPopupService.hideCurrentPopup(v.EDITING), this._sheetsHyperLinkPopupService.endEditing(v.EDITING);
|
|
@@ -1569,15 +1573,15 @@ let it = class extends Y {
|
|
|
1569
1573
|
if (!u)
|
|
1570
1574
|
return;
|
|
1571
1575
|
const { editPermission: p, viewPermission: l, copyPermission: g } = this._getLinkPermission({ unitId: r, subUnitId: s, row: o, col: c }), d = u.with(pn);
|
|
1572
|
-
l && (t == null || t.unsubscribe(), t = d.hoverCustomRanges$.pipe(
|
|
1573
|
-
var
|
|
1574
|
-
const
|
|
1575
|
-
if (!
|
|
1576
|
+
l && (t == null || t.unsubscribe(), t = d.hoverCustomRanges$.pipe(Ge(200)).subscribe((_) => {
|
|
1577
|
+
var b, M;
|
|
1578
|
+
const I = _.find((T) => T.range.rangeType === xe.HYPERLINK);
|
|
1579
|
+
if (!I) {
|
|
1576
1580
|
this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
1577
1581
|
return;
|
|
1578
1582
|
}
|
|
1579
|
-
const f =
|
|
1580
|
-
if (!((M = (
|
|
1583
|
+
const f = I.rects[I.rects.length - 1];
|
|
1584
|
+
if (!((M = (b = this._renderManagerService.getRenderById(r)) == null ? void 0 : b.with(un).getSkeletonParam(s)) == null ? void 0 : M.skeleton) || !f)
|
|
1581
1585
|
return;
|
|
1582
1586
|
const a = u.engine.getCanvasElement().getBoundingClientRect();
|
|
1583
1587
|
this._sheetsHyperLinkPopupService.showPopup({
|
|
@@ -1585,7 +1589,7 @@ let it = class extends Y {
|
|
|
1585
1589
|
subUnitId: s,
|
|
1586
1590
|
row: o,
|
|
1587
1591
|
col: c,
|
|
1588
|
-
customRange:
|
|
1592
|
+
customRange: I.range,
|
|
1589
1593
|
customRangeRect: {
|
|
1590
1594
|
left: f.left + a.left,
|
|
1591
1595
|
top: f.top + a.top,
|
|
@@ -1609,14 +1613,14 @@ let it = class extends Y {
|
|
|
1609
1613
|
})
|
|
1610
1614
|
), this.disposeWithMe(
|
|
1611
1615
|
this._univerInstanceService.focused$.pipe(
|
|
1612
|
-
|
|
1613
|
-
const e = t ===
|
|
1614
|
-
return e ? e.with(pn).hoverCustomRanges$.pipe(
|
|
1616
|
+
Ue((t) => {
|
|
1617
|
+
const e = t === x ? this._renderManagerService.getRenderById(t) : null;
|
|
1618
|
+
return e ? e.with(pn).hoverCustomRanges$.pipe(Ge(200)) : new ci((n) => {
|
|
1615
1619
|
n.next(null);
|
|
1616
1620
|
});
|
|
1617
1621
|
})
|
|
1618
1622
|
).subscribe((t) => {
|
|
1619
|
-
const e = t == null ? void 0 : t.find((i) => i.range.rangeType ===
|
|
1623
|
+
const e = t == null ? void 0 : t.find((i) => i.range.rangeType === xe.HYPERLINK), n = this._editorBridgeService.getEditCellState();
|
|
1620
1624
|
if (e && n) {
|
|
1621
1625
|
const { unitId: i, sheetId: r, row: s, column: o } = n, { editPermission: c, viewPermission: u, copyPermission: p } = this._getLinkPermission({ unitId: i, subUnitId: r, row: s, col: o });
|
|
1622
1626
|
u && this._sheetsHyperLinkPopupService.showPopup({
|
|
@@ -1637,12 +1641,12 @@ let it = class extends Y {
|
|
|
1637
1641
|
_initTextSelectionListener() {
|
|
1638
1642
|
this.disposeWithMe(
|
|
1639
1643
|
this._textSelectionManagerService.textSelection$.subscribe((t) => {
|
|
1640
|
-
t && t.unitId ===
|
|
1644
|
+
t && t.unitId === Se && this._sheetsHyperLinkPopupService.endEditing(v.EDITING);
|
|
1641
1645
|
})
|
|
1642
1646
|
);
|
|
1643
1647
|
}
|
|
1644
1648
|
_initCommandListener() {
|
|
1645
|
-
const t = [fr.id, _r.id,
|
|
1649
|
+
const t = [fr.id, _r.id, Ir.id];
|
|
1646
1650
|
this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
|
|
1647
1651
|
t.includes(e.id) && this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
1648
1652
|
}));
|
|
@@ -1651,12 +1655,12 @@ let it = class extends Y {
|
|
|
1651
1655
|
it = Zi([
|
|
1652
1656
|
W(0, y(Br)),
|
|
1653
1657
|
W(1, y(G)),
|
|
1654
|
-
W(2, y(
|
|
1658
|
+
W(2, y(De)),
|
|
1655
1659
|
W(3, y(or)),
|
|
1656
1660
|
W(4, y(Ln)),
|
|
1657
1661
|
W(5, ne),
|
|
1658
1662
|
W(6, te),
|
|
1659
|
-
W(7, y(
|
|
1663
|
+
W(7, y(He)),
|
|
1660
1664
|
W(8, K),
|
|
1661
1665
|
W(9, ht)
|
|
1662
1666
|
], it);
|
|
@@ -1664,8 +1668,8 @@ var Gi = Object.getOwnPropertyDescriptor, jn = (t, e, n, i) => {
|
|
|
1664
1668
|
for (var r = i > 1 ? void 0 : i ? Gi(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1665
1669
|
(o = t[s]) && (r = o(r) || r);
|
|
1666
1670
|
return r;
|
|
1667
|
-
},
|
|
1668
|
-
let
|
|
1671
|
+
}, wt = (t, e) => (n, i) => e(n, i, t);
|
|
1672
|
+
let bt = class extends Y {
|
|
1669
1673
|
constructor(t, e) {
|
|
1670
1674
|
super(), this._context = t, this._hyperLinkModel = e, this._initSkeletonChange();
|
|
1671
1675
|
}
|
|
@@ -1674,14 +1678,14 @@ let wt = class extends Y {
|
|
|
1674
1678
|
var e;
|
|
1675
1679
|
(e = this._context.mainComponent) == null || e.makeForceDirty();
|
|
1676
1680
|
};
|
|
1677
|
-
this.disposeWithMe(this._hyperLinkModel.linkUpdate$.pipe(
|
|
1681
|
+
this.disposeWithMe(this._hyperLinkModel.linkUpdate$.pipe(Ge(16)).subscribe(() => {
|
|
1678
1682
|
t();
|
|
1679
1683
|
}));
|
|
1680
1684
|
}
|
|
1681
1685
|
};
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
],
|
|
1686
|
+
bt = jn([
|
|
1687
|
+
wt(1, y(pt))
|
|
1688
|
+
], bt);
|
|
1685
1689
|
let st = class extends Y {
|
|
1686
1690
|
constructor(t, e) {
|
|
1687
1691
|
super(), this._sheetInterceptorService = t, this._hyperLinkModel = e, this._initViewModelIntercept();
|
|
@@ -1689,17 +1693,13 @@ let st = class extends Y {
|
|
|
1689
1693
|
_initViewModelIntercept() {
|
|
1690
1694
|
this.disposeWithMe(
|
|
1691
1695
|
this._sheetInterceptorService.intercept(
|
|
1692
|
-
|
|
1696
|
+
Sr.CELL_CONTENT,
|
|
1693
1697
|
{
|
|
1694
1698
|
effect: ar.Value,
|
|
1695
1699
|
priority: 100,
|
|
1696
1700
|
handler: (t, e, n) => {
|
|
1697
1701
|
const { row: i, col: r, unitId: s, subUnitId: o } = e, c = this._hyperLinkModel.getHyperLinkByLocation(s, o, i, r);
|
|
1698
|
-
return
|
|
1699
|
-
...t,
|
|
1700
|
-
linkUrl: c.payload,
|
|
1701
|
-
linkId: c.id
|
|
1702
|
-
} : t);
|
|
1702
|
+
return c && t && (t === e.rawData && (t = { ...e.rawData }), t.linkUrl = c.payload, t.linkId = c.id), n(t);
|
|
1703
1703
|
}
|
|
1704
1704
|
}
|
|
1705
1705
|
)
|
|
@@ -1707,16 +1707,16 @@ let st = class extends Y {
|
|
|
1707
1707
|
}
|
|
1708
1708
|
};
|
|
1709
1709
|
st = jn([
|
|
1710
|
-
|
|
1711
|
-
|
|
1710
|
+
wt(0, y(Cr)),
|
|
1711
|
+
wt(1, y(pt))
|
|
1712
1712
|
], st);
|
|
1713
1713
|
const Ki = {
|
|
1714
1714
|
[qr.MEDIA]: {
|
|
1715
|
-
[
|
|
1715
|
+
[ce.id]: {
|
|
1716
1716
|
order: 1,
|
|
1717
1717
|
menuItemFactory: Ai
|
|
1718
1718
|
},
|
|
1719
|
-
[et(
|
|
1719
|
+
[et(ce.id)]: {
|
|
1720
1720
|
order: 1,
|
|
1721
1721
|
menuItemFactory: Vi
|
|
1722
1722
|
}
|
|
@@ -1724,11 +1724,11 @@ const Ki = {
|
|
|
1724
1724
|
[zr.MAIN_AREA]: {
|
|
1725
1725
|
[Xr.OTHERS]: {
|
|
1726
1726
|
order: 1,
|
|
1727
|
-
[
|
|
1727
|
+
[ce.id]: {
|
|
1728
1728
|
order: 0,
|
|
1729
1729
|
menuItemFactory: Hi
|
|
1730
1730
|
},
|
|
1731
|
-
[et(
|
|
1731
|
+
[et(ce.id)]: {
|
|
1732
1732
|
order: 0,
|
|
1733
1733
|
menuItemFactory: Di
|
|
1734
1734
|
}
|
|
@@ -1746,11 +1746,11 @@ let ot = class extends Y {
|
|
|
1746
1746
|
}
|
|
1747
1747
|
_initComponents() {
|
|
1748
1748
|
[
|
|
1749
|
-
[qe, qe
|
|
1750
|
-
[Xe, Xe
|
|
1751
|
-
[
|
|
1749
|
+
[qe.componentKey, qe],
|
|
1750
|
+
[Xe.componentKey, Xe],
|
|
1751
|
+
["LinkIcon", At]
|
|
1752
1752
|
].forEach(([t, e]) => {
|
|
1753
|
-
this._componentManager.register(
|
|
1753
|
+
this._componentManager.register(t, e);
|
|
1754
1754
|
});
|
|
1755
1755
|
}
|
|
1756
1756
|
_initCommands() {
|
|
@@ -1758,7 +1758,7 @@ let ot = class extends Y {
|
|
|
1758
1758
|
$t,
|
|
1759
1759
|
Je,
|
|
1760
1760
|
Bt,
|
|
1761
|
-
|
|
1761
|
+
ce
|
|
1762
1762
|
].forEach((t) => {
|
|
1763
1763
|
this._commandService.registerCommand(t);
|
|
1764
1764
|
});
|
|
@@ -1796,13 +1796,13 @@ let at = class extends Y {
|
|
|
1796
1796
|
};
|
|
1797
1797
|
at = qi([
|
|
1798
1798
|
_n(0, y(Ut)),
|
|
1799
|
-
_n(1, y(
|
|
1799
|
+
_n(1, y(ue))
|
|
1800
1800
|
], at);
|
|
1801
1801
|
var Ji = Object.defineProperty, Qi = Object.getOwnPropertyDescriptor, es = (t, e, n) => e in t ? Ji(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ts = (t, e, n, i) => {
|
|
1802
1802
|
for (var r = i > 1 ? void 0 : i ? Qi(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1803
1803
|
(o = t[s]) && (r = o(r) || r);
|
|
1804
1804
|
return r;
|
|
1805
|
-
},
|
|
1805
|
+
}, In = (t, e) => (n, i) => e(n, i, t), Wn = (t, e, n) => es(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1806
1806
|
let ct = class extends ur {
|
|
1807
1807
|
constructor(t = gn, e, n) {
|
|
1808
1808
|
super(), this._config = t, this._injector = e, this._configService = n;
|
|
@@ -1815,7 +1815,7 @@ let ct = class extends ur {
|
|
|
1815
1815
|
}
|
|
1816
1816
|
onStarting() {
|
|
1817
1817
|
[
|
|
1818
|
-
[
|
|
1818
|
+
[ue],
|
|
1819
1819
|
[G],
|
|
1820
1820
|
[Un],
|
|
1821
1821
|
[st],
|
|
@@ -1828,7 +1828,7 @@ let ct = class extends ur {
|
|
|
1828
1828
|
].forEach((e) => this._injector.add(e)), this._injector.get(st);
|
|
1829
1829
|
}
|
|
1830
1830
|
onReady() {
|
|
1831
|
-
this._injector.get(
|
|
1831
|
+
this._injector.get(De).registerRenderModule(k.UNIVER_SHEET, [bt]), this._injector.get(nt), this._injector.get(ze), this._injector.get(ot);
|
|
1832
1832
|
}
|
|
1833
1833
|
onRendered() {
|
|
1834
1834
|
this._injector.get(rt), this._injector.get(at), this._injector.get(it);
|
|
@@ -1838,8 +1838,8 @@ Wn(ct, "pluginName", Dt);
|
|
|
1838
1838
|
Wn(ct, "type", k.UNIVER_SHEET);
|
|
1839
1839
|
ct = ts([
|
|
1840
1840
|
cr(kr, ii),
|
|
1841
|
-
|
|
1842
|
-
|
|
1841
|
+
In(1, y(lt)),
|
|
1842
|
+
In(2, Cn)
|
|
1843
1843
|
], ct);
|
|
1844
1844
|
export {
|
|
1845
1845
|
Je as CloseHyperLinkPopupOperation,
|
|
@@ -1848,7 +1848,7 @@ export {
|
|
|
1848
1848
|
$t as OpenHyperLinkEditPanelOperation,
|
|
1849
1849
|
ze as SheetsHyperLinkCopyPasteController,
|
|
1850
1850
|
G as SheetsHyperLinkPopupService,
|
|
1851
|
-
|
|
1851
|
+
ue as SheetsHyperLinkResolverService,
|
|
1852
1852
|
Un as SheetsHyperLinkSidePanelService,
|
|
1853
1853
|
ct as UniverSheetsHyperLinkUIPlugin
|
|
1854
1854
|
};
|