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