@univerjs/sheets-hyper-link-ui 0.6.10 → 0.7.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 +29 -1
- package/lib/es/index.js +890 -846
- package/lib/index.css +1 -1
- package/lib/index.js +890 -846
- package/lib/umd/index.js +29 -1
- package/package.json +17 -17
package/lib/index.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var $ = (t, e, n) =>
|
|
4
|
-
import { Tools as
|
|
5
|
-
import { SetSelectionsOperation as
|
|
6
|
-
import { SheetHyperLinkType as C, ERROR_RANGE as
|
|
7
|
-
import { ScrollToRangeOperation as
|
|
8
|
-
import { MessageType as
|
|
9
|
-
import { IDefinedNamesService as
|
|
10
|
-
import { IMessageService as
|
|
11
|
-
import { DocSelectionRenderService as
|
|
12
|
-
import { IRenderManagerService as
|
|
13
|
-
import { Subject as
|
|
14
|
-
import { DocSelectionManagerService as
|
|
15
|
-
import { jsxs as
|
|
16
|
-
import { RangeSelector as
|
|
17
|
-
import { useState as
|
|
18
|
-
import { SheetDataValidationModel as
|
|
19
|
-
function
|
|
20
|
-
return
|
|
1
|
+
var Xn = Object.defineProperty;
|
|
2
|
+
var qn = (t, e, n) => e in t ? Xn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var $ = (t, e, n) => qn(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { Tools as Se, IUniverInstanceService as K, ICommandService as ne, Inject as y, LocaleService as ct, IConfigService as Cn, UniverInstanceType as k, isValidRange as In, RANGE_TYPE as on, Rectangle as Ie, Injector as ut, Disposable as Y, Range as yn, ObjectMatrix as Jn, IContextService as Qn, ThemeService as er, DataStreamTreeTokenType as an, CustomRangeType as Ge, BuildTextUtils as fe, ColorKit as tr, DOCS_ZEN_EDITOR_UNIT_ID_KEY as x, DisposableCollection as nr, FOCUSING_SHEET as St, generateRandomId as rr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ce, DataValidationType as Ct, CommandType as lt, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as ir, IPermissionService as sr, InterceptorEffectEnum as or, DependentOn as ar, Plugin as cr, merge as ur } from "@univerjs/core";
|
|
5
|
+
import { SetSelectionsOperation as En, SetWorksheetActiveOperation as Rn, rangeToDiscreteRange as lr, SheetsSelectionsService as wt, getSheetCommandTarget as kt, RangeProtectionPermissionEditPoint as Tt, WorksheetEditPermission as Ot, WorksheetSetCellValuePermission as Pn, WorksheetInsertHyperlinkPermission as xt, WorkbookEditablePermission as Nt, SheetPermissionCheckController as Ln, RangeProtectionPermissionViewPoint as dr, WorksheetViewPermission as pr, WorkbookViewPermission as hr, WorkbookCopyPermission as gr, WorksheetCopyPermission as vr, ClearSelectionContentCommand as mr, ClearSelectionAllCommand as fr, ClearSelectionFormatCommand as _r, SheetInterceptorService as Sr, INTERCEPTOR_POINT as Cr } from "@univerjs/sheets";
|
|
6
|
+
import { SheetHyperLinkType as C, ERROR_RANGE as Ir, HyperLinkModel as dt, RemoveHyperLinkMutation as xe, AddHyperLinkMutation as Ne, SheetsHyperLinkParserService as Mt, UpdateRichHyperLinkCommand as yr, UpdateHyperLinkCommand as Er, AddRichHyperLinkCommand as Rr, AddHyperLinkCommand as Pr, CancelRichHyperLinkCommand as Lr, CancelHyperLinkCommand as br, UniverSheetsHyperLinkPlugin as wr } from "@univerjs/sheets-hyper-link";
|
|
7
|
+
import { ScrollToRangeOperation as bn, ISheetClipboardService as kr, virtualizeDiscreteRanges as Rt, COPY_TYPE as Tr, PREDEFINED_HOOK_NAME as $e, getRepeatRange as Or, IEditorBridgeService as te, IMarkSelectionService as xr, SheetCanvasPopManagerService as Nr, getEditingCustomRangePosition as Mr, getCustomRangePosition as Ur, whenSheetEditorFocused as Hr, getCurrentRangeDisable$ as Dr, IAutoFillService as Vr, APPLY_TYPE as we, getAutoFillRepeatRange as Ar, HoverManagerService as $r, HoverRenderController as Br, SheetSkeletonManagerService as cn } from "@univerjs/sheets-ui";
|
|
8
|
+
import { MessageType as Te, FormLayout as ve, Input as un, Select as It, Button as ln, clsx as dn, Tooltip as Be } from "@univerjs/design";
|
|
9
|
+
import { IDefinedNamesService as wn, deserializeRangeWithSheet as je, serializeRangeWithSheet as Fr, serializeRangeToRefString as jr, serializeRange as Wr } from "@univerjs/engine-formula";
|
|
10
|
+
import { IMessageService as kn, useDependency as I, useObservable as Zr, IZenZoneService as pt, useEvent as Gr, KeyCode as Pt, MenuItemType as Tn, MetaKeys as Kr, getMenuHiddenObservable as ht, ContextMenuPosition as Yr, ContextMenuGroup as zr, RibbonStartGroup as Xr, ComponentManager as qr, IMenuManagerService as Jr, IShortcutService as Qr } from "@univerjs/ui";
|
|
11
|
+
import { DocSelectionRenderService as On, DocBackScrollRenderController as ei, DocCanvasPopManagerService as ti, calcDocRangePositions as ni, DocEventManagerService as pn, UniverDocsUIPlugin as ri } from "@univerjs/docs-ui";
|
|
12
|
+
import { IRenderManagerService as He } from "@univerjs/engine-render";
|
|
13
|
+
import { Subject as ii, BehaviorSubject as si, of as oe, map as Ut, switchMap as Me, combineLatest as oi, debounceTime as We, Observable as ai } from "rxjs";
|
|
14
|
+
import { DocSelectionManagerService as Ue } from "@univerjs/docs";
|
|
15
|
+
import { jsxs as _e, jsx as m, Fragment as ci } from "react/jsx-runtime";
|
|
16
|
+
import { RangeSelector as ui } from "@univerjs/sheets-formula-ui";
|
|
17
|
+
import { useState as Z, useMemo as yt, useRef as xn, useCallback as li, useEffect as ee, forwardRef as ue, createElement as le } from "react";
|
|
18
|
+
import { SheetDataValidationModel as hn } from "@univerjs/sheets-data-validation";
|
|
19
|
+
function Ke(t) {
|
|
20
|
+
return Se.isLegalUrl(t);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function di(t) {
|
|
23
23
|
return /^[a-zA-Z]+:\/\//.test(t);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function pi(t) {
|
|
26
26
|
return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(t);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
if (
|
|
30
|
-
const e =
|
|
28
|
+
function hi(t) {
|
|
29
|
+
if (Ke(t)) {
|
|
30
|
+
const e = di(t) ? t : pi(t) ? `mailto://${t}` : `http://${t}`;
|
|
31
31
|
let n;
|
|
32
32
|
try {
|
|
33
33
|
n = new URL(e);
|
|
@@ -38,24 +38,24 @@ function mi(t) {
|
|
|
38
38
|
}
|
|
39
39
|
return t;
|
|
40
40
|
}
|
|
41
|
-
const
|
|
42
|
-
var
|
|
43
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
44
|
-
(
|
|
41
|
+
const Nn = "sheets-hyper-link-ui.config", gn = {};
|
|
42
|
+
var gi = Object.getOwnPropertyDescriptor, vi = (t, e, n, i) => {
|
|
43
|
+
for (var r = i > 1 ? void 0 : i ? gi(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
44
|
+
(o = t[s]) && (r = o(r) || r);
|
|
45
45
|
return r;
|
|
46
|
-
},
|
|
47
|
-
function
|
|
46
|
+
}, me = (t, e) => (n, i) => e(n, i, t);
|
|
47
|
+
function mi(t, e) {
|
|
48
48
|
const n = e.getMergeData(), i = e.getMaxColumns() - 1, r = e.getMaxRows() - 1;
|
|
49
|
-
if (i < t.endColumn && (t.endColumn = i), r < t.endRow && (t.endRow = r), t.rangeType ===
|
|
49
|
+
if (i < t.endColumn && (t.endColumn = i), r < t.endRow && (t.endRow = r), t.rangeType === on.COLUMN || on.ROW)
|
|
50
50
|
return t;
|
|
51
|
-
const
|
|
52
|
-
return n.forEach((
|
|
53
|
-
|
|
54
|
-
}),
|
|
51
|
+
const s = [];
|
|
52
|
+
return n.forEach((o) => {
|
|
53
|
+
Ie.intersects(t, o) && s.push(o);
|
|
54
|
+
}), Ie.realUnion(t, ...s);
|
|
55
55
|
}
|
|
56
|
-
let
|
|
57
|
-
constructor(t, e, n, i, r,
|
|
58
|
-
this._univerInstanceService = t, this._commandService = e, this._definedNamesService = n, this._messageService = i, this._localeService = r, this._configService =
|
|
56
|
+
let ce = class {
|
|
57
|
+
constructor(t, e, n, i, r, s) {
|
|
58
|
+
this._univerInstanceService = t, this._commandService = e, this._definedNamesService = n, this._messageService = i, this._localeService = r, this._configService = s;
|
|
59
59
|
}
|
|
60
60
|
navigate(t) {
|
|
61
61
|
switch (t.type) {
|
|
@@ -67,62 +67,62 @@ let le = class {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
_navigateToUniver(t) {
|
|
70
|
-
const { gid: e, range: n, rangeid: i } = t, r = this._univerInstanceService.getCurrentUnitForType(
|
|
70
|
+
const { gid: e, range: n, rangeid: i } = t, r = this._univerInstanceService.getCurrentUnitForType(k.UNIVER_SHEET);
|
|
71
71
|
if (!r)
|
|
72
72
|
return;
|
|
73
|
-
const
|
|
73
|
+
const s = r.getUnitId();
|
|
74
74
|
if (i) {
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
75
|
+
const o = this._definedNamesService.getValueById(s, i);
|
|
76
|
+
if (!o)
|
|
77
77
|
return;
|
|
78
|
-
const { formulaOrRefString: c } =
|
|
78
|
+
const { formulaOrRefString: c } = o, u = this._definedNamesService.getWorksheetByRef(s, c);
|
|
79
79
|
if (!u) {
|
|
80
80
|
this._messageService.show({
|
|
81
81
|
content: this._localeService.t("hyperLink.message.refError"),
|
|
82
|
-
type:
|
|
82
|
+
type: Te.Error
|
|
83
83
|
});
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
86
|
if (u.isSheetHidden()) {
|
|
87
87
|
this._messageService.show({
|
|
88
88
|
content: this._localeService.t("hyperLink.message.hiddenSheet"),
|
|
89
|
-
type:
|
|
89
|
+
type: Te.Error
|
|
90
90
|
});
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
|
-
this.navigateToDefineName(
|
|
93
|
+
this.navigateToDefineName(s, i);
|
|
94
94
|
}
|
|
95
95
|
if (e) {
|
|
96
96
|
if (n) {
|
|
97
|
-
const
|
|
98
|
-
|
|
97
|
+
const o = je(n);
|
|
98
|
+
In(o.range) && n !== Ir && this.navigateToRange(s, e, o.range);
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
this.navigateToSheetById(
|
|
101
|
+
this.navigateToSheetById(s, e);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
async navigateToRange(t, e, n, i) {
|
|
105
105
|
const r = await this.navigateToSheetById(t, e);
|
|
106
106
|
if (r) {
|
|
107
|
-
const
|
|
107
|
+
const s = mi(n, r);
|
|
108
108
|
await this._commandService.executeCommand(
|
|
109
|
-
|
|
109
|
+
En.id,
|
|
110
110
|
{
|
|
111
111
|
unitId: t,
|
|
112
112
|
subUnitId: e,
|
|
113
113
|
selections: [{
|
|
114
|
-
range:
|
|
114
|
+
range: s,
|
|
115
115
|
primary: null
|
|
116
116
|
}]
|
|
117
117
|
}
|
|
118
|
-
), await this._commandService.executeCommand(
|
|
119
|
-
range:
|
|
118
|
+
), await this._commandService.executeCommand(bn.id, {
|
|
119
|
+
range: s,
|
|
120
120
|
forceTop: i
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
async navigateToSheetById(t, e) {
|
|
125
|
-
const n = this._univerInstanceService.getUnit(t,
|
|
125
|
+
const n = this._univerInstanceService.getUnit(t, k.UNIVER_SHEET);
|
|
126
126
|
if (!n)
|
|
127
127
|
return !1;
|
|
128
128
|
const i = n.getActiveSheet();
|
|
@@ -133,10 +133,10 @@ let le = class {
|
|
|
133
133
|
const r = n.getSheetBySheetId(e);
|
|
134
134
|
return r ? n.getHiddenWorksheets().indexOf(e) > -1 ? (this._messageService.show({
|
|
135
135
|
content: this._localeService.t("hyperLink.message.hiddenSheet"),
|
|
136
|
-
type:
|
|
137
|
-
}), !1) : await this._commandService.executeCommand(
|
|
136
|
+
type: Te.Error
|
|
137
|
+
}), !1) : await this._commandService.executeCommand(Rn.id, { unitId: t, subUnitId: e }) ? r : !1 : (this._messageService.show({
|
|
138
138
|
content: this._localeService.t("hyperLink.message.noSheet"),
|
|
139
|
-
type:
|
|
139
|
+
type: Te.Error
|
|
140
140
|
}), !1);
|
|
141
141
|
}
|
|
142
142
|
async navigateToDefineName(t, e) {
|
|
@@ -144,27 +144,27 @@ let le = class {
|
|
|
144
144
|
}
|
|
145
145
|
async navigateToOtherWebsite(t) {
|
|
146
146
|
var n;
|
|
147
|
-
const e = this._configService.getConfig(
|
|
147
|
+
const e = this._configService.getConfig(Nn);
|
|
148
148
|
if ((n = e == null ? void 0 : e.urlHandler) != null && n.navigateToOtherWebsite)
|
|
149
149
|
return e.urlHandler.navigateToOtherWebsite(t);
|
|
150
150
|
window.open(t, "_blank", "noopener noreferrer");
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
],
|
|
161
|
-
const
|
|
162
|
-
var
|
|
163
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
164
|
-
(
|
|
153
|
+
ce = vi([
|
|
154
|
+
me(0, K),
|
|
155
|
+
me(1, ne),
|
|
156
|
+
me(2, wn),
|
|
157
|
+
me(3, kn),
|
|
158
|
+
me(4, y(ct)),
|
|
159
|
+
me(5, Cn)
|
|
160
|
+
], ce);
|
|
161
|
+
const Ht = "SHEET_HYPER_LINK_UI_PLUGIN";
|
|
162
|
+
var fi = Object.getOwnPropertyDescriptor, _i = (t, e, n, i) => {
|
|
163
|
+
for (var r = i > 1 ? void 0 : i ? fi(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
164
|
+
(o = t[s]) && (r = o(r) || r);
|
|
165
165
|
return r;
|
|
166
|
-
},
|
|
167
|
-
let
|
|
166
|
+
}, Fe = (t, e) => (n, i) => e(n, i, t);
|
|
167
|
+
let Ye = class extends Y {
|
|
168
168
|
constructor(e, n, i, r) {
|
|
169
169
|
super();
|
|
170
170
|
$(this, "_plainTextFilter", /* @__PURE__ */ new Set());
|
|
@@ -185,30 +185,30 @@ let ze = class extends z {
|
|
|
185
185
|
}
|
|
186
186
|
_initCopyPaste() {
|
|
187
187
|
this._sheetClipboardService.addClipboardHook({
|
|
188
|
-
id:
|
|
188
|
+
id: Ht,
|
|
189
189
|
onBeforeCopy: (e, n, i) => this._collect(e, n, i),
|
|
190
190
|
onPasteCells: (e, n, i, r) => {
|
|
191
|
-
const { copyType:
|
|
192
|
-
return this._generateMutations(u, { copyType:
|
|
191
|
+
const { copyType: s = Tr.COPY, pasteType: o } = r, { range: c } = e || {}, { range: u, unitId: p, subUnitId: l } = n;
|
|
192
|
+
return this._generateMutations(u, { copyType: s, pasteType: o, copyRange: c, unitId: p, subUnitId: l });
|
|
193
193
|
},
|
|
194
194
|
onPastePlainText: (e, n) => {
|
|
195
195
|
const i = this._filterPlainText(n);
|
|
196
|
-
if (
|
|
197
|
-
const { range: r, unitId:
|
|
198
|
-
return
|
|
199
|
-
const { row: _, col: S } = u(g, d), f = this._hyperLinkModel.getHyperLinkByLocation(
|
|
196
|
+
if (Ke(n) && i) {
|
|
197
|
+
const { range: r, unitId: s, subUnitId: o } = e, { ranges: [c], mapFunc: u } = Rt([r]), p = [], l = [];
|
|
198
|
+
return yn.foreach(c, (g, d) => {
|
|
199
|
+
const { row: _, col: S } = u(g, d), f = this._hyperLinkModel.getHyperLinkByLocation(s, o, _, S);
|
|
200
200
|
f && p.push({
|
|
201
|
-
id:
|
|
201
|
+
id: xe.id,
|
|
202
202
|
params: {
|
|
203
|
-
unitId:
|
|
204
|
-
subUnitId:
|
|
203
|
+
unitId: s,
|
|
204
|
+
subUnitId: o,
|
|
205
205
|
id: f.id
|
|
206
206
|
}
|
|
207
207
|
}), f && l.push({
|
|
208
|
-
id:
|
|
208
|
+
id: Ne.id,
|
|
209
209
|
params: {
|
|
210
|
-
unitId:
|
|
211
|
-
subUnitId:
|
|
210
|
+
unitId: s,
|
|
211
|
+
subUnitId: o,
|
|
212
212
|
link: f
|
|
213
213
|
}
|
|
214
214
|
});
|
|
@@ -220,17 +220,17 @@ let ze = class extends z {
|
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
222
|
_collect(e, n, i) {
|
|
223
|
-
const r = new
|
|
223
|
+
const r = new Jn();
|
|
224
224
|
this._copyInfo = {
|
|
225
225
|
unitId: e,
|
|
226
226
|
subUnitId: n,
|
|
227
227
|
matrix: r
|
|
228
228
|
};
|
|
229
|
-
const
|
|
230
|
-
if (!
|
|
229
|
+
const s = this._injector.invoke((u) => lr(i, u, e, n));
|
|
230
|
+
if (!s)
|
|
231
231
|
return;
|
|
232
|
-
const { rows:
|
|
233
|
-
|
|
232
|
+
const { rows: o, cols: c } = s;
|
|
233
|
+
o.forEach((u, p) => {
|
|
234
234
|
c.forEach((l, g) => {
|
|
235
235
|
var _;
|
|
236
236
|
const d = this._hyperLinkModel.getHyperLinkByLocation(e, n, u, l);
|
|
@@ -245,17 +245,17 @@ let ze = class extends z {
|
|
|
245
245
|
if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !n.copyRange)
|
|
246
246
|
return { redos: [], undos: [] };
|
|
247
247
|
if ([
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
248
|
+
$e.SPECIAL_PASTE_COL_WIDTH,
|
|
249
|
+
$e.SPECIAL_PASTE_VALUE,
|
|
250
|
+
$e.SPECIAL_PASTE_FORMAT,
|
|
251
|
+
$e.SPECIAL_PASTE_FORMULA
|
|
252
252
|
].includes(n.pasteType))
|
|
253
253
|
return { redos: [], undos: [] };
|
|
254
|
-
const { unitId: r, subUnitId:
|
|
255
|
-
return
|
|
254
|
+
const { unitId: r, subUnitId: s } = this._copyInfo, o = [], c = [], { ranges: [u, p], mapFunc: l } = Rt([n.copyRange, e]);
|
|
255
|
+
return Or(u, p, !0).forEach(({ startRange: d }) => {
|
|
256
256
|
var _;
|
|
257
|
-
(_ = this._copyInfo) == null || _.matrix.forValue((S, f,
|
|
258
|
-
const a =
|
|
257
|
+
(_ = this._copyInfo) == null || _.matrix.forValue((S, f, b) => {
|
|
258
|
+
const a = Ie.getPositionRange(
|
|
259
259
|
{
|
|
260
260
|
startRow: S,
|
|
261
261
|
endRow: S,
|
|
@@ -263,53 +263,53 @@ let ze = class extends z {
|
|
|
263
263
|
endColumn: f
|
|
264
264
|
},
|
|
265
265
|
d
|
|
266
|
-
),
|
|
267
|
-
|
|
268
|
-
id:
|
|
266
|
+
), w = this._hyperLinkModel.getHyperLink(r, s, b), { row: M, col: T } = l(a.startRow, a.startColumn), P = this._hyperLinkModel.getHyperLinkByLocation(n.unitId, n.subUnitId, M, T), A = Se.generateRandomId();
|
|
267
|
+
P && o.push({
|
|
268
|
+
id: xe.id,
|
|
269
269
|
params: {
|
|
270
270
|
unitId: n.unitId,
|
|
271
271
|
subUnitId: n.subUnitId,
|
|
272
|
-
id:
|
|
272
|
+
id: P.id
|
|
273
273
|
}
|
|
274
|
-
}),
|
|
275
|
-
id:
|
|
274
|
+
}), w && (o.push({
|
|
275
|
+
id: Ne.id,
|
|
276
276
|
params: {
|
|
277
277
|
unitId: n.unitId,
|
|
278
278
|
subUnitId: n.subUnitId,
|
|
279
279
|
link: {
|
|
280
|
-
...
|
|
280
|
+
...w,
|
|
281
281
|
id: A,
|
|
282
|
-
row:
|
|
282
|
+
row: M,
|
|
283
283
|
column: T
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
286
|
}), c.push({
|
|
287
|
-
id:
|
|
287
|
+
id: xe.id,
|
|
288
288
|
params: {
|
|
289
289
|
unitId: n.unitId,
|
|
290
290
|
subUnitId: n.subUnitId,
|
|
291
291
|
id: A
|
|
292
292
|
}
|
|
293
|
-
})),
|
|
294
|
-
id:
|
|
293
|
+
})), P && c.push({
|
|
294
|
+
id: Ne.id,
|
|
295
295
|
params: {
|
|
296
296
|
unitId: n.unitId,
|
|
297
297
|
subUnitId: n.subUnitId,
|
|
298
|
-
link:
|
|
298
|
+
link: P
|
|
299
299
|
}
|
|
300
300
|
});
|
|
301
301
|
});
|
|
302
|
-
}), { redos:
|
|
302
|
+
}), { redos: o, undos: c };
|
|
303
303
|
}
|
|
304
304
|
};
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
],
|
|
311
|
-
var
|
|
312
|
-
class
|
|
305
|
+
Ye = _i([
|
|
306
|
+
Fe(0, kr),
|
|
307
|
+
Fe(1, y(dt)),
|
|
308
|
+
Fe(2, y(ut)),
|
|
309
|
+
Fe(3, y(ce))
|
|
310
|
+
], Ye);
|
|
311
|
+
var v = /* @__PURE__ */ ((t) => (t.EDITING = "editing", t.VIEWING = "viewing", t.ZEN_EDITOR = "zen_mode", t))(v || {});
|
|
312
|
+
class Mn extends Y {
|
|
313
313
|
constructor() {
|
|
314
314
|
super(...arguments);
|
|
315
315
|
$(this, "_customHyperLinks", /* @__PURE__ */ new Map());
|
|
@@ -337,80 +337,77 @@ class xn extends z {
|
|
|
337
337
|
super.dispose(), this._customHyperLinks.clear();
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
const
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
}, [o]);
|
|
351
|
-
te(() => {
|
|
352
|
-
var h, E, R, P, M, F, Gt, Kt, Yt, zt, Xt, qt, Jt, Qt, en, tn, nn;
|
|
340
|
+
const ze = () => {
|
|
341
|
+
var Wt;
|
|
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 = I(ct), _ = I(wn), S = I(te), f = I(K), b = I(G), a = Zr(b.currentEditing$), w = I(Mt), M = I(ce), T = I(ne), P = I(Mn), A = yt(() => P.getOptions(), [P]), D = I(pt), z = I(He), ye = I(xr), De = I(Ue), re = I(Qn), Ee = I(er), Re = I(Ue), [Pe, Ve] = Z(!1), pe = I(wt), Wn = yt(() => pe.getCurrentSelections(), []), Ae = yt(() => {
|
|
343
|
+
if (!P.isBuiltInLinkType(u))
|
|
344
|
+
return P.getCustomHyperLink(u);
|
|
345
|
+
}, [P, u]), [he, Zn] = Z(!1), [Le, Ft] = Z(!1), H = xn(!1), B = f.getCurrentUnitForType(k.UNIVER_SHEET), Gn = (B == null ? void 0 : B.getActiveSheet().getSheetId()) || "", q = li((h) => {
|
|
346
|
+
s(h.replaceAll(an.CUSTOM_RANGE_START, "").replaceAll(an.CUSTOM_RANGE_END, ""));
|
|
347
|
+
}, [s]);
|
|
348
|
+
ee(() => {
|
|
349
|
+
var h, E, R, L, N, F, Zt, Gt, Kt, Yt, zt, Xt, qt, Jt, Qt, en, tn;
|
|
353
350
|
if ((a == null ? void 0 : a.row) !== void 0 && a.col !== void 0) {
|
|
354
|
-
const { customRange:
|
|
355
|
-
let { label:
|
|
356
|
-
typeof
|
|
357
|
-
let
|
|
358
|
-
if (
|
|
359
|
-
|
|
360
|
-
id: (h =
|
|
361
|
-
display:
|
|
362
|
-
payload: (R = (E =
|
|
363
|
-
row:
|
|
364
|
-
column:
|
|
351
|
+
const { customRange: ie, row: ft, col: _t } = a;
|
|
352
|
+
let { label: X } = a;
|
|
353
|
+
typeof X == "number" && (X = `${X}`);
|
|
354
|
+
let j;
|
|
355
|
+
if (ie)
|
|
356
|
+
j = {
|
|
357
|
+
id: (h = ie == null ? void 0 : ie.rangeId) != null ? h : "",
|
|
358
|
+
display: X != null ? X : "",
|
|
359
|
+
payload: (R = (E = ie == null ? void 0 : ie.properties) == null ? void 0 : E.url) != null ? R : "",
|
|
360
|
+
row: ft,
|
|
361
|
+
column: _t
|
|
365
362
|
};
|
|
366
|
-
else if (a.type ===
|
|
367
|
-
const O = f.getUnit(a.unitId),
|
|
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), ge = (F = (N = (L = U == null ? void 0 : U.p) == null ? void 0 : L.body) == null ? void 0 : N.customRanges) == null ? void 0 : F.find((rn) => {
|
|
368
365
|
var sn;
|
|
369
|
-
return
|
|
370
|
-
}), be =
|
|
371
|
-
|
|
366
|
+
return rn.rangeType === Ge.HYPERLINK && ((sn = rn.properties) == null ? void 0 : sn.url);
|
|
367
|
+
}), be = U == null ? void 0 : U.v;
|
|
368
|
+
U && (!fe.transform.isEmptyDocument((Gt = (Zt = U.p) == null ? void 0 : Zt.body) == null ? void 0 : Gt.dataStream) || Se.isDefine(be)) && c(!1), j = {
|
|
372
369
|
id: "",
|
|
373
370
|
display: "",
|
|
374
|
-
payload: (
|
|
375
|
-
row:
|
|
376
|
-
column:
|
|
371
|
+
payload: (Yt = (Kt = ge == null ? void 0 : ge.properties) == null ? void 0 : Kt.url) != null ? Yt : "",
|
|
372
|
+
row: ft,
|
|
373
|
+
column: _t
|
|
377
374
|
};
|
|
378
375
|
} else {
|
|
379
|
-
const O = f.getCurrentUnitForType(
|
|
380
|
-
c(!1),
|
|
376
|
+
const O = f.getCurrentUnitForType(k.UNIVER_DOC), Q = De.getActiveTextRange(), U = O == null ? void 0 : O.getBody(), ge = Q && U ? Q : null, be = ge && ((Xt = fe.customRange.getCustomRangesInterestsWithSelection(ge, (zt = U == null ? void 0 : U.customRanges) != null ? zt : [])) == null ? void 0 : Xt[0]);
|
|
377
|
+
c(!1), j = {
|
|
381
378
|
id: "",
|
|
382
|
-
display:
|
|
383
|
-
payload: (
|
|
384
|
-
row:
|
|
385
|
-
column:
|
|
379
|
+
display: X != null ? X : "",
|
|
380
|
+
payload: (Jt = (qt = be == null ? void 0 : be.properties) == null ? void 0 : qt.url) != null ? Jt : "",
|
|
381
|
+
row: ft,
|
|
382
|
+
column: _t
|
|
386
383
|
};
|
|
387
384
|
}
|
|
388
|
-
e(
|
|
389
|
-
const
|
|
390
|
-
if (
|
|
391
|
-
const O =
|
|
392
|
-
p(O.type), g(O.payload),
|
|
385
|
+
e(j.id);
|
|
386
|
+
const nn = P.findCustomHyperLink(j);
|
|
387
|
+
if (nn) {
|
|
388
|
+
const O = nn.convert(j);
|
|
389
|
+
p(O.type), g(O.payload), q(O.display);
|
|
393
390
|
return;
|
|
394
391
|
}
|
|
395
|
-
|
|
396
|
-
const
|
|
397
|
-
switch (p(
|
|
392
|
+
q(j.display);
|
|
393
|
+
const J = w.parseHyperLink(j.payload);
|
|
394
|
+
switch (p(J.type === C.INVALID ? C.RANGE : J.type), J.type) {
|
|
398
395
|
case C.URL: {
|
|
399
|
-
g(
|
|
396
|
+
g(J.url), J.url === j.display && (H.current = !0);
|
|
400
397
|
break;
|
|
401
398
|
}
|
|
402
399
|
case C.RANGE: {
|
|
403
|
-
const O =
|
|
404
|
-
g(
|
|
400
|
+
const O = J.searchObj, Q = O.gid && (tn = (en = (Qt = f.getUnit(a.unitId)) == null ? void 0 : Qt.getSheetBySheetId(O.gid)) == null ? void 0 : en.getName()) != null ? tn : "", U = Fr(Q, je(O.range).range);
|
|
401
|
+
g(U), U === j.display && (H.current = !0);
|
|
405
402
|
break;
|
|
406
403
|
}
|
|
407
404
|
case C.SHEET: {
|
|
408
|
-
const O =
|
|
405
|
+
const O = J.searchObj;
|
|
409
406
|
g(O.gid);
|
|
410
407
|
break;
|
|
411
408
|
}
|
|
412
409
|
case C.DEFINE_NAME: {
|
|
413
|
-
const O =
|
|
410
|
+
const O = J.searchObj;
|
|
414
411
|
g(O.rangeid);
|
|
415
412
|
break;
|
|
416
413
|
}
|
|
@@ -419,13 +416,13 @@ const Ii = "univer-cell-link-edit", yi = "univer-cell-link-edit-buttons", vn = {
|
|
|
419
416
|
break;
|
|
420
417
|
}
|
|
421
418
|
}
|
|
422
|
-
}, [a,
|
|
419
|
+
}, [a, M, P, De, f]), ee(() => {
|
|
423
420
|
let h = null;
|
|
424
|
-
if (a && !a.customRangeId && a.type ===
|
|
425
|
-
const E = f.getUnit(a.unitId,
|
|
426
|
-
h =
|
|
421
|
+
if (a && !a.customRangeId && a.type === v.VIEWING && Se.isDefine(a.row) && Se.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 tr(Ee.getColorFromTheme("primary.600")).toRgb();
|
|
423
|
+
h = ye.addShape(
|
|
427
424
|
{
|
|
428
|
-
range:
|
|
425
|
+
range: L != null ? L : {
|
|
429
426
|
startColumn: a.col,
|
|
430
427
|
endColumn: a.col,
|
|
431
428
|
startRow: a.row,
|
|
@@ -433,7 +430,7 @@ const Ii = "univer-cell-link-edit", yi = "univer-cell-link-edit-buttons", vn = {
|
|
|
433
430
|
},
|
|
434
431
|
style: {
|
|
435
432
|
// hasAutoFill: false,
|
|
436
|
-
fill: `rgb(${
|
|
433
|
+
fill: `rgb(${N.r}, ${N.g}, ${N.b}, 0.12)`,
|
|
437
434
|
strokeWidth: 1,
|
|
438
435
|
stroke: "#FFBD37",
|
|
439
436
|
widgets: {}
|
|
@@ -445,14 +442,14 @@ const Ii = "univer-cell-link-edit", yi = "univer-cell-link-edit-buttons", vn = {
|
|
|
445
442
|
);
|
|
446
443
|
}
|
|
447
444
|
return () => {
|
|
448
|
-
h &&
|
|
445
|
+
h && ye.removeShape(h);
|
|
449
446
|
};
|
|
450
|
-
}, [a,
|
|
451
|
-
|
|
452
|
-
}, [u]),
|
|
453
|
-
const h = (a == null ? void 0 : a.type) ===
|
|
447
|
+
}, [a, ye, Ee, f]), ee(() => {
|
|
448
|
+
Ft(u === C.RANGE);
|
|
449
|
+
}, [u]), ee(() => {
|
|
450
|
+
const h = (a == null ? void 0 : a.type) === v.ZEN_EDITOR ? z.getRenderById(x) : z.getRenderById(S.getCurrentEditorId()), E = new nr();
|
|
454
451
|
if (h) {
|
|
455
|
-
const R = h.with(
|
|
452
|
+
const R = h.with(On);
|
|
456
453
|
R.setReserveRangesStatus(!0), E.add(() => {
|
|
457
454
|
R.setReserveRangesStatus(!1);
|
|
458
455
|
});
|
|
@@ -460,17 +457,17 @@ const Ii = "univer-cell-link-edit", yi = "univer-cell-link-edit-buttons", vn = {
|
|
|
460
457
|
return () => {
|
|
461
458
|
S.disableForceKeepVisible(), E.dispose();
|
|
462
459
|
};
|
|
463
|
-
}, [a == null ? void 0 : a.type, S,
|
|
464
|
-
|
|
465
|
-
}), [
|
|
466
|
-
D.temporaryHidden && (D.show(),
|
|
467
|
-
}, [
|
|
468
|
-
if (
|
|
460
|
+
}, [a == null ? void 0 : a.type, S, z]), ee(() => (Le && b.setIsKeepVisible(Le), b.setIsKeepVisible(Pe), () => {
|
|
461
|
+
b.setIsKeepVisible(!1);
|
|
462
|
+
}), [Le, Pe, b]), ee(() => () => {
|
|
463
|
+
D.temporaryHidden && (D.show(), re.setContextValue(St, !1));
|
|
464
|
+
}, [re, D]), ee(() => {
|
|
465
|
+
if (Le)
|
|
469
466
|
return S.enableForceKeepVisible(), () => {
|
|
470
467
|
S.disableForceKeepVisible();
|
|
471
468
|
};
|
|
472
|
-
}, [
|
|
473
|
-
const
|
|
469
|
+
}, [Le, S]);
|
|
470
|
+
const Kn = [
|
|
474
471
|
{
|
|
475
472
|
label: d.t("hyperLink.form.link"),
|
|
476
473
|
value: C.URL
|
|
@@ -491,68 +488,68 @@ const Ii = "univer-cell-link-edit", yi = "univer-cell-link-edit-buttons", vn = {
|
|
|
491
488
|
];
|
|
492
489
|
if (!B)
|
|
493
490
|
return;
|
|
494
|
-
const
|
|
491
|
+
const Yn = B.getHiddenWorksheets(), gt = B.getSheets().map((h) => ({ label: h.getName(), value: h.getSheetId() })).filter((h) => Yn.indexOf(h.value) === -1), vt = Object.values((Wt = _.getDefinedNameMap(B.getUnitId())) != null ? Wt : {}).map((h) => ({
|
|
495
492
|
label: h.name,
|
|
496
493
|
value: h.id
|
|
497
494
|
})), jt = (h, E) => {
|
|
498
495
|
if (h === C.URL)
|
|
499
|
-
return
|
|
496
|
+
return hi(E);
|
|
500
497
|
if (h === C.RANGE) {
|
|
501
|
-
const R = je(E),
|
|
502
|
-
if (
|
|
503
|
-
return `#gid=${
|
|
498
|
+
const R = je(E), L = B.getSheetBySheetName(R.sheetName);
|
|
499
|
+
if (L)
|
|
500
|
+
return `#gid=${L.getSheetId()}&range=${Wr(R.range)}`;
|
|
504
501
|
}
|
|
505
502
|
return `#${h}=${E}`;
|
|
506
|
-
},
|
|
507
|
-
var
|
|
503
|
+
}, zn = Gr((h) => {
|
|
504
|
+
var N;
|
|
508
505
|
const R = h.split(",").map(je)[0];
|
|
509
|
-
if (!R || !
|
|
506
|
+
if (!R || !In(R.range))
|
|
510
507
|
return;
|
|
511
|
-
R.sheetName || (R.sheetName = ((
|
|
512
|
-
const
|
|
513
|
-
g(
|
|
514
|
-
}),
|
|
515
|
-
if (
|
|
516
|
-
|
|
508
|
+
R.sheetName || (R.sheetName = ((N = B.getActiveSheet()) == null ? void 0 : N.getName()) || "");
|
|
509
|
+
const L = jr(R);
|
|
510
|
+
g(L), L && (H.current || !r) && (q(L), H.current = !0);
|
|
511
|
+
}), mt = async () => {
|
|
512
|
+
if (o && !r || !l || u === C.URL && !Ke(l)) {
|
|
513
|
+
Zn(!0);
|
|
517
514
|
return;
|
|
518
515
|
}
|
|
519
516
|
if (a)
|
|
520
517
|
if (t) {
|
|
521
|
-
const h = a.type ===
|
|
518
|
+
const h = a.type === v.ZEN_EDITOR || a.type === v.EDITING ? yr.id : Er.id;
|
|
522
519
|
await T.executeCommand(h, {
|
|
523
520
|
id: t,
|
|
524
521
|
unitId: a.unitId,
|
|
525
522
|
subUnitId: a.subUnitId,
|
|
526
523
|
payload: {
|
|
527
|
-
display:
|
|
524
|
+
display: o ? r : "",
|
|
528
525
|
payload: jt(u, l)
|
|
529
526
|
},
|
|
530
527
|
row: a.row,
|
|
531
528
|
column: a.col,
|
|
532
|
-
documentId: a.type ===
|
|
529
|
+
documentId: a.type === v.ZEN_EDITOR ? x : S.getCurrentEditorId()
|
|
533
530
|
});
|
|
534
531
|
} else {
|
|
535
|
-
const h = a.type ===
|
|
532
|
+
const h = a.type === v.ZEN_EDITOR || a.type === v.EDITING ? Rr.id : Pr.id;
|
|
536
533
|
await T.executeCommand(h, {
|
|
537
534
|
unitId: a.unitId,
|
|
538
535
|
subUnitId: a.subUnitId,
|
|
539
536
|
link: {
|
|
540
|
-
id:
|
|
537
|
+
id: rr(),
|
|
541
538
|
row: a.row,
|
|
542
539
|
column: a.col,
|
|
543
540
|
payload: jt(u, l),
|
|
544
|
-
display:
|
|
541
|
+
display: o ? r : ""
|
|
545
542
|
},
|
|
546
|
-
documentId: a.type ===
|
|
543
|
+
documentId: a.type === v.ZEN_EDITOR ? x : S.getCurrentEditorId()
|
|
547
544
|
});
|
|
548
545
|
}
|
|
549
|
-
if ((a == null ? void 0 : a.type) ===
|
|
550
|
-
await T.executeCommand(
|
|
546
|
+
if ((a == null ? void 0 : a.type) === v.VIEWING) {
|
|
547
|
+
await T.executeCommand(Rn.id, {
|
|
551
548
|
unitId: a.unitId,
|
|
552
549
|
subUnitId: a.subUnitId
|
|
553
550
|
});
|
|
554
551
|
const h = 1;
|
|
555
|
-
await T.executeCommand(
|
|
552
|
+
await T.executeCommand(bn.id, {
|
|
556
553
|
range: {
|
|
557
554
|
startRow: Math.max(a.row - h, 0),
|
|
558
555
|
endRow: a.row + h,
|
|
@@ -561,155 +558,167 @@ const Ii = "univer-cell-link-edit", yi = "univer-cell-link-edit-buttons", vn = {
|
|
|
561
558
|
}
|
|
562
559
|
});
|
|
563
560
|
}
|
|
564
|
-
T.executeCommand(
|
|
561
|
+
T.executeCommand(qe.id);
|
|
565
562
|
};
|
|
566
|
-
return a ? /* @__PURE__ */
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
563
|
+
return a ? /* @__PURE__ */ _e(
|
|
564
|
+
"div",
|
|
565
|
+
{
|
|
566
|
+
className: `
|
|
567
|
+
univer-box-border univer-w-[296px] univer-rounded-xl univer-border univer-border-solid
|
|
568
|
+
univer-border-gray-200 univer-bg-white univer-p-4 univer-shadow-md
|
|
569
|
+
`,
|
|
570
|
+
children: [
|
|
571
|
+
o ? /* @__PURE__ */ m(
|
|
572
|
+
ve,
|
|
573
|
+
{
|
|
574
|
+
label: d.t("hyperLink.form.label"),
|
|
575
|
+
error: he && !r ? d.t("hyperLink.form.inputError") : "",
|
|
576
|
+
children: /* @__PURE__ */ m(
|
|
577
|
+
un,
|
|
578
|
+
{
|
|
579
|
+
value: r,
|
|
580
|
+
onChange: (h) => {
|
|
581
|
+
q(h), H.current = !1;
|
|
582
|
+
},
|
|
583
|
+
placeholder: d.t("hyperLink.form.labelPlaceholder"),
|
|
584
|
+
autoFocus: !0,
|
|
585
|
+
onKeyDown: (h) => {
|
|
586
|
+
h.keyCode === Pt.ENTER && mt();
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
)
|
|
590
|
+
}
|
|
591
|
+
) : null,
|
|
592
|
+
/* @__PURE__ */ m(ve, { label: d.t("hyperLink.form.type"), children: /* @__PURE__ */ m(
|
|
593
|
+
It,
|
|
574
594
|
{
|
|
575
|
-
|
|
595
|
+
className: "univer-w-full",
|
|
596
|
+
options: Kn,
|
|
597
|
+
value: u,
|
|
576
598
|
onChange: (h) => {
|
|
577
|
-
|
|
578
|
-
},
|
|
579
|
-
placeholder: d.t("hyperLink.form.labelPlaceholder"),
|
|
580
|
-
autoFocus: !0,
|
|
581
|
-
onKeyDown: (h) => {
|
|
582
|
-
h.keyCode === Pt.ENTER && ft();
|
|
599
|
+
p(h), g("");
|
|
583
600
|
}
|
|
584
601
|
}
|
|
585
|
-
)
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
602
|
+
) }),
|
|
603
|
+
u === C.URL && /* @__PURE__ */ m(
|
|
604
|
+
ve,
|
|
605
|
+
{
|
|
606
|
+
error: he ? l ? Ke(l) ? "" : d.t("hyperLink.form.linkError") : d.t("hyperLink.form.inputError") : "",
|
|
607
|
+
children: /* @__PURE__ */ m(
|
|
608
|
+
un,
|
|
609
|
+
{
|
|
610
|
+
value: l,
|
|
611
|
+
onChange: (h) => {
|
|
612
|
+
g(h), h && (H.current || !r || r === h) && (q(h), H.current = !0);
|
|
613
|
+
},
|
|
614
|
+
placeholder: d.t("hyperLink.form.linkPlaceholder"),
|
|
615
|
+
autoFocus: !0,
|
|
616
|
+
onKeyDown: (h) => {
|
|
617
|
+
h.keyCode === Pt.ENTER && mt();
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
)
|
|
621
|
+
}
|
|
622
|
+
),
|
|
623
|
+
u === C.RANGE && /* @__PURE__ */ m(ve, { error: he && !l ? d.t("hyperLink.form.inputError") : "", children: /* @__PURE__ */ m(
|
|
624
|
+
ui,
|
|
625
|
+
{
|
|
626
|
+
unitId: B.getUnitId(),
|
|
627
|
+
subUnitId: Gn,
|
|
628
|
+
maxRangeCount: 1,
|
|
629
|
+
supportAcrossSheet: !0,
|
|
630
|
+
initialValue: l,
|
|
631
|
+
resetRange: Wn,
|
|
632
|
+
onChange: (h, E) => zn(E),
|
|
633
|
+
onRangeSelectorDialogVisibleChange: async (h) => {
|
|
634
|
+
var E, R;
|
|
635
|
+
if (Ve(h), h)
|
|
636
|
+
a.type === v.ZEN_EDITOR && (D.hide(), re.setContextValue(St, !0)), a.type !== v.VIEWING && S.enableForceKeepVisible(), i(!0);
|
|
637
|
+
else {
|
|
638
|
+
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) {
|
|
639
|
+
await T.executeCommand(En.id, {
|
|
640
|
+
unitId: a.unitId,
|
|
641
|
+
subUnitId: a.subUnitId,
|
|
642
|
+
selections: [{ range: { startRow: a.row, endRow: a.row, startColumn: a.col, endColumn: a.col } }]
|
|
643
|
+
}), D.show(), re.setContextValue(St, !1);
|
|
644
|
+
const L = (E = z.getRenderById(x)) == null ? void 0 : E.with(ei), N = (R = Re.getTextRanges({ unitId: x, subUnitId: x })) == null ? void 0 : R[0];
|
|
645
|
+
L && N && (L.scrollToRange(N), Re.refreshSelection({ unitId: x, subUnitId: x }));
|
|
646
|
+
}
|
|
647
|
+
S.disableForceKeepVisible(), i(!1);
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
onFocusChange: (h) => Ft(h)
|
|
651
|
+
}
|
|
652
|
+
) }),
|
|
653
|
+
u === C.SHEET && /* @__PURE__ */ m(ve, { error: he && !l ? d.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ m(
|
|
654
|
+
It,
|
|
604
655
|
{
|
|
656
|
+
className: "univer-w-full",
|
|
657
|
+
options: gt,
|
|
605
658
|
value: l,
|
|
606
659
|
onChange: (h) => {
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
onKeyDown: (h) => {
|
|
612
|
-
h.keyCode === Pt.ENTER && ft();
|
|
660
|
+
var L, N;
|
|
661
|
+
g(h);
|
|
662
|
+
const E = (L = gt.find((F) => F.value === h)) == null ? void 0 : L.label, R = (N = gt.find((F) => F.value === l)) == null ? void 0 : N.label;
|
|
663
|
+
E && (H.current || !r || r === R) && (q(E), H.current = !0);
|
|
613
664
|
}
|
|
614
665
|
}
|
|
615
|
-
)
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
onChange: (h, E) => qn(E),
|
|
628
|
-
onRangeSelectorDialogVisibleChange: async (h) => {
|
|
629
|
-
var E, R;
|
|
630
|
-
if (Ae(h), h)
|
|
631
|
-
a.type === m.ZEN_EDITOR && (D.hide(), ie.setContextValue(Ct, !0)), a.type !== m.VIEWING && S.enableForceKeepVisible(), i(!0);
|
|
632
|
-
else {
|
|
633
|
-
if (await U.navigateToRange(a.unitId, a.subUnitId, { startRow: a.row, endRow: a.row, startColumn: a.col, endColumn: a.col }, !0), a.type === m.ZEN_EDITOR) {
|
|
634
|
-
await T.executeCommand(Ln.id, {
|
|
635
|
-
unitId: a.unitId,
|
|
636
|
-
subUnitId: a.subUnitId,
|
|
637
|
-
selections: [{ range: { startRow: a.row, endRow: a.row, startColumn: a.col, endColumn: a.col } }]
|
|
638
|
-
}), D.show(), ie.setContextValue(Ct, !1);
|
|
639
|
-
const P = (E = X.getRenderById(N)) == null ? void 0 : E.with(ni), M = (R = Le.getTextRanges({ unitId: N, subUnitId: N })) == null ? void 0 : R[0];
|
|
640
|
-
P && M && (P.scrollToRange(M), Le.refreshSelection({ unitId: N, subUnitId: N }));
|
|
666
|
+
) }),
|
|
667
|
+
u === C.DEFINE_NAME && /* @__PURE__ */ m(ve, { error: he && !l ? d.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ m(
|
|
668
|
+
It,
|
|
669
|
+
{
|
|
670
|
+
className: "univer-w-full",
|
|
671
|
+
options: vt,
|
|
672
|
+
value: l,
|
|
673
|
+
onChange: (h) => {
|
|
674
|
+
var L, N;
|
|
675
|
+
g(h);
|
|
676
|
+
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;
|
|
677
|
+
E && (H.current || !r || r === R) && (q(E), H.current = !0);
|
|
641
678
|
}
|
|
642
|
-
S.disableForceKeepVisible(), i(!1);
|
|
643
679
|
}
|
|
644
|
-
},
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
},
|
|
685
|
-
setPayload: g
|
|
686
|
-
}
|
|
687
|
-
),
|
|
688
|
-
/* @__PURE__ */ Se("div", { className: vn.cellLinkEditButtons, children: [
|
|
689
|
-
/* @__PURE__ */ v(
|
|
690
|
-
dn,
|
|
691
|
-
{
|
|
692
|
-
onClick: () => {
|
|
693
|
-
a && U.navigateToRange(a.unitId, a.subUnitId, { startRow: a.row, endRow: a.row, startColumn: a.col, endColumn: a.col }, !0), T.executeCommand(Je.id);
|
|
694
|
-
},
|
|
695
|
-
children: d.t("hyperLink.form.cancel")
|
|
696
|
-
}
|
|
697
|
-
),
|
|
698
|
-
/* @__PURE__ */ v(
|
|
699
|
-
dn,
|
|
700
|
-
{
|
|
701
|
-
variant: "primary",
|
|
702
|
-
style: { marginLeft: 8 },
|
|
703
|
-
onClick: async () => {
|
|
704
|
-
ft();
|
|
705
|
-
},
|
|
706
|
-
children: d.t("hyperLink.form.ok")
|
|
707
|
-
}
|
|
708
|
-
)
|
|
709
|
-
] })
|
|
710
|
-
] }) : null;
|
|
680
|
+
) }),
|
|
681
|
+
(Ae == null ? void 0 : Ae.Form) && /* @__PURE__ */ m(
|
|
682
|
+
Ae.Form,
|
|
683
|
+
{
|
|
684
|
+
linkId: t,
|
|
685
|
+
payload: l,
|
|
686
|
+
display: r,
|
|
687
|
+
showError: he,
|
|
688
|
+
setByPayload: H,
|
|
689
|
+
setDisplay: (h) => {
|
|
690
|
+
q(h), H.current = !0;
|
|
691
|
+
},
|
|
692
|
+
setPayload: g
|
|
693
|
+
}
|
|
694
|
+
),
|
|
695
|
+
/* @__PURE__ */ _e("div", { className: "univer-flex univer-flex-row univer-justify-end", children: [
|
|
696
|
+
/* @__PURE__ */ m(
|
|
697
|
+
ln,
|
|
698
|
+
{
|
|
699
|
+
onClick: () => {
|
|
700
|
+
a && M.navigateToRange(a.unitId, a.subUnitId, { startRow: a.row, endRow: a.row, startColumn: a.col, endColumn: a.col }, !0), T.executeCommand(qe.id);
|
|
701
|
+
},
|
|
702
|
+
children: d.t("hyperLink.form.cancel")
|
|
703
|
+
}
|
|
704
|
+
),
|
|
705
|
+
/* @__PURE__ */ m(
|
|
706
|
+
ln,
|
|
707
|
+
{
|
|
708
|
+
variant: "primary",
|
|
709
|
+
style: { marginLeft: 8 },
|
|
710
|
+
onClick: async () => {
|
|
711
|
+
mt();
|
|
712
|
+
},
|
|
713
|
+
children: d.t("hyperLink.form.ok")
|
|
714
|
+
}
|
|
715
|
+
)
|
|
716
|
+
] })
|
|
717
|
+
]
|
|
718
|
+
}
|
|
719
|
+
) : null;
|
|
711
720
|
};
|
|
712
|
-
|
|
721
|
+
ze.componentKey = "univer.sheet.cell-link-edit";
|
|
713
722
|
var V = function() {
|
|
714
723
|
return V = Object.assign || function(t) {
|
|
715
724
|
for (var e, n = 1, i = arguments.length; n < i; n++) {
|
|
@@ -718,227 +727,262 @@ var V = function() {
|
|
|
718
727
|
}
|
|
719
728
|
return t;
|
|
720
729
|
}, V.apply(this, arguments);
|
|
721
|
-
},
|
|
730
|
+
}, Si = function(t, e) {
|
|
722
731
|
var n = {};
|
|
723
732
|
for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
|
|
724
733
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
725
734
|
for (var r = 0, i = Object.getOwnPropertySymbols(t); r < i.length; r++)
|
|
726
735
|
e.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[r]) && (n[i[r]] = t[i[r]]);
|
|
727
736
|
return n;
|
|
728
|
-
},
|
|
729
|
-
var n = t.icon, i = t.id, r = t.className,
|
|
730
|
-
return
|
|
737
|
+
}, de = ue(function(t, e) {
|
|
738
|
+
var n = t.icon, i = t.id, r = t.className, s = t.extend, o = Si(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), u = xn("_".concat(yi()));
|
|
739
|
+
return Un(n, "".concat(i), { defIds: n.defIds, idSuffix: u.current }, V({ ref: e, className: c }, o), s);
|
|
731
740
|
});
|
|
732
|
-
function
|
|
733
|
-
return
|
|
734
|
-
return
|
|
741
|
+
function Un(t, e, n, i, r) {
|
|
742
|
+
return le(t.tag, V(V({ key: e }, Ci(t, n, r)), i), (Ii(t, n).children || []).map(function(s, o) {
|
|
743
|
+
return Un(s, "".concat(e, "-").concat(t.tag, "-").concat(o), n, void 0, r);
|
|
735
744
|
}));
|
|
736
745
|
}
|
|
737
|
-
function
|
|
746
|
+
function Ci(t, e, n) {
|
|
738
747
|
var i = V({}, t.attrs);
|
|
739
|
-
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(
|
|
740
|
-
var
|
|
741
|
-
|
|
748
|
+
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) {
|
|
749
|
+
var o = s[0], c = s[1];
|
|
750
|
+
o === "mask" && typeof c == "string" && (i[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
742
751
|
});
|
|
743
752
|
var r = e.defIds;
|
|
744
|
-
return !r || r.length === 0 || (t.tag === "use" && i["xlink:href"] && (i["xlink:href"] = i["xlink:href"] + e.idSuffix), Object.entries(i).forEach(function(
|
|
745
|
-
var
|
|
746
|
-
typeof c == "string" && (i[
|
|
753
|
+
return !r || r.length === 0 || (t.tag === "use" && i["xlink:href"] && (i["xlink:href"] = i["xlink:href"] + e.idSuffix), Object.entries(i).forEach(function(s) {
|
|
754
|
+
var o = s[0], c = s[1];
|
|
755
|
+
typeof c == "string" && (i[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
747
756
|
})), i;
|
|
748
757
|
}
|
|
749
|
-
function
|
|
758
|
+
function Ii(t, e) {
|
|
750
759
|
var n, i = e.defIds;
|
|
751
760
|
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) {
|
|
752
761
|
return typeof r.attrs.id == "string" && i && i.indexOf(r.attrs.id) > -1 ? V(V({}, r), { attrs: V(V({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
753
762
|
}) }) : t;
|
|
754
763
|
}
|
|
755
|
-
function
|
|
764
|
+
function yi() {
|
|
756
765
|
return Math.random().toString(36).substring(2, 8);
|
|
757
766
|
}
|
|
758
|
-
|
|
759
|
-
var
|
|
760
|
-
return de
|
|
767
|
+
de.displayName = "UniverIcon";
|
|
768
|
+
var Ei = { 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" } }] }, Ze = ue(function(t, e) {
|
|
769
|
+
return le(de, Object.assign({}, t, {
|
|
761
770
|
id: "all-border-single",
|
|
762
771
|
ref: e,
|
|
763
|
-
icon:
|
|
772
|
+
icon: Ei
|
|
764
773
|
}));
|
|
765
774
|
});
|
|
766
|
-
|
|
767
|
-
var
|
|
768
|
-
return de
|
|
775
|
+
Ze.displayName = "AllBorderSingle";
|
|
776
|
+
var Ri = { 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" } }] }, Hn = ue(function(t, e) {
|
|
777
|
+
return le(de, Object.assign({}, t, {
|
|
769
778
|
id: "copy-single",
|
|
770
779
|
ref: e,
|
|
771
|
-
icon:
|
|
780
|
+
icon: Ri
|
|
772
781
|
}));
|
|
773
782
|
});
|
|
774
|
-
|
|
775
|
-
var
|
|
776
|
-
return de
|
|
783
|
+
Hn.displayName = "CopySingle";
|
|
784
|
+
var Pi = { 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" } }] }, Dt = ue(function(t, e) {
|
|
785
|
+
return le(de, Object.assign({}, t, {
|
|
777
786
|
id: "link-single",
|
|
778
787
|
ref: e,
|
|
779
|
-
icon:
|
|
788
|
+
icon: Pi
|
|
780
789
|
}));
|
|
781
790
|
});
|
|
782
|
-
|
|
783
|
-
var
|
|
784
|
-
return de
|
|
791
|
+
Dt.displayName = "LinkSingle";
|
|
792
|
+
var Li = { 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" } }] }, Dn = ue(function(t, e) {
|
|
793
|
+
return le(de, Object.assign({}, t, {
|
|
785
794
|
id: "unlink-single",
|
|
786
795
|
ref: e,
|
|
787
|
-
icon:
|
|
796
|
+
icon: Li
|
|
788
797
|
}));
|
|
789
798
|
});
|
|
790
|
-
|
|
791
|
-
var
|
|
792
|
-
return de
|
|
799
|
+
Dn.displayName = "UnlinkSingle";
|
|
800
|
+
var bi = { 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" } }] }, Vn = ue(function(t, e) {
|
|
801
|
+
return le(de, Object.assign({}, t, {
|
|
793
802
|
id: "write-single",
|
|
794
803
|
ref: e,
|
|
795
|
-
icon:
|
|
804
|
+
icon: bi
|
|
796
805
|
}));
|
|
797
806
|
});
|
|
798
|
-
|
|
799
|
-
var
|
|
800
|
-
return de
|
|
807
|
+
Vn.displayName = "WriteSingle";
|
|
808
|
+
var wi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.4538 1.12549C2.70051 1.12549 2.08984 1.73615 2.08984 2.48945V13.5104C2.08984 14.2637 2.70051 14.8744 3.4538 14.8744H12.5468C13.3001 14.8744 13.9108 14.2637 13.9108 13.5104V5.0992L10.0094 1.12549H3.4538Z" } }, { tag: "path", attrs: { fill: "colorChannel1", d: "M10.0078 1.12549L13.9107 5.09842H10.6745C10.3063 5.09842 10.0078 4.79994 10.0078 4.43175V1.12549Z" } }, { tag: "path", attrs: { fill: "#fff", d: "M7.80941 10.2949L6.37701 12.403C6.2632 12.5705 6.03516 12.614 5.86766 12.5002C5.70017 12.3864 5.65664 12.1584 5.77045 11.9909L7.36611 9.64252L5.94103 7.54519C5.82722 7.37769 5.87074 7.14964 6.03824 7.03583C6.20573 6.92202 6.43378 6.96555 6.54759 7.13304L7.80941 8.9901L9.07123 7.13304C9.18504 6.96555 9.41309 6.92202 9.58059 7.03583C9.74808 7.14964 9.7916 7.37769 9.67779 7.54519L8.25271 9.64252L9.84837 11.9909C9.96218 12.1584 9.91866 12.3864 9.75116 12.5002C9.58366 12.614 9.35562 12.5705 9.24181 12.403L7.80941 10.2949Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, An = ue(function(t, e) {
|
|
809
|
+
return le(de, Object.assign({}, t, {
|
|
801
810
|
id: "xlsx",
|
|
802
811
|
ref: e,
|
|
803
|
-
icon:
|
|
812
|
+
icon: wi
|
|
804
813
|
}));
|
|
805
814
|
});
|
|
806
|
-
|
|
807
|
-
const
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
[C.URL]: /* @__PURE__ */ v(Vt, {}),
|
|
818
|
-
[C.SHEET]: /* @__PURE__ */ v(Bn, {}),
|
|
819
|
-
[C.RANGE]: /* @__PURE__ */ v(Ge, {}),
|
|
820
|
-
[C.DEFINE_NAME]: /* @__PURE__ */ v(Ge, {}),
|
|
821
|
-
[C.INVALID]: /* @__PURE__ */ v(Ge, {})
|
|
822
|
-
}, fn = (t) => {
|
|
823
|
-
var U, T;
|
|
824
|
-
const e = I(K), n = I(re), i = I(On), r = I(lt), o = I(le), s = I(ne), c = I(Ht), u = I(ht), { customRange: p, row: l, col: g, unitId: d, subUnitId: _, editPermission: S, copyPermission: f, type: k } = t;
|
|
825
|
-
if (!((U = p == null ? void 0 : p.properties) != null && U.url))
|
|
815
|
+
An.displayName = "Xlsx";
|
|
816
|
+
const ki = {
|
|
817
|
+
[C.URL]: /* @__PURE__ */ m(Dt, {}),
|
|
818
|
+
[C.SHEET]: /* @__PURE__ */ m(An, {}),
|
|
819
|
+
[C.RANGE]: /* @__PURE__ */ m(Ze, {}),
|
|
820
|
+
[C.DEFINE_NAME]: /* @__PURE__ */ m(Ze, {}),
|
|
821
|
+
[C.INVALID]: /* @__PURE__ */ m(Ze, {})
|
|
822
|
+
}, vn = (t) => {
|
|
823
|
+
var M, T;
|
|
824
|
+
const e = I(G), n = I(ne), i = I(kn), r = I(ct), s = I(ce), o = I(te), c = I(Mt), u = I(pt), { customRange: p, row: l, col: g, unitId: d, subUnitId: _, editPermission: S, copyPermission: f, type: b } = t;
|
|
825
|
+
if (!((M = p == null ? void 0 : p.properties) != null && M.url))
|
|
826
826
|
return null;
|
|
827
|
-
const a = c.parseHyperLink((T = p.properties.url) != null ? T : ""),
|
|
828
|
-
return /* @__PURE__ */
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
]
|
|
840
|
-
}
|
|
841
|
-
),
|
|
842
|
-
/* @__PURE__ */ Se("div", { className: j.cellLinkOperations, children: [
|
|
843
|
-
f && /* @__PURE__ */ v(
|
|
844
|
-
"div",
|
|
845
|
-
{
|
|
846
|
-
className: pn(j.cellLinkOperation, { [j.cellLinkOperationError]: b }),
|
|
847
|
-
onClick: () => {
|
|
848
|
-
if (!b) {
|
|
849
|
-
if (a.type !== C.URL) {
|
|
850
|
-
const L = new URL(window.location.href);
|
|
851
|
-
L.hash = a.url.slice(1), navigator.clipboard.writeText(L.href);
|
|
852
|
-
} else
|
|
853
|
-
navigator.clipboard.writeText(a.url);
|
|
854
|
-
i.show({
|
|
855
|
-
content: r.t("hyperLink.message.coped"),
|
|
856
|
-
type: Oe.Info
|
|
857
|
-
});
|
|
858
|
-
}
|
|
859
|
-
},
|
|
860
|
-
children: /* @__PURE__ */ v(Fe, { placement: "bottom", title: r.t("hyperLink.popup.copy"), children: /* @__PURE__ */ v(Vn, {}) })
|
|
861
|
-
}
|
|
862
|
-
),
|
|
863
|
-
S && /* @__PURE__ */ Se(ui, { children: [
|
|
864
|
-
/* @__PURE__ */ v(
|
|
827
|
+
const a = c.parseHyperLink((T = p.properties.url) != null ? T : ""), w = a.type === C.INVALID;
|
|
828
|
+
return /* @__PURE__ */ _e(
|
|
829
|
+
"div",
|
|
830
|
+
{
|
|
831
|
+
className: `
|
|
832
|
+
univer-mb-1 univer-flex univer-max-w-[328px] univer-flex-row univer-items-center univer-justify-between
|
|
833
|
+
univer-overflow-hidden univer-rounded-lg univer-border univer-border-solid univer-border-gray-200
|
|
834
|
+
univer-bg-white univer-p-3 univer-shadow-md
|
|
835
|
+
`,
|
|
836
|
+
onClick: () => e.hideCurrentPopup(),
|
|
837
|
+
children: [
|
|
838
|
+
/* @__PURE__ */ _e(
|
|
865
839
|
"div",
|
|
866
840
|
{
|
|
867
|
-
className:
|
|
841
|
+
className: dn(`
|
|
842
|
+
univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-flex-row univer-items-center
|
|
843
|
+
univer-overflow-hidden univer-text-ellipsis univer-whitespace-nowrap univer-text-sm univer-leading-5
|
|
844
|
+
univer-text-blue-500
|
|
845
|
+
`, { "univer-text-gray-500": w }),
|
|
868
846
|
onClick: () => {
|
|
869
|
-
|
|
870
|
-
unitId: d,
|
|
871
|
-
subUnitId: _,
|
|
872
|
-
row: l,
|
|
873
|
-
col: g,
|
|
874
|
-
customRangeId: p.rangeId,
|
|
875
|
-
type: k
|
|
876
|
-
});
|
|
847
|
+
u.visible || w || s.navigate(a);
|
|
877
848
|
},
|
|
878
|
-
children:
|
|
849
|
+
children: [
|
|
850
|
+
/* @__PURE__ */ m(
|
|
851
|
+
"div",
|
|
852
|
+
{
|
|
853
|
+
className: `
|
|
854
|
+
univer-mr-2 univer-flex univer-h-5 univer-w-5 univer-flex-none univer-items-center
|
|
855
|
+
univer-justify-center univer-text-base univer-text-black
|
|
856
|
+
`,
|
|
857
|
+
children: ki[a.type]
|
|
858
|
+
}
|
|
859
|
+
),
|
|
860
|
+
/* @__PURE__ */ m(Be, { showIfEllipsis: !0, title: a.name, asChild: !0, children: /* @__PURE__ */ m("span", { className: "univer-flex-1 univer-overflow-hidden univer-text-ellipsis", children: a.name }) })
|
|
861
|
+
]
|
|
879
862
|
}
|
|
880
863
|
),
|
|
881
|
-
/* @__PURE__ */
|
|
864
|
+
/* @__PURE__ */ _e(
|
|
882
865
|
"div",
|
|
883
866
|
{
|
|
884
|
-
className:
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
867
|
+
className: `
|
|
868
|
+
univer-flex univer-h-6 univer-flex-none univer-flex-row univer-items-center univer-justify-center
|
|
869
|
+
`,
|
|
870
|
+
children: [
|
|
871
|
+
f && /* @__PURE__ */ m(
|
|
872
|
+
"div",
|
|
873
|
+
{
|
|
874
|
+
className: dn(`
|
|
875
|
+
univer-ml-2 univer-flex univer-h-6 univer-w-6 univer-cursor-pointer univer-flex-row
|
|
876
|
+
univer-items-center univer-justify-center univer-rounded univer-text-base
|
|
877
|
+
hover:univer-bg-gray-200
|
|
878
|
+
`, { "univer-text-gray-500": w }),
|
|
879
|
+
onClick: () => {
|
|
880
|
+
if (!w) {
|
|
881
|
+
if (a.type !== C.URL) {
|
|
882
|
+
const P = new URL(window.location.href);
|
|
883
|
+
P.hash = a.url.slice(1), navigator.clipboard.writeText(P.href);
|
|
884
|
+
} else
|
|
885
|
+
navigator.clipboard.writeText(a.url);
|
|
886
|
+
i.show({
|
|
887
|
+
content: r.t("hyperLink.message.coped"),
|
|
888
|
+
type: Te.Info
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
},
|
|
892
|
+
children: /* @__PURE__ */ m(Be, { placement: "bottom", title: r.t("hyperLink.popup.copy"), children: /* @__PURE__ */ m(Hn, {}) })
|
|
893
|
+
}
|
|
894
|
+
),
|
|
895
|
+
S && /* @__PURE__ */ _e(ci, { children: [
|
|
896
|
+
/* @__PURE__ */ m(
|
|
897
|
+
"div",
|
|
898
|
+
{
|
|
899
|
+
className: `
|
|
900
|
+
univer-ml-2 univer-flex univer-h-6 univer-w-6 univer-cursor-pointer univer-flex-row
|
|
901
|
+
univer-items-center univer-justify-center univer-rounded univer-text-base
|
|
902
|
+
hover:univer-bg-gray-200
|
|
903
|
+
`,
|
|
904
|
+
onClick: () => {
|
|
905
|
+
n.executeCommand(At.id, {
|
|
906
|
+
unitId: d,
|
|
907
|
+
subUnitId: _,
|
|
908
|
+
row: l,
|
|
909
|
+
col: g,
|
|
910
|
+
customRangeId: p.rangeId,
|
|
911
|
+
type: b
|
|
912
|
+
});
|
|
913
|
+
},
|
|
914
|
+
children: /* @__PURE__ */ m(Be, { placement: "bottom", title: r.t("hyperLink.popup.edit"), children: /* @__PURE__ */ m(Vn, {}) })
|
|
915
|
+
}
|
|
916
|
+
),
|
|
917
|
+
/* @__PURE__ */ m(
|
|
918
|
+
"div",
|
|
919
|
+
{
|
|
920
|
+
className: `
|
|
921
|
+
univer-ml-2 univer-flex univer-h-6 univer-w-6 univer-cursor-pointer univer-flex-row
|
|
922
|
+
univer-items-center univer-justify-center univer-rounded univer-text-base
|
|
923
|
+
hover:univer-bg-gray-200
|
|
924
|
+
`,
|
|
925
|
+
onClick: () => {
|
|
926
|
+
const P = b === v.EDITING || b === v.ZEN_EDITOR ? Lr.id : br.id;
|
|
927
|
+
n.syncExecuteCommand(P, {
|
|
928
|
+
unitId: d,
|
|
929
|
+
subUnitId: _,
|
|
930
|
+
id: p.rangeId,
|
|
931
|
+
row: l,
|
|
932
|
+
column: g,
|
|
933
|
+
documentId: b === v.ZEN_EDITOR ? x : o.getCurrentEditorId()
|
|
934
|
+
}) && e.hideCurrentPopup(void 0, !0);
|
|
935
|
+
},
|
|
936
|
+
children: /* @__PURE__ */ m(Be, { placement: "bottom", title: r.t("hyperLink.popup.cancel"), children: /* @__PURE__ */ m(Dn, {}) })
|
|
937
|
+
}
|
|
938
|
+
)
|
|
939
|
+
] })
|
|
940
|
+
]
|
|
897
941
|
}
|
|
898
942
|
)
|
|
899
|
-
]
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
},
|
|
903
|
-
var r,
|
|
904
|
-
const t = I(
|
|
905
|
-
if (
|
|
943
|
+
]
|
|
944
|
+
}
|
|
945
|
+
);
|
|
946
|
+
}, Xe = () => {
|
|
947
|
+
var r, s;
|
|
948
|
+
const t = I(G), [e, n] = Z(null), i = I(K);
|
|
949
|
+
if (ee(() => {
|
|
906
950
|
n(t.currentPopup);
|
|
907
|
-
const
|
|
951
|
+
const o = t.currentPopup$.subscribe((c) => {
|
|
908
952
|
n(c);
|
|
909
953
|
});
|
|
910
954
|
return () => {
|
|
911
|
-
|
|
955
|
+
o.unsubscribe();
|
|
912
956
|
};
|
|
913
957
|
}, [t.currentPopup, t.currentPopup$]), !e)
|
|
914
958
|
return null;
|
|
915
959
|
if (e.showAll) {
|
|
916
|
-
const
|
|
917
|
-
return p != null && p.length ? /* @__PURE__ */
|
|
960
|
+
const o = i.getUnit(e.unitId, k.UNIVER_SHEET), c = o == null ? void 0 : o.getSheetBySheetId(e.subUnitId), u = c == null ? void 0 : c.getCell(e.row, e.col), p = (s = (r = u == null ? void 0 : u.p) == null ? void 0 : r.body) == null ? void 0 : s.customRanges;
|
|
961
|
+
return p != null && p.length ? /* @__PURE__ */ m("div", { children: p.map((l) => /* @__PURE__ */ m(vn, { ...e, customRange: l }, l.rangeId)) }) : null;
|
|
918
962
|
}
|
|
919
|
-
return /* @__PURE__ */
|
|
963
|
+
return /* @__PURE__ */ m(vn, { ...e });
|
|
920
964
|
};
|
|
921
|
-
|
|
922
|
-
var
|
|
923
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
924
|
-
(
|
|
965
|
+
Xe.componentKey = "univer.sheet.cell-link-popup";
|
|
966
|
+
var Ti = Object.getOwnPropertyDescriptor, Oi = (t, e, n, i) => {
|
|
967
|
+
for (var r = i > 1 ? void 0 : i ? Ti(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
968
|
+
(o = t[s]) && (r = o(r) || r);
|
|
925
969
|
return r;
|
|
926
970
|
}, se = (t, e) => (n, i) => e(n, i, t);
|
|
927
|
-
const
|
|
971
|
+
const mn = (t, e) => {
|
|
928
972
|
var n, i;
|
|
929
973
|
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;
|
|
930
974
|
};
|
|
931
|
-
let
|
|
932
|
-
constructor(e, n, i, r,
|
|
975
|
+
let G = class extends Y {
|
|
976
|
+
constructor(e, n, i, r, s, o, c) {
|
|
933
977
|
super();
|
|
934
978
|
$(this, "_currentPopup", null);
|
|
935
|
-
$(this, "_currentPopup$", new
|
|
979
|
+
$(this, "_currentPopup$", new ii());
|
|
936
980
|
$(this, "currentPopup$", this._currentPopup$.asObservable());
|
|
937
981
|
$(this, "_currentEditingPopup", null);
|
|
938
|
-
$(this, "_currentEditing$", new
|
|
982
|
+
$(this, "_currentEditing$", new si(null));
|
|
939
983
|
$(this, "currentEditing$", this._currentEditing$.asObservable());
|
|
940
984
|
$(this, "_isKeepVisible", !1);
|
|
941
|
-
this._sheetCanvasPopManagerService = e, this._injector = n, this._univerInstanceService = i, this._editorBridgeService = r, this._textSelectionManagerService =
|
|
985
|
+
this._sheetCanvasPopManagerService = e, this._injector = n, this._univerInstanceService = i, this._editorBridgeService = r, this._textSelectionManagerService = s, this._docCanvasPopManagerService = o, this._zenZoneService = c, this.disposeWithMe(() => {
|
|
942
986
|
this.hideCurrentPopup(), this.endEditing(), this._currentEditing$.complete(), this._currentPopup$.complete();
|
|
943
987
|
});
|
|
944
988
|
}
|
|
@@ -955,15 +999,15 @@ let K = class extends z {
|
|
|
955
999
|
return this._isKeepVisible;
|
|
956
1000
|
}
|
|
957
1001
|
showPopup(e) {
|
|
958
|
-
if (this._currentPopup &&
|
|
1002
|
+
if (this._currentPopup && mn(e, this._currentPopup) || (this.hideCurrentPopup(void 0, !0), e.type !== v.ZEN_EDITOR && this._zenZoneService.visible))
|
|
959
1003
|
return;
|
|
960
1004
|
const n = this._currentEditing$.getValue();
|
|
961
|
-
if (n &&
|
|
1005
|
+
if (n && mn(e, n))
|
|
962
1006
|
return;
|
|
963
|
-
const { unitId: i, subUnitId: r, row:
|
|
1007
|
+
const { unitId: i, subUnitId: r, row: s, col: o, customRangeRect: c, customRange: u } = e;
|
|
964
1008
|
let p;
|
|
965
1009
|
const l = {
|
|
966
|
-
componentKey:
|
|
1010
|
+
componentKey: Xe.componentKey,
|
|
967
1011
|
direction: "bottom",
|
|
968
1012
|
onClickOutside: () => {
|
|
969
1013
|
this.hideCurrentPopup();
|
|
@@ -972,14 +1016,14 @@ let K = class extends z {
|
|
|
972
1016
|
this.hideCurrentPopup(e.type, !0);
|
|
973
1017
|
}
|
|
974
1018
|
};
|
|
975
|
-
if (e.type ===
|
|
1019
|
+
if (e.type === v.EDITING) {
|
|
976
1020
|
if (!u)
|
|
977
1021
|
return;
|
|
978
1022
|
p = c && this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(
|
|
979
1023
|
c,
|
|
980
1024
|
l
|
|
981
1025
|
);
|
|
982
|
-
} else if (e.type ===
|
|
1026
|
+
} else if (e.type === v.ZEN_EDITOR) {
|
|
983
1027
|
if (!u)
|
|
984
1028
|
return;
|
|
985
1029
|
p = this._docCanvasPopManagerService.attachPopupToRange(
|
|
@@ -989,7 +1033,7 @@ let K = class extends z {
|
|
|
989
1033
|
collapsed: !1
|
|
990
1034
|
},
|
|
991
1035
|
l,
|
|
992
|
-
|
|
1036
|
+
x
|
|
993
1037
|
);
|
|
994
1038
|
} else if (e.showAll)
|
|
995
1039
|
p = this._sheetCanvasPopManagerService.attachPopupToCell(e.row, e.col, l, i, r);
|
|
@@ -1006,8 +1050,8 @@ let K = class extends z {
|
|
|
1006
1050
|
unitId: i,
|
|
1007
1051
|
subUnitId: r,
|
|
1008
1052
|
disposable: p,
|
|
1009
|
-
row:
|
|
1010
|
-
col:
|
|
1053
|
+
row: s,
|
|
1054
|
+
col: o,
|
|
1011
1055
|
editPermission: !!e.editPermission,
|
|
1012
1056
|
copyPermission: !!e.copyPermission,
|
|
1013
1057
|
customRange: u,
|
|
@@ -1020,35 +1064,35 @@ let K = class extends z {
|
|
|
1020
1064
|
this._currentPopup && ((!e || e === this._currentPopup.type) && this._currentPopup.disposable.canDispose() || n) && ((r = (i = this._currentPopup) == null ? void 0 : i.disposable) == null || r.dispose(), this._currentPopup = null, this._currentPopup$.next(null));
|
|
1021
1065
|
}
|
|
1022
1066
|
_getEditingRange() {
|
|
1023
|
-
var i, r,
|
|
1067
|
+
var i, r, s;
|
|
1024
1068
|
const e = this._editorBridgeService.isVisible().visible, n = this._editorBridgeService.getEditCellState();
|
|
1025
1069
|
if (e && n) {
|
|
1026
|
-
const
|
|
1070
|
+
const o = this._textSelectionManagerService.getActiveTextRange(), c = (i = n.documentLayoutObject.documentModel) == null ? void 0 : i.getBody();
|
|
1027
1071
|
if (!c)
|
|
1028
1072
|
return null;
|
|
1029
|
-
if (!
|
|
1073
|
+
if (!o || o.collapsed)
|
|
1030
1074
|
return {
|
|
1031
1075
|
startOffset: 0,
|
|
1032
1076
|
endOffset: c.dataStream.length - 2,
|
|
1033
1077
|
collapsed: c.dataStream.length - 2 === 0,
|
|
1034
|
-
label:
|
|
1078
|
+
label: fe.transform.getPlainText(c.dataStream)
|
|
1035
1079
|
};
|
|
1036
|
-
const u =
|
|
1037
|
-
let p =
|
|
1080
|
+
const u = fe.customRange.getCustomRangesInterestsWithSelection(o, (s = (r = c.customRanges) == null ? void 0 : r.filter((g) => g.rangeType === Ge.HYPERLINK)) != null ? s : []);
|
|
1081
|
+
let p = o.startOffset, l = o.endOffset;
|
|
1038
1082
|
return u.forEach((g) => {
|
|
1039
1083
|
p = Math.min(p, g.startIndex), l = Math.max(l, g.endIndex + 1);
|
|
1040
1084
|
}), {
|
|
1041
1085
|
startOffset: p,
|
|
1042
1086
|
endOffset: l,
|
|
1043
1087
|
collapsed: p === l,
|
|
1044
|
-
label:
|
|
1088
|
+
label: fe.transform.getPlainText(c.dataStream.slice(p, l))
|
|
1045
1089
|
};
|
|
1046
1090
|
}
|
|
1047
1091
|
return null;
|
|
1048
1092
|
}
|
|
1049
1093
|
get _editPopup() {
|
|
1050
1094
|
return {
|
|
1051
|
-
componentKey:
|
|
1095
|
+
componentKey: ze.componentKey,
|
|
1052
1096
|
direction: "vertical",
|
|
1053
1097
|
onClickOutside: () => {
|
|
1054
1098
|
this.endEditing();
|
|
@@ -1060,10 +1104,10 @@ let K = class extends z {
|
|
|
1060
1104
|
};
|
|
1061
1105
|
}
|
|
1062
1106
|
startAddEditing(e) {
|
|
1063
|
-
var
|
|
1107
|
+
var s, o, c, u, p;
|
|
1064
1108
|
const { unitId: n, subUnitId: i, type: r } = e;
|
|
1065
|
-
if (r ===
|
|
1066
|
-
const l = this._univerInstanceService.getUnit(
|
|
1109
|
+
if (r === v.ZEN_EDITOR) {
|
|
1110
|
+
const l = this._univerInstanceService.getUnit(x, k.UNIVER_DOC);
|
|
1067
1111
|
if (!l)
|
|
1068
1112
|
return;
|
|
1069
1113
|
const g = this._textSelectionManagerService.getActiveTextRange();
|
|
@@ -1072,22 +1116,22 @@ let K = class extends z {
|
|
|
1072
1116
|
this._currentEditingPopup = this._docCanvasPopManagerService.attachPopupToRange(
|
|
1073
1117
|
g,
|
|
1074
1118
|
this._editPopup,
|
|
1075
|
-
|
|
1119
|
+
x
|
|
1076
1120
|
);
|
|
1077
|
-
const d = (
|
|
1121
|
+
const d = (s = l.getBody()) == null ? void 0 : s.dataStream.slice(g.startOffset, g.endOffset);
|
|
1078
1122
|
this._currentEditing$.next({
|
|
1079
1123
|
...e,
|
|
1080
1124
|
label: d
|
|
1081
1125
|
});
|
|
1082
|
-
} else if (r ===
|
|
1126
|
+
} else if (r === v.EDITING) {
|
|
1083
1127
|
const l = this._getEditingRange();
|
|
1084
1128
|
if (!l)
|
|
1085
1129
|
return;
|
|
1086
|
-
this._textSelectionManagerService.replaceDocRanges([{ ...l }], { unitId:
|
|
1087
|
-
const g = this._injector.get(
|
|
1130
|
+
this._textSelectionManagerService.replaceDocRanges([{ ...l }], { unitId: Ce, subUnitId: Ce });
|
|
1131
|
+
const g = this._injector.get(He).getRenderById(Ce);
|
|
1088
1132
|
if (!g)
|
|
1089
1133
|
return;
|
|
1090
|
-
const d =
|
|
1134
|
+
const d = ni(l, g);
|
|
1091
1135
|
if (!(d != null && d.length))
|
|
1092
1136
|
return;
|
|
1093
1137
|
this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(
|
|
@@ -1097,7 +1141,7 @@ let K = class extends z {
|
|
|
1097
1141
|
i
|
|
1098
1142
|
), this._currentEditing$.next({
|
|
1099
1143
|
...e,
|
|
1100
|
-
label: (
|
|
1144
|
+
label: (o = l == null ? void 0 : l.label) != null ? o : ""
|
|
1101
1145
|
});
|
|
1102
1146
|
} else {
|
|
1103
1147
|
this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToCell(
|
|
@@ -1107,22 +1151,22 @@ let K = class extends z {
|
|
|
1107
1151
|
n,
|
|
1108
1152
|
i
|
|
1109
1153
|
);
|
|
1110
|
-
const l = this._univerInstanceService.getUnit(n,
|
|
1154
|
+
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);
|
|
1111
1155
|
this._currentEditing$.next({
|
|
1112
1156
|
...e,
|
|
1113
|
-
label: d != null && d.p ?
|
|
1157
|
+
label: d != null && d.p ? fe.transform.getPlainText((u = (c = d.p.body) == null ? void 0 : c.dataStream) != null ? u : "") : ((p = d == null ? void 0 : d.v) != null ? p : "").toString()
|
|
1114
1158
|
});
|
|
1115
1159
|
}
|
|
1116
1160
|
}
|
|
1117
1161
|
// eslint-disable-next-line complexity, max-lines-per-function
|
|
1118
1162
|
startEditing(e) {
|
|
1119
|
-
var
|
|
1120
|
-
(
|
|
1163
|
+
var o, c, u, p, l, g;
|
|
1164
|
+
(o = this._currentEditingPopup) == null || o.dispose(), this.hideCurrentPopup(void 0, !0);
|
|
1121
1165
|
const { unitId: n, subUnitId: i } = e;
|
|
1122
|
-
let r,
|
|
1123
|
-
if (e.type ===
|
|
1124
|
-
const d = this._univerInstanceService.getUnit(
|
|
1125
|
-
if (r = (u = (c = d == null ? void 0 : d.getBody()) == null ? void 0 : c.customRanges) == null ? void 0 : u.find((_) => _.rangeId === e.customRangeId),
|
|
1166
|
+
let r, s;
|
|
1167
|
+
if (e.type === v.ZEN_EDITOR) {
|
|
1168
|
+
const d = this._univerInstanceService.getUnit(x, k.UNIVER_DOC);
|
|
1169
|
+
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)
|
|
1126
1170
|
return;
|
|
1127
1171
|
this._textSelectionManagerService.replaceTextRanges([
|
|
1128
1172
|
{
|
|
@@ -1136,13 +1180,13 @@ let K = class extends z {
|
|
|
1136
1180
|
collapsed: !1
|
|
1137
1181
|
},
|
|
1138
1182
|
this._editPopup,
|
|
1139
|
-
|
|
1183
|
+
x
|
|
1140
1184
|
);
|
|
1141
|
-
} else if (e.type ===
|
|
1142
|
-
const d =
|
|
1185
|
+
} else if (e.type === v.EDITING) {
|
|
1186
|
+
const d = Mr(this._injector, e.unitId, e.subUnitId, e.row, e.col, e.customRangeId);
|
|
1143
1187
|
if (!d || !((l = d.rects) != null && l.length))
|
|
1144
1188
|
return;
|
|
1145
|
-
r = d.customRange,
|
|
1189
|
+
r = d.customRange, s = d.label, this._textSelectionManagerService.replaceTextRanges([
|
|
1146
1190
|
{
|
|
1147
1191
|
startOffset: r.startIndex,
|
|
1148
1192
|
endOffset: r.endIndex + 1
|
|
@@ -1154,10 +1198,10 @@ let K = class extends z {
|
|
|
1154
1198
|
i
|
|
1155
1199
|
);
|
|
1156
1200
|
} else {
|
|
1157
|
-
const d = this._univerInstanceService.getUnit(n,
|
|
1201
|
+
const d = this._univerInstanceService.getUnit(n, k.UNIVER_SHEET), _ = d == null ? void 0 : d.getSheetBySheetId(i), S = _ == null ? void 0 : _.getCellRaw(e.row, e.col), f = d == null ? void 0 : d.getStyles().getStyleByCell(S), b = f == null ? void 0 : f.tr, a = Ur(this._injector, e.unitId, e.subUnitId, e.row, e.col, e.customRangeId);
|
|
1158
1202
|
if (!a || !((g = a.rects) != null && g.length))
|
|
1159
1203
|
return;
|
|
1160
|
-
r = a.customRange,
|
|
1204
|
+
r = a.customRange, s = a.label, b ? this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToCell(
|
|
1161
1205
|
e.row,
|
|
1162
1206
|
e.col,
|
|
1163
1207
|
this._editPopup,
|
|
@@ -1177,7 +1221,7 @@ let K = class extends z {
|
|
|
1177
1221
|
this._currentEditing$.next({
|
|
1178
1222
|
...e,
|
|
1179
1223
|
customRange: r,
|
|
1180
|
-
label:
|
|
1224
|
+
label: s
|
|
1181
1225
|
});
|
|
1182
1226
|
}
|
|
1183
1227
|
endEditing(e) {
|
|
@@ -1188,185 +1232,185 @@ let K = class extends z {
|
|
|
1188
1232
|
n && (!e || e === n.type) && ((i = this._currentEditingPopup) == null || i.dispose(), this._currentEditing$.next(null));
|
|
1189
1233
|
}
|
|
1190
1234
|
};
|
|
1191
|
-
|
|
1192
|
-
se(0, y(
|
|
1235
|
+
G = Oi([
|
|
1236
|
+
se(0, y(Nr)),
|
|
1193
1237
|
se(1, y(ut)),
|
|
1194
|
-
se(2,
|
|
1195
|
-
se(3,
|
|
1196
|
-
se(4, y(
|
|
1197
|
-
se(5, y(
|
|
1198
|
-
se(6,
|
|
1199
|
-
],
|
|
1200
|
-
var
|
|
1201
|
-
const
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
]),
|
|
1238
|
+
se(2, K),
|
|
1239
|
+
se(3, te),
|
|
1240
|
+
se(4, y(Ue)),
|
|
1241
|
+
se(5, y(ti)),
|
|
1242
|
+
se(6, pt)
|
|
1243
|
+
], G);
|
|
1244
|
+
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 || {});
|
|
1245
|
+
const xi = /* @__PURE__ */ new Set([
|
|
1246
|
+
Ct.CHECKBOX,
|
|
1247
|
+
Ct.LIST,
|
|
1248
|
+
Ct.LIST_MULTIPLE
|
|
1249
|
+
]), Vt = (t, e, n, i) => {
|
|
1206
1250
|
var c, u, p, l, g;
|
|
1207
1251
|
const r = e.getCell(n, i);
|
|
1208
1252
|
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)
|
|
1209
1253
|
return 1;
|
|
1210
|
-
const
|
|
1211
|
-
return
|
|
1212
|
-
},
|
|
1213
|
-
const e = t.get(
|
|
1254
|
+
const s = t.has(hn) ? t.get(hn) : null, o = s == null ? void 0 : s.getRuleByLocation(e.getUnitId(), e.getSheetId(), n, i);
|
|
1255
|
+
return o && xi.has(o.type) ? !0 : (g = (l = r == null ? void 0 : r.p) == null ? void 0 : l.drawingsOrder) != null && g.length ? 2 : 0;
|
|
1256
|
+
}, Ni = (t) => {
|
|
1257
|
+
const e = t.get(K).getCurrentUnitForType(k.UNIVER_SHEET);
|
|
1214
1258
|
if (!e)
|
|
1215
1259
|
return !0;
|
|
1216
1260
|
const n = e.getActiveSheet(), i = t.get(wt).getCurrentSelections();
|
|
1217
1261
|
if (!i.length)
|
|
1218
1262
|
return !0;
|
|
1219
|
-
const r = i[0].range.startRow,
|
|
1220
|
-
return
|
|
1221
|
-
},
|
|
1222
|
-
const e = t.get(
|
|
1263
|
+
const r = i[0].range.startRow, s = i[0].range.startColumn;
|
|
1264
|
+
return Vt(t, n, r, s) === 1;
|
|
1265
|
+
}, Mi = (t) => {
|
|
1266
|
+
const e = t.get(Ue), n = t.get(K), i = e.getTextRanges();
|
|
1223
1267
|
if (!(i != null && i.length))
|
|
1224
1268
|
return !0;
|
|
1225
|
-
const r = n.getCurrentUnitForType(
|
|
1226
|
-
return !!(!r || i.every((
|
|
1227
|
-
},
|
|
1228
|
-
type:
|
|
1269
|
+
const r = n.getCurrentUnitForType(k.UNIVER_DOC);
|
|
1270
|
+
return !!(!r || i.every((o) => o.collapsed) || !r.getSelfOrHeaderFooterModel(i[0].segmentId).getBody());
|
|
1271
|
+
}, At = {
|
|
1272
|
+
type: lt.OPERATION,
|
|
1229
1273
|
id: "sheet.operation.open-hyper-link-edit-panel",
|
|
1230
1274
|
handler(t, e) {
|
|
1231
1275
|
if (!e)
|
|
1232
1276
|
return !1;
|
|
1233
|
-
const n = t.get(
|
|
1277
|
+
const n = t.get(G);
|
|
1234
1278
|
return e.customRangeId ? n.startEditing(e) : n.startAddEditing(e), !0;
|
|
1235
1279
|
}
|
|
1236
|
-
},
|
|
1237
|
-
type:
|
|
1280
|
+
}, qe = {
|
|
1281
|
+
type: lt.OPERATION,
|
|
1238
1282
|
id: "sheet.operation.close-hyper-link-popup",
|
|
1239
1283
|
handler(t) {
|
|
1240
|
-
return t.get(
|
|
1284
|
+
return t.get(G).endEditing(), !0;
|
|
1241
1285
|
}
|
|
1242
|
-
},
|
|
1243
|
-
type:
|
|
1286
|
+
}, $t = {
|
|
1287
|
+
type: lt.OPERATION,
|
|
1244
1288
|
id: "sheet.operation.insert-hyper-link",
|
|
1245
1289
|
handler(t) {
|
|
1246
1290
|
var g;
|
|
1247
|
-
const e = t.get(
|
|
1291
|
+
const e = t.get(K), n = kt(e), i = t.get(te);
|
|
1248
1292
|
if (!n)
|
|
1249
1293
|
return !1;
|
|
1250
|
-
const r = t.get(
|
|
1251
|
-
if (!
|
|
1294
|
+
const r = t.get(ne), o = t.get(wt).getCurrentLastSelection();
|
|
1295
|
+
if (!o)
|
|
1252
1296
|
return !1;
|
|
1253
|
-
const c =
|
|
1254
|
-
return r.executeCommand(
|
|
1297
|
+
const c = o.range.startRow, u = o.range.startColumn, p = i.isVisible(), l = ((g = e.getFocusedUnit()) == null ? void 0 : g.getUnitId()) === x;
|
|
1298
|
+
return r.executeCommand(At.id, {
|
|
1255
1299
|
unitId: n.unitId,
|
|
1256
1300
|
subUnitId: n.subUnitId,
|
|
1257
1301
|
row: c,
|
|
1258
1302
|
col: u,
|
|
1259
|
-
type: l ?
|
|
1303
|
+
type: l ? v.ZEN_EDITOR : p.visible ? v.EDITING : v.VIEWING
|
|
1260
1304
|
});
|
|
1261
1305
|
}
|
|
1262
|
-
},
|
|
1263
|
-
type:
|
|
1306
|
+
}, ae = {
|
|
1307
|
+
type: lt.OPERATION,
|
|
1264
1308
|
id: "sheet.operation.insert-hyper-link-toolbar",
|
|
1265
1309
|
handler(t) {
|
|
1266
|
-
if (
|
|
1310
|
+
if (Ni(t))
|
|
1267
1311
|
return !1;
|
|
1268
|
-
const e = t.get(
|
|
1269
|
-
return t.get(
|
|
1312
|
+
const e = t.get(ne);
|
|
1313
|
+
return t.get(G).currentEditing ? e.executeCommand(qe.id) : e.executeCommand($t.id);
|
|
1270
1314
|
}
|
|
1271
|
-
},
|
|
1315
|
+
}, Bt = (t, e = x) => {
|
|
1272
1316
|
var r;
|
|
1273
|
-
const n = t.get(
|
|
1274
|
-
return i ? i.textSelectionInner$.pipe(
|
|
1275
|
-
const
|
|
1276
|
-
if (!
|
|
1317
|
+
const n = t.get(K), i = (r = t.get(He).getRenderById(e)) == null ? void 0 : r.with(On);
|
|
1318
|
+
return i ? i.textSelectionInner$.pipe(Ut(() => {
|
|
1319
|
+
const o = t.get(te).getEditCellState();
|
|
1320
|
+
if (!o)
|
|
1277
1321
|
return !0;
|
|
1278
|
-
const c =
|
|
1279
|
-
return !(c != null && c.worksheet) ||
|
|
1280
|
-
})) :
|
|
1281
|
-
},
|
|
1322
|
+
const c = kt(n, { unitId: o.unitId, subUnitId: o.sheetId });
|
|
1323
|
+
return !(c != null && c.worksheet) || Vt(t, c.worksheet, o.row, o.column) === 1 ? !0 : Mi(t);
|
|
1324
|
+
})) : oe(!0);
|
|
1325
|
+
}, $n = (t) => {
|
|
1282
1326
|
var r;
|
|
1283
|
-
const e = t.get(
|
|
1327
|
+
const e = t.get(K), n = t.has(te) ? t.get(te) : null;
|
|
1284
1328
|
return ((r = n == null ? void 0 : n.currentEditCellState$.pipe(
|
|
1285
|
-
|
|
1286
|
-
if (!
|
|
1287
|
-
return
|
|
1288
|
-
const
|
|
1289
|
-
return
|
|
1329
|
+
Ut((s) => {
|
|
1330
|
+
if (!s)
|
|
1331
|
+
return Oe.DISABLED_BY_CELL;
|
|
1332
|
+
const o = kt(e, { unitId: s.unitId, subUnitId: s.sheetId });
|
|
1333
|
+
return o ? Vt(t, o.worksheet, s.row, s.column) : Oe.DISABLED_BY_CELL;
|
|
1290
1334
|
}),
|
|
1291
|
-
|
|
1292
|
-
if (
|
|
1293
|
-
return
|
|
1294
|
-
const
|
|
1295
|
-
return
|
|
1296
|
-
|
|
1297
|
-
([c, u]) => c != null && c.visible ? (u == null ? void 0 : u.getUnitId()) ===
|
|
1335
|
+
Me((s) => {
|
|
1336
|
+
if (s === Oe.DISABLED_BY_CELL)
|
|
1337
|
+
return oe(!0);
|
|
1338
|
+
const o = n ? n.visible$ : oe(null);
|
|
1339
|
+
return oi([o, e.getCurrentTypeOfUnit$(k.UNIVER_DOC)]).pipe(
|
|
1340
|
+
Me(
|
|
1341
|
+
([c, u]) => c != null && c.visible ? (u == null ? void 0 : u.getUnitId()) === ir ? oe(!0) : Bt(t, Ce) : oe(s !== Oe.ALLOWED)
|
|
1298
1342
|
)
|
|
1299
1343
|
);
|
|
1300
1344
|
})
|
|
1301
|
-
)) != null ? r :
|
|
1302
|
-
|
|
1345
|
+
)) != null ? r : oe(!0)).pipe(
|
|
1346
|
+
Me((s) => s ? oe(!0) : Dr(t, { workbookTypes: [Nt], worksheetTypes: [Ot, Pn, xt], rangeTypes: [Tt] }, !0))
|
|
1303
1347
|
);
|
|
1304
|
-
},
|
|
1305
|
-
commandId:
|
|
1306
|
-
type:
|
|
1348
|
+
}, Je = {
|
|
1349
|
+
commandId: $t.id,
|
|
1350
|
+
type: Tn.BUTTON,
|
|
1307
1351
|
title: "hyperLink.menu.add",
|
|
1308
1352
|
icon: "LinkSingle"
|
|
1309
|
-
},
|
|
1310
|
-
...
|
|
1311
|
-
id:
|
|
1312
|
-
hidden$:
|
|
1313
|
-
disabled$:
|
|
1353
|
+
}, Qe = (t) => `${t}-zen-editor`, Ui = (t) => ({
|
|
1354
|
+
...Je,
|
|
1355
|
+
id: Je.commandId,
|
|
1356
|
+
hidden$: ht(t, k.UNIVER_SHEET),
|
|
1357
|
+
disabled$: $n(t)
|
|
1314
1358
|
// disabled$: getObservableWithExclusiveRange$(accessor, getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission, WorksheetSetCellValuePermission, WorksheetInsertHyperlinkPermission], rangeTypes: [RangeProtectionPermissionEditPoint] })),
|
|
1315
|
-
}),
|
|
1316
|
-
...
|
|
1317
|
-
id:
|
|
1318
|
-
hidden$:
|
|
1319
|
-
disabled$:
|
|
1320
|
-
}),
|
|
1359
|
+
}), Hi = (t) => ({
|
|
1360
|
+
...Je,
|
|
1361
|
+
id: Qe(Je.commandId),
|
|
1362
|
+
hidden$: ht(t, k.UNIVER_DOC, x),
|
|
1363
|
+
disabled$: Bt(t)
|
|
1364
|
+
}), et = {
|
|
1321
1365
|
tooltip: "hyperLink.form.addTitle",
|
|
1322
|
-
commandId:
|
|
1323
|
-
type:
|
|
1366
|
+
commandId: ae.id,
|
|
1367
|
+
type: Tn.BUTTON,
|
|
1324
1368
|
icon: "LinkSingle"
|
|
1325
|
-
},
|
|
1326
|
-
...
|
|
1327
|
-
id:
|
|
1328
|
-
hidden$:
|
|
1329
|
-
disabled$:
|
|
1330
|
-
}),
|
|
1331
|
-
...
|
|
1332
|
-
id: et
|
|
1333
|
-
hidden$:
|
|
1334
|
-
disabled$:
|
|
1335
|
-
}),
|
|
1336
|
-
id:
|
|
1337
|
-
binding: Pt.K |
|
|
1338
|
-
preconditions:
|
|
1369
|
+
}, Di = (t) => ({
|
|
1370
|
+
...et,
|
|
1371
|
+
id: et.commandId,
|
|
1372
|
+
hidden$: ht(t, k.UNIVER_SHEET),
|
|
1373
|
+
disabled$: $n(t)
|
|
1374
|
+
}), Vi = (t) => ({
|
|
1375
|
+
...et,
|
|
1376
|
+
id: Qe(et.commandId),
|
|
1377
|
+
hidden$: ht(t, k.UNIVER_DOC, x),
|
|
1378
|
+
disabled$: Bt(t)
|
|
1379
|
+
}), Bn = {
|
|
1380
|
+
id: ae.id,
|
|
1381
|
+
binding: Pt.K | Kr.CTRL_COMMAND,
|
|
1382
|
+
preconditions: Hr
|
|
1339
1383
|
};
|
|
1340
|
-
var
|
|
1341
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1342
|
-
(
|
|
1384
|
+
var Ai = Object.getOwnPropertyDescriptor, $i = (t, e, n, i) => {
|
|
1385
|
+
for (var r = i > 1 ? void 0 : i ? Ai(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1386
|
+
(o = t[s]) && (r = o(r) || r);
|
|
1343
1387
|
return r;
|
|
1344
|
-
},
|
|
1345
|
-
let
|
|
1388
|
+
}, fn = (t, e) => (n, i) => e(n, i, t);
|
|
1389
|
+
let tt = class extends Y {
|
|
1346
1390
|
constructor(t, e) {
|
|
1347
1391
|
super(), this._autoFillService = t, this._hyperLinkModel = e, this._initAutoFill();
|
|
1348
1392
|
}
|
|
1349
1393
|
// eslint-disable-next-line max-lines-per-function
|
|
1350
1394
|
_initAutoFill() {
|
|
1351
1395
|
const t = () => ({ redos: [], undos: [] }), e = (i, r) => {
|
|
1352
|
-
const { source:
|
|
1396
|
+
const { source: s, target: o, unitId: c, subUnitId: u } = i, p = Rt([s, o]), [l, g] = p.ranges, { mapFunc: d } = p, _ = {
|
|
1353
1397
|
row: l.startRow,
|
|
1354
1398
|
col: l.startColumn
|
|
1355
|
-
}, S =
|
|
1399
|
+
}, S = Ar(l, g), f = [], b = [];
|
|
1356
1400
|
return S.forEach((a) => {
|
|
1357
|
-
const
|
|
1401
|
+
const w = a.repeatStartCell, M = a.relativeRange, T = {
|
|
1358
1402
|
startRow: _.row,
|
|
1359
1403
|
startColumn: _.col,
|
|
1360
1404
|
endColumn: _.col,
|
|
1361
1405
|
endRow: _.row
|
|
1362
|
-
},
|
|
1363
|
-
startRow:
|
|
1364
|
-
startColumn:
|
|
1365
|
-
endColumn:
|
|
1366
|
-
endRow:
|
|
1406
|
+
}, P = {
|
|
1407
|
+
startRow: w.row,
|
|
1408
|
+
startColumn: w.col,
|
|
1409
|
+
endColumn: w.col,
|
|
1410
|
+
endRow: w.row
|
|
1367
1411
|
};
|
|
1368
|
-
|
|
1369
|
-
const
|
|
1412
|
+
yn.foreach(M, (A, D) => {
|
|
1413
|
+
const z = Ie.getPositionRange(
|
|
1370
1414
|
{
|
|
1371
1415
|
startRow: A,
|
|
1372
1416
|
startColumn: D,
|
|
@@ -1374,117 +1418,117 @@ let nt = class extends z {
|
|
|
1374
1418
|
endRow: A
|
|
1375
1419
|
},
|
|
1376
1420
|
T
|
|
1377
|
-
), { row:
|
|
1421
|
+
), { row: ye, col: De } = d(z.startRow, z.startColumn), re = this._hyperLinkModel.getHyperLinkByLocation(c, u, ye, De), Ee = Ie.getPositionRange(
|
|
1378
1422
|
{
|
|
1379
1423
|
startRow: A,
|
|
1380
1424
|
startColumn: D,
|
|
1381
1425
|
endColumn: D,
|
|
1382
1426
|
endRow: A
|
|
1383
1427
|
},
|
|
1384
|
-
|
|
1385
|
-
), { row:
|
|
1386
|
-
|
|
1387
|
-
id:
|
|
1428
|
+
P
|
|
1429
|
+
), { row: Re, col: Pe } = d(Ee.startRow, Ee.startColumn), Ve = Se.generateRandomId(), pe = this._hyperLinkModel.getHyperLinkByLocation(c, u, Re, Pe);
|
|
1430
|
+
pe && f.push({
|
|
1431
|
+
id: xe.id,
|
|
1388
1432
|
params: {
|
|
1389
1433
|
unitId: c,
|
|
1390
1434
|
subUnitId: u,
|
|
1391
|
-
id:
|
|
1435
|
+
id: pe.id
|
|
1392
1436
|
}
|
|
1393
|
-
}), (we.COPY === r || we.SERIES === r) &&
|
|
1394
|
-
id:
|
|
1437
|
+
}), (we.COPY === r || we.SERIES === r) && re && (f.push({
|
|
1438
|
+
id: Ne.id,
|
|
1395
1439
|
params: {
|
|
1396
1440
|
unitId: c,
|
|
1397
1441
|
subUnitId: u,
|
|
1398
1442
|
link: {
|
|
1399
|
-
...
|
|
1400
|
-
id:
|
|
1401
|
-
row:
|
|
1443
|
+
...re,
|
|
1444
|
+
id: Ve,
|
|
1445
|
+
row: Re,
|
|
1402
1446
|
column: Pe
|
|
1403
1447
|
}
|
|
1404
1448
|
}
|
|
1405
|
-
}),
|
|
1406
|
-
id:
|
|
1449
|
+
}), b.push({
|
|
1450
|
+
id: xe.id,
|
|
1407
1451
|
params: {
|
|
1408
1452
|
unitId: c,
|
|
1409
1453
|
subUnitId: u,
|
|
1410
|
-
id:
|
|
1454
|
+
id: Ve
|
|
1411
1455
|
}
|
|
1412
|
-
})),
|
|
1413
|
-
id:
|
|
1456
|
+
})), pe && b.push({
|
|
1457
|
+
id: Ne.id,
|
|
1414
1458
|
params: {
|
|
1415
1459
|
unitId: c,
|
|
1416
1460
|
subUnitId: u,
|
|
1417
|
-
link:
|
|
1461
|
+
link: pe
|
|
1418
1462
|
}
|
|
1419
1463
|
});
|
|
1420
1464
|
});
|
|
1421
1465
|
}), {
|
|
1422
|
-
undos:
|
|
1466
|
+
undos: b,
|
|
1423
1467
|
redos: f
|
|
1424
1468
|
};
|
|
1425
1469
|
}, n = {
|
|
1426
|
-
id:
|
|
1427
|
-
onFillData: (i, r,
|
|
1470
|
+
id: Ht,
|
|
1471
|
+
onFillData: (i, r, s) => s === we.COPY || s === we.ONLY_FORMAT || s === we.SERIES ? e(i, s) : t()
|
|
1428
1472
|
};
|
|
1429
1473
|
this.disposeWithMe(this._autoFillService.addHook(n));
|
|
1430
1474
|
}
|
|
1431
1475
|
};
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
],
|
|
1436
|
-
var
|
|
1437
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1438
|
-
(
|
|
1476
|
+
tt = $i([
|
|
1477
|
+
fn(0, Vr),
|
|
1478
|
+
fn(1, y(dt))
|
|
1479
|
+
], tt);
|
|
1480
|
+
var Bi = Object.getOwnPropertyDescriptor, Fi = (t, e, n, i) => {
|
|
1481
|
+
for (var r = i > 1 ? void 0 : i ? Bi(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1482
|
+
(o = t[s]) && (r = o(r) || r);
|
|
1439
1483
|
return r;
|
|
1440
|
-
},
|
|
1441
|
-
let
|
|
1484
|
+
}, Et = (t, e) => (n, i) => e(n, i, t);
|
|
1485
|
+
let nt = class extends Y {
|
|
1442
1486
|
constructor(t, e, n) {
|
|
1443
1487
|
super(), this._localeService = t, this._commandService = e, this._sheetPermissionCheckController = n, this._commandExecutedListener();
|
|
1444
1488
|
}
|
|
1445
1489
|
_commandExecutedListener() {
|
|
1446
1490
|
this.disposeWithMe(
|
|
1447
1491
|
this._commandService.beforeCommandExecuted((t) => {
|
|
1448
|
-
t.id ===
|
|
1449
|
-
workbookTypes: [
|
|
1450
|
-
rangeTypes: [
|
|
1451
|
-
worksheetTypes: [
|
|
1492
|
+
t.id === Bn.id && (this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
1493
|
+
workbookTypes: [Nt],
|
|
1494
|
+
rangeTypes: [Tt],
|
|
1495
|
+
worksheetTypes: [Ot, Pn, xt]
|
|
1452
1496
|
}) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.hyperLinkErr")));
|
|
1453
1497
|
})
|
|
1454
1498
|
);
|
|
1455
1499
|
}
|
|
1456
1500
|
};
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
],
|
|
1462
|
-
var
|
|
1463
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1464
|
-
(
|
|
1501
|
+
nt = Fi([
|
|
1502
|
+
Et(0, y(ct)),
|
|
1503
|
+
Et(1, ne),
|
|
1504
|
+
Et(2, y(Ln))
|
|
1505
|
+
], nt);
|
|
1506
|
+
var ji = Object.getOwnPropertyDescriptor, Wi = (t, e, n, i) => {
|
|
1507
|
+
for (var r = i > 1 ? void 0 : i ? ji(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1508
|
+
(o = t[s]) && (r = o(r) || r);
|
|
1465
1509
|
return r;
|
|
1466
|
-
},
|
|
1467
|
-
let
|
|
1468
|
-
constructor(t, e, n, i, r,
|
|
1469
|
-
super(), this._hoverManagerService = t, this._sheetsHyperLinkPopupService = e, this._renderManagerService = n, this._permissionService = i, this._sheetPermissionCheckController = r, this._commandService =
|
|
1510
|
+
}, W = (t, e) => (n, i) => e(n, i, t);
|
|
1511
|
+
let rt = class extends Y {
|
|
1512
|
+
constructor(t, e, n, i, r, s, o, c, u, p) {
|
|
1513
|
+
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();
|
|
1470
1514
|
}
|
|
1471
1515
|
_getLinkPermission(t) {
|
|
1472
|
-
const { unitId: e, subUnitId: n, row: i, col: r } = t,
|
|
1473
|
-
if (!(
|
|
1516
|
+
const { unitId: e, subUnitId: n, row: i, col: r } = t, s = this._univerInstanceService.getUnit(e, k.UNIVER_SHEET);
|
|
1517
|
+
if (!(s == null ? void 0 : s.getSheetBySheetId(n)))
|
|
1474
1518
|
return {
|
|
1475
1519
|
viewPermission: !1,
|
|
1476
1520
|
editPermission: !1,
|
|
1477
1521
|
copyPermission: !1
|
|
1478
1522
|
};
|
|
1479
1523
|
const c = this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
1480
|
-
workbookTypes: [
|
|
1481
|
-
worksheetTypes: [
|
|
1482
|
-
rangeTypes: [
|
|
1524
|
+
workbookTypes: [hr],
|
|
1525
|
+
worksheetTypes: [pr],
|
|
1526
|
+
rangeTypes: [dr]
|
|
1483
1527
|
}, [{ startRow: i, startColumn: r, endRow: i, endColumn: r }]), u = this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
1484
|
-
workbookTypes: [
|
|
1485
|
-
worksheetTypes: [
|
|
1486
|
-
rangeTypes: [
|
|
1487
|
-
}, [{ startRow: i, startColumn: r, endRow: i, endColumn: r }]), p = this._permissionService.composePermission([new
|
|
1528
|
+
workbookTypes: [Nt],
|
|
1529
|
+
worksheetTypes: [Ot, xt],
|
|
1530
|
+
rangeTypes: [Tt]
|
|
1531
|
+
}, [{ startRow: i, startColumn: r, endRow: i, endColumn: r }]), p = this._permissionService.composePermission([new gr(e).id, new vr(e, n).id]).every((l) => l.value);
|
|
1488
1532
|
return {
|
|
1489
1533
|
viewPermission: c,
|
|
1490
1534
|
editPermission: u,
|
|
@@ -1494,34 +1538,34 @@ let it = class extends z {
|
|
|
1494
1538
|
_initHoverListener() {
|
|
1495
1539
|
this.disposeWithMe(
|
|
1496
1540
|
// hover over not editing cell
|
|
1497
|
-
this._hoverManagerService.currentRichText$.pipe(
|
|
1498
|
-
var T,
|
|
1541
|
+
this._hoverManagerService.currentRichText$.pipe(We(200)).subscribe((t) => {
|
|
1542
|
+
var T, P;
|
|
1499
1543
|
if (!t) {
|
|
1500
1544
|
this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
1501
1545
|
return;
|
|
1502
1546
|
}
|
|
1503
|
-
const { unitId: e, subUnitId: n, row: i, col: r } = t,
|
|
1504
|
-
if (!
|
|
1547
|
+
const { unitId: e, subUnitId: n, row: i, col: r } = t, s = this._renderManagerService.getRenderById(e);
|
|
1548
|
+
if (!s)
|
|
1505
1549
|
return;
|
|
1506
|
-
const
|
|
1550
|
+
const o = this._univerInstanceService.getUnit(e, k.UNIVER_SHEET), c = o == null ? void 0 : o.getSheetBySheetId(n);
|
|
1507
1551
|
if (!c)
|
|
1508
1552
|
return;
|
|
1509
|
-
if (!
|
|
1510
|
-
this._sheetsHyperLinkPopupService.hideCurrentPopup(
|
|
1553
|
+
if (!s.with(Br).active) {
|
|
1554
|
+
this._sheetsHyperLinkPopupService.hideCurrentPopup(v.VIEWING);
|
|
1511
1555
|
return;
|
|
1512
1556
|
}
|
|
1513
|
-
const p = (T =
|
|
1557
|
+
const p = (T = s == null ? void 0 : s.with(cn).getSkeletonParam(n)) == null ? void 0 : T.skeleton, l = r, g = i;
|
|
1514
1558
|
let d = g, _ = l;
|
|
1515
|
-
p && p.overflowCache.forValue((A, D,
|
|
1516
|
-
|
|
1559
|
+
p && p.overflowCache.forValue((A, D, z) => {
|
|
1560
|
+
Ie.contains(z, { startColumn: l, endColumn: l, startRow: g, endRow: g }) && (d = A, _ = D);
|
|
1517
1561
|
});
|
|
1518
|
-
const { viewPermission: S, editPermission: f, copyPermission:
|
|
1562
|
+
const { viewPermission: S, editPermission: f, copyPermission: b } = this._getLinkPermission(t);
|
|
1519
1563
|
if (!S) {
|
|
1520
1564
|
this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
1521
1565
|
return;
|
|
1522
1566
|
}
|
|
1523
|
-
const a = c.getCellStyleOnly(d, _),
|
|
1524
|
-
if (!
|
|
1567
|
+
const a = c.getCellStyleOnly(d, _), w = o.getStyles().getStyleByCell(a), M = (P = w == null ? void 0 : w.tr) == null ? void 0 : P.a;
|
|
1568
|
+
if (!M && !t.customRange) {
|
|
1525
1569
|
this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
1526
1570
|
return;
|
|
1527
1571
|
}
|
|
@@ -1529,13 +1573,13 @@ let it = class extends z {
|
|
|
1529
1573
|
row: d,
|
|
1530
1574
|
col: _,
|
|
1531
1575
|
editPermission: f,
|
|
1532
|
-
copyPermission:
|
|
1576
|
+
copyPermission: b,
|
|
1533
1577
|
customRange: t.customRange,
|
|
1534
1578
|
customRangeRect: t.rect,
|
|
1535
|
-
type:
|
|
1579
|
+
type: v.VIEWING,
|
|
1536
1580
|
unitId: e,
|
|
1537
1581
|
subUnitId: n,
|
|
1538
|
-
showAll: !!
|
|
1582
|
+
showAll: !!M
|
|
1539
1583
|
});
|
|
1540
1584
|
})
|
|
1541
1585
|
);
|
|
@@ -1543,32 +1587,32 @@ let it = class extends z {
|
|
|
1543
1587
|
_initHoverEditingListener() {
|
|
1544
1588
|
let t = null;
|
|
1545
1589
|
this.disposeWithMe(
|
|
1546
|
-
this._editorBridgeService.currentEditCellState$.pipe(
|
|
1547
|
-
if (!n || n.editorUnitId !==
|
|
1590
|
+
this._editorBridgeService.currentEditCellState$.pipe(Me((e) => this._editorBridgeService.visible$.pipe(Ut((n) => ({ visible: n, state: e }))))).subscribe(({ visible: e, state: n }) => {
|
|
1591
|
+
if (!n || n.editorUnitId !== Ce)
|
|
1548
1592
|
return;
|
|
1549
1593
|
if (!e.visible) {
|
|
1550
|
-
t == null || t.unsubscribe(), this._sheetsHyperLinkPopupService.hideCurrentPopup(
|
|
1594
|
+
t == null || t.unsubscribe(), this._sheetsHyperLinkPopupService.hideCurrentPopup(v.EDITING), this._sheetsHyperLinkPopupService.endEditing(v.EDITING);
|
|
1551
1595
|
return;
|
|
1552
1596
|
}
|
|
1553
|
-
const { editorUnitId: i, unitId: r, sheetId:
|
|
1597
|
+
const { editorUnitId: i, unitId: r, sheetId: s, row: o, column: c } = n, u = this._renderManagerService.getRenderById(i);
|
|
1554
1598
|
if (!u)
|
|
1555
1599
|
return;
|
|
1556
|
-
const { editPermission: p, viewPermission: l, copyPermission: g } = this._getLinkPermission({ unitId: r, subUnitId:
|
|
1557
|
-
l && (t == null || t.unsubscribe(), t = d.hoverCustomRanges$.pipe(
|
|
1558
|
-
var
|
|
1559
|
-
const S = _.find((T) => T.range.rangeType ===
|
|
1600
|
+
const { editPermission: p, viewPermission: l, copyPermission: g } = this._getLinkPermission({ unitId: r, subUnitId: s, row: o, col: c }), d = u.with(pn);
|
|
1601
|
+
l && (t == null || t.unsubscribe(), t = d.hoverCustomRanges$.pipe(We(200)).subscribe((_) => {
|
|
1602
|
+
var w, M;
|
|
1603
|
+
const S = _.find((T) => T.range.rangeType === Ge.HYPERLINK);
|
|
1560
1604
|
if (!S) {
|
|
1561
1605
|
this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
1562
1606
|
return;
|
|
1563
1607
|
}
|
|
1564
1608
|
const f = S.rects[S.rects.length - 1];
|
|
1565
|
-
if (!((
|
|
1609
|
+
if (!((M = (w = this._renderManagerService.getRenderById(r)) == null ? void 0 : w.with(cn).getSkeletonParam(s)) == null ? void 0 : M.skeleton) || !f)
|
|
1566
1610
|
return;
|
|
1567
1611
|
const a = u.engine.getCanvasElement().getBoundingClientRect();
|
|
1568
1612
|
this._sheetsHyperLinkPopupService.showPopup({
|
|
1569
1613
|
unitId: r,
|
|
1570
|
-
subUnitId:
|
|
1571
|
-
row:
|
|
1614
|
+
subUnitId: s,
|
|
1615
|
+
row: o,
|
|
1572
1616
|
col: c,
|
|
1573
1617
|
customRange: S.range,
|
|
1574
1618
|
customRangeRect: {
|
|
@@ -1579,7 +1623,7 @@ let it = class extends z {
|
|
|
1579
1623
|
},
|
|
1580
1624
|
editPermission: p,
|
|
1581
1625
|
copyPermission: g,
|
|
1582
|
-
type:
|
|
1626
|
+
type: v.EDITING
|
|
1583
1627
|
});
|
|
1584
1628
|
}));
|
|
1585
1629
|
})
|
|
@@ -1590,67 +1634,67 @@ let it = class extends z {
|
|
|
1590
1634
|
_initZenEditor() {
|
|
1591
1635
|
this.disposeWithMe(
|
|
1592
1636
|
this._zenZoneService.visible$.subscribe((t) => {
|
|
1593
|
-
t ? (this._sheetsHyperLinkPopupService.hideCurrentPopup(
|
|
1637
|
+
t ? (this._sheetsHyperLinkPopupService.hideCurrentPopup(v.VIEWING), this._sheetsHyperLinkPopupService.hideCurrentPopup(v.EDITING), this._sheetsHyperLinkPopupService.endEditing(v.EDITING), this._sheetsHyperLinkPopupService.hideCurrentPopup(v.VIEWING)) : (this._sheetsHyperLinkPopupService.hideCurrentPopup(v.ZEN_EDITOR), this._sheetsHyperLinkPopupService.endEditing(v.ZEN_EDITOR));
|
|
1594
1638
|
})
|
|
1595
1639
|
), this.disposeWithMe(
|
|
1596
1640
|
this._univerInstanceService.focused$.pipe(
|
|
1597
|
-
|
|
1598
|
-
const e = t ===
|
|
1599
|
-
return e ? e.with(
|
|
1641
|
+
Me((t) => {
|
|
1642
|
+
const e = t === x ? this._renderManagerService.getRenderById(t) : null;
|
|
1643
|
+
return e ? e.with(pn).hoverCustomRanges$.pipe(We(200)) : new ai((n) => {
|
|
1600
1644
|
n.next(null);
|
|
1601
1645
|
});
|
|
1602
1646
|
})
|
|
1603
1647
|
).subscribe((t) => {
|
|
1604
|
-
const e = t == null ? void 0 : t.find((i) => i.range.rangeType ===
|
|
1648
|
+
const e = t == null ? void 0 : t.find((i) => i.range.rangeType === Ge.HYPERLINK), n = this._editorBridgeService.getEditCellState();
|
|
1605
1649
|
if (e && n) {
|
|
1606
|
-
const { unitId: i, sheetId: r, row:
|
|
1650
|
+
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 });
|
|
1607
1651
|
u && this._sheetsHyperLinkPopupService.showPopup({
|
|
1608
|
-
type:
|
|
1652
|
+
type: v.ZEN_EDITOR,
|
|
1609
1653
|
unitId: i,
|
|
1610
1654
|
subUnitId: r,
|
|
1611
|
-
row:
|
|
1612
|
-
col:
|
|
1655
|
+
row: s,
|
|
1656
|
+
col: o,
|
|
1613
1657
|
customRange: e.range,
|
|
1614
1658
|
editPermission: c,
|
|
1615
1659
|
copyPermission: p
|
|
1616
1660
|
});
|
|
1617
1661
|
} else
|
|
1618
|
-
this._sheetsHyperLinkPopupService.hideCurrentPopup(
|
|
1662
|
+
this._sheetsHyperLinkPopupService.hideCurrentPopup(v.ZEN_EDITOR);
|
|
1619
1663
|
})
|
|
1620
1664
|
);
|
|
1621
1665
|
}
|
|
1622
1666
|
_initTextSelectionListener() {
|
|
1623
1667
|
this.disposeWithMe(
|
|
1624
1668
|
this._textSelectionManagerService.textSelection$.subscribe((t) => {
|
|
1625
|
-
t && t.unitId ===
|
|
1669
|
+
t && t.unitId === Ce && this._sheetsHyperLinkPopupService.endEditing(v.EDITING);
|
|
1626
1670
|
})
|
|
1627
1671
|
);
|
|
1628
1672
|
}
|
|
1629
1673
|
_initCommandListener() {
|
|
1630
|
-
const t = [
|
|
1674
|
+
const t = [mr.id, fr.id, _r.id];
|
|
1631
1675
|
this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
|
|
1632
1676
|
t.includes(e.id) && this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
1633
1677
|
}));
|
|
1634
1678
|
}
|
|
1635
1679
|
};
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
],
|
|
1648
|
-
var
|
|
1649
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1650
|
-
(
|
|
1680
|
+
rt = Wi([
|
|
1681
|
+
W(0, y($r)),
|
|
1682
|
+
W(1, y(G)),
|
|
1683
|
+
W(2, y(He)),
|
|
1684
|
+
W(3, y(sr)),
|
|
1685
|
+
W(4, y(Ln)),
|
|
1686
|
+
W(5, ne),
|
|
1687
|
+
W(6, te),
|
|
1688
|
+
W(7, y(Ue)),
|
|
1689
|
+
W(8, K),
|
|
1690
|
+
W(9, pt)
|
|
1691
|
+
], rt);
|
|
1692
|
+
var Zi = Object.getOwnPropertyDescriptor, Fn = (t, e, n, i) => {
|
|
1693
|
+
for (var r = i > 1 ? void 0 : i ? Zi(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1694
|
+
(o = t[s]) && (r = o(r) || r);
|
|
1651
1695
|
return r;
|
|
1652
|
-
},
|
|
1653
|
-
let bt = class extends
|
|
1696
|
+
}, Lt = (t, e) => (n, i) => e(n, i, t);
|
|
1697
|
+
let bt = class extends Y {
|
|
1654
1698
|
constructor(t, e) {
|
|
1655
1699
|
super(), this._context = t, this._hyperLinkModel = e, this._initSkeletonChange();
|
|
1656
1700
|
}
|
|
@@ -1659,27 +1703,27 @@ let bt = class extends z {
|
|
|
1659
1703
|
var e;
|
|
1660
1704
|
(e = this._context.mainComponent) == null || e.makeForceDirty();
|
|
1661
1705
|
};
|
|
1662
|
-
this.disposeWithMe(this._hyperLinkModel.linkUpdate$.pipe(
|
|
1706
|
+
this.disposeWithMe(this._hyperLinkModel.linkUpdate$.pipe(We(16)).subscribe(() => {
|
|
1663
1707
|
t();
|
|
1664
1708
|
}));
|
|
1665
1709
|
}
|
|
1666
1710
|
};
|
|
1667
|
-
bt =
|
|
1668
|
-
|
|
1711
|
+
bt = Fn([
|
|
1712
|
+
Lt(1, y(dt))
|
|
1669
1713
|
], bt);
|
|
1670
|
-
let
|
|
1714
|
+
let it = class extends Y {
|
|
1671
1715
|
constructor(t, e) {
|
|
1672
1716
|
super(), this._sheetInterceptorService = t, this._hyperLinkModel = e, this._initViewModelIntercept();
|
|
1673
1717
|
}
|
|
1674
1718
|
_initViewModelIntercept() {
|
|
1675
1719
|
this.disposeWithMe(
|
|
1676
1720
|
this._sheetInterceptorService.intercept(
|
|
1677
|
-
|
|
1721
|
+
Cr.CELL_CONTENT,
|
|
1678
1722
|
{
|
|
1679
|
-
effect:
|
|
1723
|
+
effect: or.Value,
|
|
1680
1724
|
priority: 100,
|
|
1681
1725
|
handler: (t, e, n) => {
|
|
1682
|
-
const { row: i, col: r, unitId:
|
|
1726
|
+
const { row: i, col: r, unitId: s, subUnitId: o } = e, c = this._hyperLinkModel.getHyperLinkByLocation(s, o, i, r);
|
|
1683
1727
|
return n(c ? {
|
|
1684
1728
|
...t,
|
|
1685
1729
|
linkUrl: c.payload,
|
|
@@ -1691,83 +1735,83 @@ let ot = class extends z {
|
|
|
1691
1735
|
);
|
|
1692
1736
|
}
|
|
1693
1737
|
};
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
],
|
|
1698
|
-
const
|
|
1699
|
-
[
|
|
1700
|
-
[
|
|
1738
|
+
it = Fn([
|
|
1739
|
+
Lt(0, y(Sr)),
|
|
1740
|
+
Lt(1, y(dt))
|
|
1741
|
+
], it);
|
|
1742
|
+
const Gi = {
|
|
1743
|
+
[Xr.OTHERS]: {
|
|
1744
|
+
[ae.id]: {
|
|
1701
1745
|
order: 2,
|
|
1702
|
-
menuItemFactory:
|
|
1746
|
+
menuItemFactory: Di
|
|
1703
1747
|
},
|
|
1704
|
-
[
|
|
1748
|
+
[Qe(ae.id)]: {
|
|
1705
1749
|
order: 2,
|
|
1706
|
-
menuItemFactory:
|
|
1750
|
+
menuItemFactory: Vi
|
|
1707
1751
|
}
|
|
1708
1752
|
},
|
|
1709
|
-
[
|
|
1710
|
-
[
|
|
1753
|
+
[Yr.MAIN_AREA]: {
|
|
1754
|
+
[zr.OTHERS]: {
|
|
1711
1755
|
order: 1,
|
|
1712
|
-
[
|
|
1756
|
+
[ae.id]: {
|
|
1713
1757
|
order: 0,
|
|
1714
|
-
menuItemFactory:
|
|
1758
|
+
menuItemFactory: Ui
|
|
1715
1759
|
},
|
|
1716
|
-
[
|
|
1760
|
+
[Qe(ae.id)]: {
|
|
1717
1761
|
order: 0,
|
|
1718
|
-
menuItemFactory:
|
|
1762
|
+
menuItemFactory: Hi
|
|
1719
1763
|
}
|
|
1720
1764
|
}
|
|
1721
1765
|
}
|
|
1722
1766
|
};
|
|
1723
|
-
var
|
|
1724
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1725
|
-
(
|
|
1767
|
+
var Ki = Object.getOwnPropertyDescriptor, Yi = (t, e, n, i) => {
|
|
1768
|
+
for (var r = i > 1 ? void 0 : i ? Ki(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1769
|
+
(o = t[s]) && (r = o(r) || r);
|
|
1726
1770
|
return r;
|
|
1727
|
-
},
|
|
1728
|
-
let st = class extends
|
|
1771
|
+
}, ke = (t, e) => (n, i) => e(n, i, t);
|
|
1772
|
+
let st = class extends Y {
|
|
1729
1773
|
constructor(t, e, n, i, r) {
|
|
1730
1774
|
super(), this._componentManager = t, this._commandService = e, this._menuManagerService = n, this._injector = i, this._shortcutService = r, this._initComponents(), this._initCommands(), this._initMenus(), this._initShortCut();
|
|
1731
1775
|
}
|
|
1732
1776
|
_initComponents() {
|
|
1733
1777
|
[
|
|
1734
|
-
[qe, qe.componentKey],
|
|
1735
1778
|
[Xe, Xe.componentKey],
|
|
1736
|
-
[
|
|
1779
|
+
[ze, ze.componentKey],
|
|
1780
|
+
[Dt, "LinkSingle"]
|
|
1737
1781
|
].forEach(([t, e]) => {
|
|
1738
1782
|
this._componentManager.register(e, t);
|
|
1739
1783
|
});
|
|
1740
1784
|
}
|
|
1741
1785
|
_initCommands() {
|
|
1742
1786
|
[
|
|
1787
|
+
At,
|
|
1788
|
+
qe,
|
|
1743
1789
|
$t,
|
|
1744
|
-
|
|
1745
|
-
Bt,
|
|
1746
|
-
ce
|
|
1790
|
+
ae
|
|
1747
1791
|
].forEach((t) => {
|
|
1748
1792
|
this._commandService.registerCommand(t);
|
|
1749
1793
|
});
|
|
1750
1794
|
}
|
|
1751
1795
|
_initMenus() {
|
|
1752
|
-
this._menuManagerService.mergeMenu(
|
|
1796
|
+
this._menuManagerService.mergeMenu(Gi);
|
|
1753
1797
|
}
|
|
1754
1798
|
_initShortCut() {
|
|
1755
|
-
this._shortcutService.registerShortcut(
|
|
1799
|
+
this._shortcutService.registerShortcut(Bn);
|
|
1756
1800
|
}
|
|
1757
1801
|
};
|
|
1758
|
-
st =
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1802
|
+
st = Yi([
|
|
1803
|
+
ke(0, y(qr)),
|
|
1804
|
+
ke(1, ne),
|
|
1805
|
+
ke(2, Jr),
|
|
1806
|
+
ke(3, y(ut)),
|
|
1807
|
+
ke(4, y(Qr))
|
|
1764
1808
|
], st);
|
|
1765
|
-
var
|
|
1766
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1767
|
-
(
|
|
1809
|
+
var zi = Object.getOwnPropertyDescriptor, Xi = (t, e, n, i) => {
|
|
1810
|
+
for (var r = i > 1 ? void 0 : i ? zi(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1811
|
+
(o = t[s]) && (r = o(r) || r);
|
|
1768
1812
|
return r;
|
|
1769
|
-
},
|
|
1770
|
-
let
|
|
1813
|
+
}, _n = (t, e) => (n, i) => e(n, i, t);
|
|
1814
|
+
let ot = class extends Y {
|
|
1771
1815
|
constructor(t, e) {
|
|
1772
1816
|
super(), this._parserService = t, this._resolverService = e, this._handleInitUrl();
|
|
1773
1817
|
}
|
|
@@ -1779,61 +1823,61 @@ let at = class extends z {
|
|
|
1779
1823
|
}
|
|
1780
1824
|
}
|
|
1781
1825
|
};
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
],
|
|
1786
|
-
var
|
|
1787
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1788
|
-
(
|
|
1826
|
+
ot = Xi([
|
|
1827
|
+
_n(0, y(Mt)),
|
|
1828
|
+
_n(1, y(ce))
|
|
1829
|
+
], ot);
|
|
1830
|
+
var qi = Object.defineProperty, Ji = Object.getOwnPropertyDescriptor, Qi = (t, e, n) => e in t ? qi(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, es = (t, e, n, i) => {
|
|
1831
|
+
for (var r = i > 1 ? void 0 : i ? Ji(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1832
|
+
(o = t[s]) && (r = o(r) || r);
|
|
1789
1833
|
return r;
|
|
1790
|
-
},
|
|
1791
|
-
let
|
|
1792
|
-
constructor(t =
|
|
1834
|
+
}, Sn = (t, e) => (n, i) => e(n, i, t), jn = (t, e, n) => Qi(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1835
|
+
let at = class extends cr {
|
|
1836
|
+
constructor(t = gn, e, n) {
|
|
1793
1837
|
super(), this._config = t, this._injector = e, this._configService = n;
|
|
1794
|
-
const { menu: i, ...r } =
|
|
1838
|
+
const { menu: i, ...r } = ur(
|
|
1795
1839
|
{},
|
|
1796
|
-
|
|
1840
|
+
gn,
|
|
1797
1841
|
this._config
|
|
1798
1842
|
);
|
|
1799
|
-
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(
|
|
1843
|
+
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(Nn, r);
|
|
1800
1844
|
}
|
|
1801
1845
|
onStarting() {
|
|
1802
1846
|
[
|
|
1803
|
-
[
|
|
1804
|
-
[
|
|
1805
|
-
[
|
|
1806
|
-
[ot],
|
|
1847
|
+
[ce],
|
|
1848
|
+
[G],
|
|
1849
|
+
[Mn],
|
|
1807
1850
|
[it],
|
|
1851
|
+
[rt],
|
|
1808
1852
|
[st],
|
|
1853
|
+
[tt],
|
|
1854
|
+
[Ye],
|
|
1809
1855
|
[nt],
|
|
1810
|
-
[
|
|
1811
|
-
|
|
1812
|
-
[at]
|
|
1813
|
-
].forEach((e) => this._injector.add(e)), this._injector.get(ot);
|
|
1856
|
+
[ot]
|
|
1857
|
+
].forEach((e) => this._injector.add(e)), this._injector.get(it);
|
|
1814
1858
|
}
|
|
1815
1859
|
onReady() {
|
|
1816
|
-
this._injector.get(
|
|
1860
|
+
this._injector.get(He).registerRenderModule(k.UNIVER_SHEET, [bt]), this._injector.get(tt), this._injector.get(Ye), this._injector.get(st);
|
|
1817
1861
|
}
|
|
1818
1862
|
onRendered() {
|
|
1819
|
-
this._injector.get(
|
|
1863
|
+
this._injector.get(nt), this._injector.get(ot), this._injector.get(rt);
|
|
1820
1864
|
}
|
|
1821
1865
|
};
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
],
|
|
1866
|
+
jn(at, "pluginName", Ht);
|
|
1867
|
+
jn(at, "type", k.UNIVER_SHEET);
|
|
1868
|
+
at = es([
|
|
1869
|
+
ar(wr, ri),
|
|
1870
|
+
Sn(1, y(ut)),
|
|
1871
|
+
Sn(2, Cn)
|
|
1872
|
+
], at);
|
|
1829
1873
|
export {
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1874
|
+
qe as CloseHyperLinkPopupOperation,
|
|
1875
|
+
$t as InsertHyperLinkOperation,
|
|
1876
|
+
Bn as InsertLinkShortcut,
|
|
1877
|
+
At as OpenHyperLinkEditPanelOperation,
|
|
1878
|
+
Ye as SheetsHyperLinkCopyPasteController,
|
|
1879
|
+
G as SheetsHyperLinkPopupService,
|
|
1880
|
+
ce as SheetsHyperLinkResolverService,
|
|
1881
|
+
Mn as SheetsHyperLinkSidePanelService,
|
|
1882
|
+
at as UniverSheetsHyperLinkUIPlugin
|
|
1839
1883
|
};
|