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