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