@univerjs/sheets-hyper-link-ui 0.4.0-alpha.1 → 0.4.0-experimental.20241017-da434a2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +63 -39
- package/lib/types/commands/commands/add-hyper-link.command.d.ts +1 -1
- package/lib/types/commands/commands/update-hyper-link.command.d.ts +1 -1
- package/lib/types/services/popup.service.d.ts +3 -0
- package/lib/umd/index.js +2 -2
- package/package.json +13 -12
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
|
@@ -2,18 +2,19 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
|
|
3
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
|
|
5
|
-
import { Tools, Inject, LocaleService, UniverInstanceType, isValidRange, IUniverInstanceService, ICommandService, IConfigService, RANGE_TYPE, Rectangle, Injector, Disposable, Range, ObjectMatrix, CommandType, IUndoRedoService, BuildTextUtils, DataStreamTreeTokenType, CustomRangeType, TextX, CellValueType, sequenceExecuteAsync, generateRandomId, getBodySlice, useDependency, IContextService, ThemeService, ColorKit, DisposableCollection,
|
|
5
|
+
import { Tools, Inject, LocaleService, UniverInstanceType, isValidRange, IUniverInstanceService, ICommandService, IConfigService, RANGE_TYPE, Rectangle, Injector, Disposable, Range, ObjectMatrix, CommandType, IUndoRedoService, BuildTextUtils, DataStreamTreeTokenType, CustomRangeType, TextX, CellValueType, sequenceExecuteAsync, generateRandomId, getBodySlice, useDependency, IContextService, ThemeService, ColorKit, DisposableCollection, FOCUSING_SHEET, DOCS_ZEN_EDITOR_UNIT_ID_KEY, sequenceExecute, useObservable as useObservable$1, DataValidationType, IPermissionService, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, InterceptorEffectEnum, DependentOn, Plugin } from "@univerjs/core";
|
|
6
6
|
import { SheetHyperLinkType, ERROR_RANGE, HyperLinkModel, RemoveHyperLinkMutation, AddHyperLinkMutation, UniverSheetsHyperLinkPlugin } from "@univerjs/sheets-hyper-link";
|
|
7
|
-
import { ScrollToRangeOperation, COPY_TYPE, virtualizeDiscreteRanges, rangeToDiscreteRange, PREDEFINED_HOOK_NAME, getRepeatRange, ISheetClipboardService,
|
|
7
|
+
import { ScrollToRangeOperation, COPY_TYPE, virtualizeDiscreteRanges, rangeToDiscreteRange, PREDEFINED_HOOK_NAME, getRepeatRange, ISheetClipboardService, IEditorBridgeService, SheetSkeletonManagerService, IMarkSelectionService, SheetCanvasPopManagerService, getEditingCustomRangePosition, getCustomRangePosition, whenSheetEditorFocused, getCurrentRangeDisable$, IAutoFillService, APPLY_TYPE, getAutoFillRepeatRange, SheetPermissionInterceptorBaseController, HoverManagerService, HoverRenderController } from "@univerjs/sheets-ui";
|
|
8
8
|
import { MessageType, FormLayout, Input, Select, Button, Tooltip } from "@univerjs/design";
|
|
9
9
|
import { deserializeRangeWithSheet, serializeRangeWithSheet, serializeRange, IDefinedNamesService, serializeRangeToRefString } from "@univerjs/engine-formula";
|
|
10
10
|
import { SetSelectionsOperation, SetWorksheetActiveOperation, SetRangeValuesMutation, SetRangeValuesUndoMutationFactory, SheetsSelectionsService, getSheetCommandTarget, WorkbookEditablePermission, WorksheetEditPermission, WorksheetSetCellValuePermission, WorksheetInsertHyperlinkPermission, RangeProtectionPermissionEditPoint, WorkbookViewPermission, WorksheetViewPermission, RangeProtectionPermissionViewPoint, WorkbookCopyPermission, WorksheetCopyPermission, ClearSelectionContentCommand, ClearSelectionAllCommand, ClearSelectionFormatCommand, SheetInterceptorService, RemoveSheetCommand, INTERCEPTOR_POINT, RefRangeService, handleDefaultRangeChangeWithEffectRefCommands, SetRangeValuesCommand } from "@univerjs/sheets";
|
|
11
11
|
import { IMessageService, useObservable, IZenZoneService, useEvent, KeyCode, MenuItemType, MenuPosition, MenuGroup, MetaKeys, getMenuHiddenObservable, RibbonStartGroup, ContextMenuPosition, ContextMenuGroup, ComponentManager, IShortcutService, IMenuManagerService } from "@univerjs/ui";
|
|
12
12
|
import { DocSelectionManagerService } from "@univerjs/docs";
|
|
13
13
|
import { Subject, BehaviorSubject, map, mergeMap, Observable, debounceTime } from "rxjs";
|
|
14
|
-
import { addCustomRangeBySelectionFactory, replaceSelectionFactory, DocSelectionRenderService,
|
|
14
|
+
import { addCustomRangeBySelectionFactory, replaceSelectionFactory, DocSelectionRenderService, DocBackScrollRenderController, deleteCustomRangeFactory, DocCanvasPopManagerService, IEditorService, IRangeSelectorService, DocEventManagerService, UniverDocsUIPlugin } from "@univerjs/docs-ui";
|
|
15
15
|
import require$$0, { useState, useMemo, useRef, useEffect, forwardRef, createElement } from "react";
|
|
16
16
|
import { IRenderManagerService } from "@univerjs/engine-render";
|
|
17
|
+
import { RangeSelector } from "@univerjs/sheets-formula-ui";
|
|
17
18
|
function isLegalLink(link) {
|
|
18
19
|
return Tools.isLegalUrl(link);
|
|
19
20
|
}
|
|
@@ -421,7 +422,7 @@ const AddHyperLinkCommand = {
|
|
|
421
422
|
var _a15;
|
|
422
423
|
if (!params)
|
|
423
424
|
return !1;
|
|
424
|
-
const commandService = accessor.get(ICommandService), undoRedoService = accessor.get(IUndoRedoService), renderManagerService = accessor.get(IRenderManagerService), univerInstanceService = accessor.get(IUniverInstanceService), hyperLinkModel = accessor.get(HyperLinkModel), { unitId, subUnitId, link } = params, workbook = univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET), currentRender = renderManagerService.getRenderById(unitId);
|
|
425
|
+
const commandService = accessor.get(ICommandService), undoRedoService = accessor.get(IUndoRedoService), renderManagerService = accessor.get(IRenderManagerService), univerInstanceService = accessor.get(IUniverInstanceService), hyperLinkModel = accessor.get(HyperLinkModel), editorBridgeService = accessor.get(IEditorBridgeService), { unitId, subUnitId, link } = params, workbook = univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET), currentRender = renderManagerService.getRenderById(unitId);
|
|
425
426
|
if (!currentRender || !workbook)
|
|
426
427
|
return !1;
|
|
427
428
|
const worksheet = workbook == null ? void 0 : workbook.getSheetBySheetId(subUnitId), skeleton = (_a15 = currentRender.with(SheetSkeletonManagerService).getCurrent()) == null ? void 0 : _a15.skeleton;
|
|
@@ -462,18 +463,18 @@ const AddHyperLinkCommand = {
|
|
|
462
463
|
}
|
|
463
464
|
}), !textX)
|
|
464
465
|
return !1;
|
|
465
|
-
const newBody = TextX.apply(body, textX.serialize()),
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
466
|
+
const newBody = TextX.apply(body, textX.serialize()), newCellData = {
|
|
467
|
+
p: {
|
|
468
|
+
...snapshot,
|
|
469
|
+
body: newBody
|
|
470
|
+
},
|
|
471
|
+
t: CellValueType.STRING
|
|
472
|
+
}, finalCellData = await editorBridgeService.beforeSetRangeValue(workbook, worksheet, row, column, newCellData), redoParams = {
|
|
469
473
|
unitId,
|
|
470
474
|
subUnitId,
|
|
471
475
|
cellValue: {
|
|
472
476
|
[link.row]: {
|
|
473
|
-
[link.column]:
|
|
474
|
-
p: rangeValue,
|
|
475
|
-
t: CellValueType.STRING
|
|
476
|
-
}
|
|
477
|
+
[link.column]: finalCellData
|
|
477
478
|
}
|
|
478
479
|
}
|
|
479
480
|
}, redo = {
|
|
@@ -531,7 +532,7 @@ const AddHyperLinkCommand = {
|
|
|
531
532
|
var _a15, _b, _c, _d;
|
|
532
533
|
if (!params)
|
|
533
534
|
return !1;
|
|
534
|
-
const commandService = accessor.get(ICommandService), undoRedoService = accessor.get(IUndoRedoService), renderManagerService = accessor.get(IRenderManagerService), univerInstanceService = accessor.get(IUniverInstanceService), hyperLinkModel = accessor.get(HyperLinkModel), { unitId, subUnitId, payload: link, row, column, id } = params, workbook = univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET), currentRender = renderManagerService.getRenderById(unitId);
|
|
535
|
+
const commandService = accessor.get(ICommandService), undoRedoService = accessor.get(IUndoRedoService), renderManagerService = accessor.get(IRenderManagerService), univerInstanceService = accessor.get(IUniverInstanceService), hyperLinkModel = accessor.get(HyperLinkModel), editorBridgeService = accessor.get(IEditorBridgeService), { unitId, subUnitId, payload: link, row, column, id } = params, workbook = univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET), currentRender = renderManagerService.getRenderById(unitId);
|
|
535
536
|
if (!currentRender || !workbook)
|
|
536
537
|
return !1;
|
|
537
538
|
const worksheet = workbook == null ? void 0 : workbook.getSheetBySheetId(subUnitId), skeleton = (_a15 = currentRender.with(SheetSkeletonManagerService).getCurrent()) == null ? void 0 : _a15.skeleton;
|
|
@@ -572,20 +573,20 @@ const AddHyperLinkCommand = {
|
|
|
572
573
|
});
|
|
573
574
|
if (!replaceSelection)
|
|
574
575
|
return !1;
|
|
575
|
-
const newBody = TextX.apply(Tools.deepClone(snapshot.body), replaceSelection.textX.serialize()),
|
|
576
|
+
const newBody = TextX.apply(Tools.deepClone(snapshot.body), replaceSelection.textX.serialize()), newCellData = {
|
|
577
|
+
p: {
|
|
578
|
+
...snapshot,
|
|
579
|
+
body: newBody
|
|
580
|
+
},
|
|
581
|
+
t: CellValueType.STRING
|
|
582
|
+
}, finalCellData = await editorBridgeService.beforeSetRangeValue(workbook, worksheet, row, column, newCellData), redo = {
|
|
576
583
|
id: SetRangeValuesMutation.id,
|
|
577
584
|
params: {
|
|
578
585
|
unitId,
|
|
579
586
|
subUnitId,
|
|
580
587
|
cellValue: {
|
|
581
588
|
[row]: {
|
|
582
|
-
[column]:
|
|
583
|
-
p: {
|
|
584
|
-
...snapshot,
|
|
585
|
-
body: newBody
|
|
586
|
-
},
|
|
587
|
-
t: CellValueType.STRING
|
|
588
|
-
}
|
|
589
|
+
[column]: finalCellData
|
|
589
590
|
}
|
|
590
591
|
}
|
|
591
592
|
}
|
|
@@ -687,11 +688,13 @@ const cellLinkEdit = "univer-cell-link-edit", cellLinkEditButtons = "univer-cell
|
|
|
687
688
|
cellLinkEditButtons
|
|
688
689
|
}, CellLinkEdit = /* @__PURE__ */ __name(() => {
|
|
689
690
|
var _a15;
|
|
690
|
-
const [id, setId] = useState(""), [hide, setHide] = useState(!1), [display, setDisplay] = useState(""), [showLabel, setShowLabel] = useState(!0), [type, setType] = useState(SheetHyperLinkType.URL), [payload, setPayload] = useState(""), localeService = useDependency(LocaleService), definedNameService = useDependency(IDefinedNamesService), editorBridgeService = useDependency(IEditorBridgeService), univerInstanceService = useDependency(IUniverInstanceService), popupService = useDependency(SheetsHyperLinkPopupService), editing = useObservable(popupService.currentEditing$), resolverService = useDependency(SheetsHyperLinkResolverService), commandService = useDependency(ICommandService), sidePanelService = useDependency(SheetsHyperLinkSidePanelService), sidePanelOptions = useMemo(() => sidePanelService.getOptions(), [sidePanelService]), zenZoneService = useDependency(IZenZoneService), renderManagerService = useDependency(IRenderManagerService), markSelectionService = useDependency(IMarkSelectionService), textSelectionService = useDependency(DocSelectionManagerService), contextService = useDependency(IContextService), themeService = useDependency(ThemeService), docSelectionManagerService = useDependency(DocSelectionManagerService), customHyperLinkSidePanel = useMemo(() => {
|
|
691
|
+
const [id, setId] = useState(""), [hide, setHide] = useState(!1), [display, setDisplay] = useState(""), [showLabel, setShowLabel] = useState(!0), [type, setType] = useState(SheetHyperLinkType.URL), [payload, setPayload] = useState(""), localeService = useDependency(LocaleService), definedNameService = useDependency(IDefinedNamesService), editorBridgeService = useDependency(IEditorBridgeService), univerInstanceService = useDependency(IUniverInstanceService), popupService = useDependency(SheetsHyperLinkPopupService), editing = useObservable(popupService.currentEditing$), resolverService = useDependency(SheetsHyperLinkResolverService), commandService = useDependency(ICommandService), sidePanelService = useDependency(SheetsHyperLinkSidePanelService), sidePanelOptions = useMemo(() => sidePanelService.getOptions(), [sidePanelService]), zenZoneService = useDependency(IZenZoneService), renderManagerService = useDependency(IRenderManagerService), markSelectionService = useDependency(IMarkSelectionService), textSelectionService = useDependency(DocSelectionManagerService), contextService = useDependency(IContextService), themeService = useDependency(ThemeService), docSelectionManagerService = useDependency(DocSelectionManagerService), rangeSelectorActionsRef = useRef({}), customHyperLinkSidePanel = useMemo(() => {
|
|
691
692
|
if (!sidePanelService.isBuiltInLinkType(type))
|
|
692
693
|
return sidePanelService.getCustomHyperLink(type);
|
|
693
|
-
}, [sidePanelService, type]), [showError, setShowError] = useState(!1), setByPayload = useRef(!1);
|
|
694
|
+
}, [sidePanelService, type]), [showError, setShowError] = useState(!1), [isFocusRangeSelector, isFocusRangeSelectorSet] = useState(!1), setByPayload = useRef(!1), workbook = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET), subUnitId = (workbook == null ? void 0 : workbook.getActiveSheet().getSheetId()) || "";
|
|
694
695
|
useEffect(() => {
|
|
696
|
+
isFocusRangeSelectorSet(!1);
|
|
697
|
+
}, [subUnitId]), useEffect(() => {
|
|
695
698
|
var _a16, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
696
699
|
if ((editing == null ? void 0 : editing.row) !== void 0 && editing.col !== void 0) {
|
|
697
700
|
const { label, customRange, row, col } = editing;
|
|
@@ -801,7 +804,11 @@ const cellLinkEdit = "univer-cell-link-edit", cellLinkEditButtons = "univer-cell
|
|
|
801
804
|
return () => {
|
|
802
805
|
editorBridgeService.disableForceKeepVisible(), disposeCollection.dispose();
|
|
803
806
|
};
|
|
804
|
-
}, [editorBridgeService, renderManagerService])
|
|
807
|
+
}, [editorBridgeService, renderManagerService]), useEffect(() => (popupService.setIsKeepVisible(type === SheetHyperLinkType.RANGE), () => {
|
|
808
|
+
popupService.setIsKeepVisible(!1);
|
|
809
|
+
}), [type]), useEffect(() => () => {
|
|
810
|
+
zenZoneService.temporaryHidden && (zenZoneService.show(), contextService.setContextValue(FOCUSING_SHEET, !1));
|
|
811
|
+
}, [contextService, zenZoneService]);
|
|
805
812
|
const linkTypeOptions = [
|
|
806
813
|
{
|
|
807
814
|
label: localeService.t("hyperLink.form.link"),
|
|
@@ -820,7 +827,7 @@ const cellLinkEdit = "univer-cell-link-edit", cellLinkEditButtons = "univer-cell
|
|
|
820
827
|
value: SheetHyperLinkType.DEFINE_NAME
|
|
821
828
|
},
|
|
822
829
|
...sidePanelOptions
|
|
823
|
-
]
|
|
830
|
+
];
|
|
824
831
|
if (!workbook)
|
|
825
832
|
return;
|
|
826
833
|
const hiddens = workbook.getHiddenWorksheets(), sheetsOption = workbook.getSheets().map((sheet) => ({ label: sheet.getName(), value: sheet.getSheetId() })).filter((opt) => hiddens.indexOf(opt.value) === -1), definedNames = Object.values((_a15 = definedNameService.getDefinedNameMap(workbook.getUnitId())) != null ? _a15 : {}).map((value) => ({
|
|
@@ -835,9 +842,9 @@ const cellLinkEdit = "univer-cell-link-edit", cellLinkEditButtons = "univer-cell
|
|
|
835
842
|
return `#gid=${worksheet.getSheetId()}&range=${serializeRange(info.range)}`;
|
|
836
843
|
}
|
|
837
844
|
return `#${type2}=${payload2}`;
|
|
838
|
-
}, "formatUrl"), handleRangeChange = useEvent((
|
|
845
|
+
}, "formatUrl"), handleRangeChange = useEvent((rangeText) => {
|
|
839
846
|
var _a16;
|
|
840
|
-
const range =
|
|
847
|
+
const range = rangeText.split(",").map(deserializeRangeWithSheet)[0];
|
|
841
848
|
if (!range || !isValidRange(range.range))
|
|
842
849
|
return;
|
|
843
850
|
range.sheetName || (range.sheetName = ((_a16 = workbook.getActiveSheet()) == null ? void 0 : _a16.getName()) || "");
|
|
@@ -894,8 +901,14 @@ const cellLinkEdit = "univer-cell-link-edit", cellLinkEditButtons = "univer-cell
|
|
|
894
901
|
});
|
|
895
902
|
}
|
|
896
903
|
commandService.executeCommand(CloseHyperLinkPopupOperation.id);
|
|
897
|
-
}, "handleSubmit")
|
|
898
|
-
|
|
904
|
+
}, "handleSubmit"), handlePanelClick = /* @__PURE__ */ __name((e) => {
|
|
905
|
+
var _a16;
|
|
906
|
+
if (type !== SheetHyperLinkType.RANGE)
|
|
907
|
+
return;
|
|
908
|
+
const handleOutClick = (_a16 = rangeSelectorActionsRef.current) == null ? void 0 : _a16.handleOutClick;
|
|
909
|
+
handleOutClick && handleOutClick(e, isFocusRangeSelectorSet);
|
|
910
|
+
}, "handlePanelClick");
|
|
911
|
+
return editing ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1.cellLinkEdit, style: { display: hide ? "none" : "block" }, onClick: handlePanelClick, children: [
|
|
899
912
|
showLabel ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
900
913
|
FormLayout,
|
|
901
914
|
{
|
|
@@ -950,13 +963,18 @@ const cellLinkEdit = "univer-cell-link-edit", cellLinkEditButtons = "univer-cell
|
|
|
950
963
|
type === SheetHyperLinkType.RANGE && /* @__PURE__ */ jsxRuntimeExports.jsx(FormLayout, { error: showError && !payload ? localeService.t("hyperLink.form.inputError") : "", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
951
964
|
RangeSelector,
|
|
952
965
|
{
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
966
|
+
unitId: workbook.getUnitId(),
|
|
967
|
+
subUnitId,
|
|
968
|
+
isOnlyOneRange: !0,
|
|
969
|
+
isSupportAcrossSheet: !0,
|
|
970
|
+
initValue: payloadInitial,
|
|
957
971
|
onChange: handleRangeChange,
|
|
958
|
-
|
|
959
|
-
|
|
972
|
+
isFocus: isFocusRangeSelector,
|
|
973
|
+
onBlur: /* @__PURE__ */ __name(() => {
|
|
974
|
+
isFocusRangeSelectorSet(!1);
|
|
975
|
+
}, "onBlur"),
|
|
976
|
+
actions: rangeSelectorActionsRef.current,
|
|
977
|
+
onRangeSelectorDialogVisibleChange: /* @__PURE__ */ __name(async (visible) => {
|
|
960
978
|
var _a16, _b;
|
|
961
979
|
if (visible)
|
|
962
980
|
editing.type === HyperLinkEditSourceType.ZEN_EDITOR && (zenZoneService.hide(), contextService.setContextValue(FOCUSING_SHEET, !0)), editing.type !== HyperLinkEditSourceType.VIEWING && editorBridgeService.enableForceKeepVisible(), setHide(!0);
|
|
@@ -974,7 +992,7 @@ const cellLinkEdit = "univer-cell-link-edit", cellLinkEditButtons = "univer-cell
|
|
|
974
992
|
}
|
|
975
993
|
editorBridgeService.disableForceKeepVisible(), setHide(!1);
|
|
976
994
|
}
|
|
977
|
-
}, "
|
|
995
|
+
}, "onRangeSelectorDialogVisibleChange")
|
|
978
996
|
}
|
|
979
997
|
) }),
|
|
980
998
|
type === SheetHyperLinkType.SHEET && /* @__PURE__ */ jsxRuntimeExports.jsx(FormLayout, { error: showError && !payload ? localeService.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -1367,6 +1385,7 @@ let SheetsHyperLinkPopupService = (_a3 = class extends Disposable {
|
|
|
1367
1385
|
__publicField(this, "_currentEditingPopup", null);
|
|
1368
1386
|
__publicField(this, "_currentEditing$", new BehaviorSubject(null));
|
|
1369
1387
|
__publicField(this, "currentEditing$", this._currentEditing$.asObservable());
|
|
1388
|
+
__publicField(this, "_isKeepVisible", !1);
|
|
1370
1389
|
this._sheetCanvasPopManagerService = _sheetCanvasPopManagerService, this._injector = _injector, this._univerInstanceService = _univerInstanceService, this._editorBridgeService = _editorBridgeService, this._textSelectionManagerService = _textSelectionManagerService, this._docCanvasPopManagerService = _docCanvasPopManagerService, this._editorService = _editorService, this._rangeSelectorService = _rangeSelectorService, this._zenZoneService = _zenZoneService, this.disposeWithMe(() => {
|
|
1371
1390
|
this.hideCurrentPopup(), this.endEditing(), this._currentEditing$.complete(), this._currentPopup$.complete();
|
|
1372
1391
|
});
|
|
@@ -1377,6 +1396,12 @@ let SheetsHyperLinkPopupService = (_a3 = class extends Disposable {
|
|
|
1377
1396
|
get currentEditing() {
|
|
1378
1397
|
return this._currentEditing$.getValue();
|
|
1379
1398
|
}
|
|
1399
|
+
setIsKeepVisible(v) {
|
|
1400
|
+
this._isKeepVisible = v;
|
|
1401
|
+
}
|
|
1402
|
+
getIsKeepVisible() {
|
|
1403
|
+
return this._isKeepVisible;
|
|
1404
|
+
}
|
|
1380
1405
|
showPopup(location2) {
|
|
1381
1406
|
if (this._currentPopup && isEqualLink(location2, this._currentPopup) || (this.hideCurrentPopup(void 0, !0), location2.type !== HyperLinkEditSourceType.ZEN_EDITOR && this._zenZoneService.visible))
|
|
1382
1407
|
return;
|
|
@@ -1459,11 +1484,10 @@ let SheetsHyperLinkPopupService = (_a3 = class extends Disposable {
|
|
|
1459
1484
|
componentKey: CellLinkEdit.componentKey,
|
|
1460
1485
|
direction: "bottom",
|
|
1461
1486
|
onClickOutside: /* @__PURE__ */ __name(() => {
|
|
1462
|
-
|
|
1463
|
-
this._editorService.getFocusId() !== hyperLinkRangeSelectorId && (this._rangeSelectorService.getCurrentSelectorId() === hyperLinkRangeSelectorId && this._rangeSelectorService.selectorModalVisible || this.endEditing());
|
|
1487
|
+
this.getIsKeepVisible() || this.endEditing();
|
|
1464
1488
|
}, "onClickOutside"),
|
|
1465
1489
|
onContextMenu: /* @__PURE__ */ __name(() => {
|
|
1466
|
-
this.endEditing();
|
|
1490
|
+
this.getIsKeepVisible() || this.endEditing();
|
|
1467
1491
|
}, "onContextMenu"),
|
|
1468
1492
|
hiddenType: "hide"
|
|
1469
1493
|
};
|
|
@@ -51,12 +51,15 @@ export declare class SheetsHyperLinkPopupService extends Disposable {
|
|
|
51
51
|
customRange?: ICustomRange;
|
|
52
52
|
label?: string;
|
|
53
53
|
}) | null>;
|
|
54
|
+
private _isKeepVisible;
|
|
54
55
|
get currentPopup(): IHyperLinkPopup | null;
|
|
55
56
|
get currentEditing(): (IHyperLinkEditing & {
|
|
56
57
|
customRange?: ICustomRange;
|
|
57
58
|
label?: string;
|
|
58
59
|
}) | null;
|
|
59
60
|
constructor(_sheetCanvasPopManagerService: SheetCanvasPopManagerService, _injector: Injector, _univerInstanceService: IUniverInstanceService, _editorBridgeService: IEditorBridgeService, _textSelectionManagerService: DocSelectionManagerService, _docCanvasPopManagerService: DocCanvasPopManagerService, _editorService: IEditorService, _rangeSelectorService: IRangeSelectorService, _zenZoneService: IZenZoneService);
|
|
61
|
+
setIsKeepVisible(v: boolean): void;
|
|
62
|
+
getIsKeepVisible(): boolean;
|
|
60
63
|
showPopup(location: IHyperLinkPopupOptions): void;
|
|
61
64
|
hideCurrentPopup(type?: HyperLinkEditSourceType, force?: boolean): void;
|
|
62
65
|
private _getEditingRange;
|