@univerjs/sheets-ui 0.5.5-experimental.20250124-fc44c59 → 0.5.5-experimental.20250125-1aa33c0
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/facade.js +1 -1
- package/lib/cjs/index.js +6 -6
- package/lib/es/facade.js +47 -2
- package/lib/es/index.js +224 -117
- package/lib/index.css +1 -1
- package/lib/types/commands/commands/headersize-changed.command.d.ts +8 -0
- package/lib/types/controllers/editor/formula-editor.controller.d.ts +0 -1
- package/lib/types/controllers/render-controllers/freeze.render-controller.d.ts +4 -2
- package/lib/types/controllers/render-controllers/zoom.render-controller.d.ts +4 -0
- package/lib/types/facade/f-event.d.ts +3 -0
- package/lib/types/facade/f-univer.d.ts +2 -0
- package/lib/types/facade/f-worksheet.d.ts +83 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/services/sheet-skeleton-manager.service.d.ts +2 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +6 -6
- package/package.json +11 -11
package/lib/es/facade.js
CHANGED
|
@@ -4,7 +4,7 @@ import { FUniver, ICommandService, IUniverInstanceService, CanceledError, RichTe
|
|
|
4
4
|
import { RichTextEditingMutation } from "@univerjs/docs";
|
|
5
5
|
import { IRenderManagerService, DeviceInputEventType, SHEET_VIEWPORT_KEY, sheetContentViewportKeys } from "@univerjs/engine-render";
|
|
6
6
|
import { SheetsSelectionsService, COMMAND_LISTENER_SKELETON_CHANGE, getSkeletonChangedEffectedRange, SheetInterceptorService, INTERCEPTOR_POINT, InterceptCellContentPriority } from "@univerjs/sheets";
|
|
7
|
-
import { SetCellEditVisibleOperation, IEditorBridgeService, SetZoomRatioCommand, HoverManagerService, DragManagerService, SheetScrollManagerService, SheetPasteShortKeyCommand, ISheetClipboardService, SheetSkeletonManagerService, SHEET_VIEW_KEY, ISheetSelectionRenderService, ChangeZoomRatioCommand, SheetsScrollRenderController, SetWorksheetColAutoWidthCommand, SheetCanvasPopManagerService, CellAlertManagerService, IMarkSelectionService } from "@univerjs/sheets-ui";
|
|
7
|
+
import { SetCellEditVisibleOperation, IEditorBridgeService, SetZoomRatioCommand, HoverManagerService, DragManagerService, SheetScrollManagerService, SheetPasteShortKeyCommand, ISheetClipboardService, SheetSkeletonManagerService, SHEET_VIEW_KEY, ISheetSelectionRenderService, ChangeZoomRatioCommand, SheetsScrollRenderController, SetWorksheetColAutoWidthCommand, SetColumnHeaderHeightCommand, SetRowHeaderWidthCommand, SheetCanvasPopManagerService, CellAlertManagerService, IMarkSelectionService } from "@univerjs/sheets-ui";
|
|
8
8
|
import { FSheetHooks, FWorkbook, FWorksheet, FPermission, FRange } from "@univerjs/sheets/facade";
|
|
9
9
|
import { KeyCode, CutCommand, CopyCommand, PasteCommand, IClipboardInterfaceService, PLAIN_TEXT_CLIPBOARD_MIME_TYPE, HTML_CLIPBOARD_MIME_TYPE, supportClipboardAPI, ISidebarService, IDialogService, ComponentManager } from "@univerjs/ui";
|
|
10
10
|
import { filter, combineLatest } from "rxjs";
|
|
@@ -16,7 +16,7 @@ const _FUniverSheetsUIMixin = class _FUniverSheetsUIMixin extends FUniver {
|
|
|
16
16
|
if (commandInfo.id === SetCellEditVisibleOperation.id) {
|
|
17
17
|
if (!this._eventListend(this.Event.BeforeSheetEditStart) && !this._eventListend(this.Event.BeforeSheetEditEnd))
|
|
18
18
|
return;
|
|
19
|
-
const target = this.
|
|
19
|
+
const target = this.getActiveSheet();
|
|
20
20
|
if (!target)
|
|
21
21
|
return;
|
|
22
22
|
const { workbook, worksheet } = target, editorBridgeService = injector.get(IEditorBridgeService), univerInstanceService = injector.get(IUniverInstanceService), params = commandInfo.params, { visible, keycode, eventType } = params, loc = editorBridgeService.getEditLocation();
|
|
@@ -781,6 +781,51 @@ const _FWorksheetSkeletonMixin = class _FWorksheetSkeletonMixin extends FWorkshe
|
|
|
781
781
|
ranges
|
|
782
782
|
}), this;
|
|
783
783
|
}
|
|
784
|
+
customizeColumnHeader(cfg) {
|
|
785
|
+
var _a, _b;
|
|
786
|
+
const activeSheet = this, unitId = this._fWorkbook.getId(), renderManagerService = this._injector.get(IRenderManagerService), subUnitId = activeSheet.getSheetId(), render = renderManagerService.getRenderById(unitId);
|
|
787
|
+
render && ((_a = cfg.headerStyle) != null && _a.size) && (render.with(SheetSkeletonManagerService).setColumnHeaderSize(render, subUnitId, (_b = cfg.headerStyle) == null ? void 0 : _b.size), activeSheet == null || activeSheet.refreshCanvas());
|
|
788
|
+
const sheetColumn = this._getSheetRenderComponent(unitId, SHEET_VIEW_KEY.COLUMN);
|
|
789
|
+
sheetColumn && (sheetColumn.setCustomHeader(cfg), activeSheet == null || activeSheet.refreshCanvas());
|
|
790
|
+
}
|
|
791
|
+
customizeRowHeader(cfg) {
|
|
792
|
+
const unitId = this._fWorkbook.getId();
|
|
793
|
+
this._getSheetRenderComponent(unitId, SHEET_VIEW_KEY.ROW).setCustomHeader(cfg);
|
|
794
|
+
}
|
|
795
|
+
setColumnHeaderHeight(height) {
|
|
796
|
+
const activeSheet = this, unitId = this._fWorkbook.getId(), subUnitId = activeSheet.getSheetId();
|
|
797
|
+
return this._commandService.executeCommand(SetColumnHeaderHeightCommand.id, {
|
|
798
|
+
unitId,
|
|
799
|
+
subUnitId,
|
|
800
|
+
size: height
|
|
801
|
+
}), activeSheet == null || activeSheet.refreshCanvas(), this;
|
|
802
|
+
}
|
|
803
|
+
setRowHeaderWidth(width) {
|
|
804
|
+
const activeSheet = this, unitId = this._fWorkbook.getId(), subUnitId = activeSheet.getSheetId();
|
|
805
|
+
this._commandService.executeCommand(SetRowHeaderWidthCommand.id, {
|
|
806
|
+
unitId,
|
|
807
|
+
subUnitId,
|
|
808
|
+
size: width
|
|
809
|
+
});
|
|
810
|
+
const sheetRow = this._getSheetRenderComponent(unitId, SHEET_VIEW_KEY.ROW);
|
|
811
|
+
return sheetRow && sheetRow.setCustomHeader({ headerStyle: { size: width } }), activeSheet == null || activeSheet.refreshCanvas(), this;
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* Get sheet render component from render by unitId and view key.
|
|
815
|
+
* @private
|
|
816
|
+
* @param {string} unitId The unit id of the spreadsheet.
|
|
817
|
+
* @param {SHEET_VIEW_KEY} viewKey The view key of the spreadsheet.
|
|
818
|
+
* @returns {Nullable<RenderComponentType>} The render component.
|
|
819
|
+
*/
|
|
820
|
+
_getSheetRenderComponent(unitId, viewKey) {
|
|
821
|
+
const render = this._injector.get(IRenderManagerService).getRenderById(unitId);
|
|
822
|
+
if (!render)
|
|
823
|
+
throw new Error(`Render Unit with unitId ${unitId} not found`);
|
|
824
|
+
const { components } = render, renderComponent = components.get(viewKey);
|
|
825
|
+
if (!renderComponent)
|
|
826
|
+
throw new Error("Render component not found");
|
|
827
|
+
return renderComponent;
|
|
828
|
+
}
|
|
784
829
|
};
|
|
785
830
|
__name(_FWorksheetSkeletonMixin, "FWorksheetSkeletonMixin");
|
|
786
831
|
let FWorksheetSkeletonMixin = _FWorksheetSkeletonMixin;
|
package/lib/es/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
|
|
|
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
5
|
import { DOCS_VIEW_KEY, getCanvasOffsetByEngine, IEditorService, VIEWPORT_KEY, DOCS_COMPONENT_MAIN_LAYER_INDEX, BreakLineCommand, DeleteLeftCommand, DocSelectionRenderService, ReplaceSnapshotCommand, MoveSelectionOperation, MoveCursorOperation, SetInlineFormatBoldCommand, SetInlineFormatItalicCommand, SetInlineFormatUnderlineCommand, SetInlineFormatStrikethroughCommand, SetInlineFormatSubscriptCommand, SetInlineFormatSuperscriptCommand, SetInlineFormatFontSizeCommand, SetInlineFormatFontFamilyCommand, SetInlineFormatTextColorCommand, SetInlineFormatCommand, NodePositionConvertToCursor, getLineBounding, DOC_VERTICAL_PADDING, IMEInputCommand, InsertCommand, CoverContentCommand, IRangeSelectorService } from "@univerjs/docs-ui";
|
|
6
|
-
import { createInterceptorKey, ColorKit, RANGE_TYPE, convertCellToRange, UniverInstanceType, Quantity, Disposable, toDisposable, Tools, createIdentifier, InterceptorManager, ThemeService, Inject, Injector, useDependency, IUniverInstanceService, ObjectMatrix, Direction, isFormulaString, isFormulaId, CellValueType, numfmt, Rectangle, ICommandService, IUndoRedoService,
|
|
6
|
+
import { CommandType, createInterceptorKey, ColorKit, RANGE_TYPE, convertCellToRange, UniverInstanceType, Quantity, Disposable, toDisposable, Tools, createIdentifier, InterceptorManager, ThemeService, Inject, Injector, useDependency, IUniverInstanceService, ObjectMatrix, Direction, isFormulaString, isFormulaId, CellValueType, numfmt, Rectangle, ICommandService, IUndoRedoService, sequenceExecute, DOCS_NORMAL_EDITOR_UNIT_ID_KEY, EDITOR_ACTIVATED, FOCUSING_EDITOR_STANDALONE, IContextService, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY, Workbook, Optional, FOCUSING_SHEET, RxDisposable, DisposableCollection, IPermissionService, fromEventSubject, sortRules, LocaleService, getReverseDirection, VerticalAlign, HorizontalAlign, WrapStrategy, FOCUSING_UNIVER_EDITOR, FOCUSING_COMMON_DRAWINGS, FOCUSING_FX_BAR_EDITOR, FOCUSING_EDITOR_INPUT_FORMULA, LocaleType, FOCUSING_EDITOR_BUT_HIDDEN, DEFAULT_EMPTY_DOCUMENT_VALUE, LRUMap, BaselineOffset, BooleanNumber, DataStreamTreeTokenType, skipParseTagNames, generateRandomId, CustomRangeType, DEFAULT_WORKSHEET_ROW_HEIGHT, ErrorService, CellModeEnum, ILogService, isNotNullOrUndefined, extractPureTextFromCell, UserManagerService, FontWeight, FontItalic, DEFAULT_STYLES, Dimension, BorderStyleTypes, AbsoluteRefType, useObservable as useObservable$1, IConfigService, nameCharacterCheck, debounce, NilCommand, connectInjector, UndoCommandId, Range, cellToRange, convertBodyToHtml, handleStyleToString, DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY, DEFAULT_WORKSHEET_COLUMN_WIDTH, PresetListType, isRealNum, InterceptorEffectEnum, splitIntoGrid, IAuthzIoService, isValidRange, DependentOn, Plugin, DocumentFlavor, merge as merge$1, registerDependencies, mergeOverrideWithDependencies, touchDependencies } from "@univerjs/core";
|
|
7
7
|
import { IRenderManagerService, SHEET_VIEWPORT_KEY, CURSOR_TYPE, Vector2, Rect, ScrollTimer, ScrollTimerType, DashedRect, Group, TRANSFORM_CHANGE_OBSERVABLE_TYPE, cancelRequestFrame, requestNewFrame, FIX_ONE_PIXEL_BLUR_OFFSET, Layer, SpreadsheetSkeleton, DeviceInputEventType, convertTextRotation, RENDER_RAW_FORMULA_KEY, Spreadsheet, RENDER_CLASS_TYPE, ScrollBar, fixLineWidthByScale, ptToPixel, Shape, SHEET_EXTENSION_PREFIX, SpreadsheetRowHeader, SpreadsheetColumnHeader, Viewport, hasCJKText, DEFAULT_PADDING_DATA, SheetExtension, RegularPolygon, precisionTo } from "@univerjs/engine-render";
|
|
8
8
|
import { useObservable, KeyCode, ILayoutService, MetaKeys, DEFAULT_BACKGROUND_COLOR_RGB, DEFAULT_BACKGROUND_COLOR_RGBA, handleStringToStyle, textTrim, PLAIN_TEXT_CLIPBOARD_MIME_TYPE, HTML_CLIPBOARD_MIME_TYPE, imageMimeTypeSet, IClipboardInterfaceService, INotificationService, IPlatformService, FILE_PNG_CLIPBOARD_MIME_TYPE, FILE__JPEG_CLIPBOARD_MIME_TYPE, FILE__WEBP_CLIPBOARD_MIME_TYPE, FILE__BMP_CLIPBOARD_MIME_TYPE, CopyCommand, CutCommand, PasteCommand, SheetPasteShortKeyCommandName, IConfirmService, IContextMenuService, MenuItemType, getMenuHiddenObservable, FONT_FAMILY_LIST, FONT_SIZE_LIST, ISidebarService, IDialogService, ComponentManager, useSidebarClick, DISABLE_AUTO_FOCUS_KEY, useEvent, useComponentsOfPart, ComponentContainer, UI_PLUGIN_CONFIG_KEY, UIMenu, ContextMenuPosition, IMessageService, IMenuManagerService, ToolbarItem, RibbonStartGroup, ContextMenuGroup, FontFamily, FontFamilyItem, FontSize, BuiltInUIPart, IShortcutService, IUIPartsService, ICanvasPopupService, IZenZoneService, UniverMobileUIPlugin } from "@univerjs/ui";
|
|
9
9
|
import React, { useMemo, useState, useEffect, forwardRef, useRef, createElement, useCallback, useLayoutEffect } from "react";
|
|
@@ -33,7 +33,41 @@ function getEditorObject(unitId, renderManagerService) {
|
|
|
33
33
|
__name(getEditorObject, "getEditorObject");
|
|
34
34
|
const SHEET_ZOOM_RANGE = [10, 400], RANGE_SELECTOR_COMPONENT_KEY = "RANGE_SELECTOR_COMPONENT_KEY", EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY = "EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY";
|
|
35
35
|
var SHEET_VIEW_KEY = /* @__PURE__ */ ((SHEET_VIEW_KEY2) => (SHEET_VIEW_KEY2.MAIN = "__SpreadsheetRender__", SHEET_VIEW_KEY2.ROW = "__SpreadsheetRowHeader__", SHEET_VIEW_KEY2.COLUMN = "__SpreadsheetColumnHeader__", SHEET_VIEW_KEY2.LEFT_TOP = "__SpreadsheetLeftTopPlaceholder__", SHEET_VIEW_KEY2))(SHEET_VIEW_KEY || {});
|
|
36
|
-
const SHEET_COMPONENT_MAIN_LAYER_INDEX = 0, SHEET_COMPONENT_SELECTION_LAYER_INDEX = 1, SHEET_COMPONENT_HEADER_LAYER_INDEX = 10, SHEET_COMPONENT_HEADER_SELECTION_LAYER_INDEX = 11, SHEET_COMPONENT_UNHIDE_LAYER_INDEX = 12,
|
|
36
|
+
const SHEET_COMPONENT_MAIN_LAYER_INDEX = 0, SHEET_COMPONENT_SELECTION_LAYER_INDEX = 1, SHEET_COMPONENT_HEADER_LAYER_INDEX = 10, SHEET_COMPONENT_HEADER_SELECTION_LAYER_INDEX = 11, SHEET_COMPONENT_UNHIDE_LAYER_INDEX = 12, SetRowHeaderWidthCommand = {
|
|
37
|
+
id: "sheet.command.set-row-header-width",
|
|
38
|
+
type: CommandType.COMMAND,
|
|
39
|
+
handler: /* @__PURE__ */ __name(async (accessor, params) => {
|
|
40
|
+
if (!params)
|
|
41
|
+
return !1;
|
|
42
|
+
const renderManagerSrv = accessor.get(IRenderManagerService);
|
|
43
|
+
if (!renderManagerSrv)
|
|
44
|
+
return !1;
|
|
45
|
+
const { unitId, subUnitId, size } = params, render2 = renderManagerSrv.getRenderById(unitId);
|
|
46
|
+
if (render2) {
|
|
47
|
+
renderManagerSrv.getRenderById(unitId).with(SheetSkeletonManagerService).setRowHeaderSize(render2, subUnitId, size);
|
|
48
|
+
const { components } = render2, renderComponent = components.get(SHEET_VIEW_KEY.ROW);
|
|
49
|
+
renderComponent && renderComponent.setCustomHeader({ headerStyle: { size } });
|
|
50
|
+
}
|
|
51
|
+
return !0;
|
|
52
|
+
}, "handler")
|
|
53
|
+
}, SetColumnHeaderHeightCommand = {
|
|
54
|
+
id: "sheet.command.set-col-header-height",
|
|
55
|
+
type: CommandType.COMMAND,
|
|
56
|
+
handler: /* @__PURE__ */ __name(async (accessor, params) => {
|
|
57
|
+
if (!params)
|
|
58
|
+
return !1;
|
|
59
|
+
const renderManagerSrv = accessor.get(IRenderManagerService);
|
|
60
|
+
if (!renderManagerSrv)
|
|
61
|
+
return !1;
|
|
62
|
+
const { unitId, subUnitId, size } = params, render2 = renderManagerSrv.getRenderById(unitId);
|
|
63
|
+
if (render2) {
|
|
64
|
+
renderManagerSrv.getRenderById(unitId).with(SheetSkeletonManagerService).setColumnHeaderSize(render2, subUnitId, size);
|
|
65
|
+
const { components } = render2, renderComponent = components.get(SHEET_VIEW_KEY.COLUMN);
|
|
66
|
+
renderComponent && renderComponent.setCustomHeader({ headerStyle: { size } });
|
|
67
|
+
}
|
|
68
|
+
return !0;
|
|
69
|
+
}, "handler")
|
|
70
|
+
}, RANGE_MOVE_PERMISSION_CHECK = createInterceptorKey("rangeMovePermissionCheck"), RANGE_FILL_PERMISSION_CHECK = createInterceptorKey("rangeFillPermissionCheck");
|
|
37
71
|
var SELECTION_SHAPE_DEPTH = /* @__PURE__ */ ((SELECTION_SHAPE_DEPTH2) => (SELECTION_SHAPE_DEPTH2[SELECTION_SHAPE_DEPTH2.FORMULA_EDITOR_SHOW = 100] = "FORMULA_EDITOR_SHOW", SELECTION_SHAPE_DEPTH2[SELECTION_SHAPE_DEPTH2.MARK_SELECTION = 1e4] = "MARK_SELECTION", SELECTION_SHAPE_DEPTH2))(SELECTION_SHAPE_DEPTH || {});
|
|
38
72
|
function genNormalSelectionStyle(themeService) {
|
|
39
73
|
const styleSheet = themeService.getCurrentTheme(), fill = new ColorKit(styleSheet.primaryColor).setAlpha(0.07).toRgbString();
|
|
@@ -1971,24 +2005,48 @@ let SheetSkeletonManagerService = (_a = class extends Disposable {
|
|
|
1971
2005
|
}
|
|
1972
2006
|
setColumnHeaderSize(render2, sheetId, size) {
|
|
1973
2007
|
var _a61;
|
|
2008
|
+
if (!render2) return;
|
|
1974
2009
|
const skeleton = (_a61 = this.getWorksheetSkeleton(sheetId)) == null ? void 0 : _a61.skeleton;
|
|
1975
|
-
if (skeleton)
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
2010
|
+
if (!skeleton) return;
|
|
2011
|
+
skeleton.columnHeaderHeight = size, render2.scene.getViewports()[0].top = size, render2.scene.getViewport(SHEET_VIEWPORT_KEY.VIEW_COLUMN_RIGHT).setViewportSize({
|
|
2012
|
+
height: size
|
|
2013
|
+
}), render2.scene.getViewport(SHEET_VIEWPORT_KEY.VIEW_COLUMN_LEFT).setViewportSize({
|
|
2014
|
+
height: size
|
|
2015
|
+
}), render2.scene.getViewport(SHEET_VIEWPORT_KEY.VIEW_ROW_BOTTOM).setViewportSize({
|
|
2016
|
+
top: size
|
|
2017
|
+
}), render2.scene.getViewport(SHEET_VIEWPORT_KEY.VIEW_ROW_TOP).setViewportSize({
|
|
2018
|
+
top: size
|
|
2019
|
+
}), render2.scene.getViewport(SHEET_VIEWPORT_KEY.VIEW_LEFT_TOP).setViewportSize({
|
|
2020
|
+
height: size
|
|
2021
|
+
});
|
|
2022
|
+
const selectionService = render2 == null ? void 0 : render2.with(SheetsSelectionsService), selectionRenderService = render2 == null ? void 0 : render2.with(ISheetSelectionRenderService), currSelections = selectionService.getCurrentSelections();
|
|
2023
|
+
selectionRenderService.resetSelectionsByModelData(currSelections);
|
|
2024
|
+
const sheetSkeletonManagerParam = this.getUnitSkeleton(render2.unitId, sheetId);
|
|
2025
|
+
sheetSkeletonManagerParam && (sheetSkeletonManagerParam.commandId = SetColumnHeaderHeightCommand.id, this._currentSkeleton$.next(sheetSkeletonManagerParam));
|
|
2026
|
+
}
|
|
2027
|
+
setRowHeaderSize(render2, sheetId, size) {
|
|
2028
|
+
var _a61;
|
|
2029
|
+
const skeleton = (_a61 = this.getWorksheetSkeleton(sheetId)) == null ? void 0 : _a61.skeleton;
|
|
2030
|
+
if (!render2 || !skeleton) return;
|
|
2031
|
+
skeleton.rowHeaderWidth = size;
|
|
2032
|
+
const originWidth = render2.scene.getViewport(SHEET_VIEWPORT_KEY.VIEW_LEFT_TOP).width || 46, deltaX = size - originWidth, originLeftOfViewMain = render2.scene.getViewports()[0].left;
|
|
2033
|
+
render2.scene.getViewports()[0].left = originLeftOfViewMain + deltaX, render2.scene.getViewport(SHEET_VIEWPORT_KEY.VIEW_ROW_BOTTOM).setViewportSize({
|
|
2034
|
+
width: size
|
|
2035
|
+
}), render2.scene.getViewport(SHEET_VIEWPORT_KEY.VIEW_ROW_TOP).setViewportSize({
|
|
2036
|
+
width: size
|
|
2037
|
+
}), render2.scene.getViewport(SHEET_VIEWPORT_KEY.VIEW_COLUMN_LEFT).setViewportSize({
|
|
2038
|
+
left: size
|
|
2039
|
+
});
|
|
2040
|
+
const prevLeft = render2.scene.getViewport(SHEET_VIEWPORT_KEY.VIEW_COLUMN_RIGHT).left || 0;
|
|
2041
|
+
render2.scene.getViewport(SHEET_VIEWPORT_KEY.VIEW_COLUMN_RIGHT).setViewportSize({
|
|
2042
|
+
left: prevLeft + deltaX
|
|
2043
|
+
}), render2.scene.getViewport(SHEET_VIEWPORT_KEY.VIEW_LEFT_TOP).setViewportSize({
|
|
2044
|
+
width: size
|
|
2045
|
+
});
|
|
2046
|
+
const selectionService = render2 == null ? void 0 : render2.with(SheetsSelectionsService), selectionRenderService = render2 == null ? void 0 : render2.with(ISheetSelectionRenderService), currSelections = selectionService.getCurrentSelections();
|
|
2047
|
+
selectionRenderService.resetSelectionsByModelData(currSelections);
|
|
2048
|
+
const sheetSkeletonManagerParam = this.getCurrent();
|
|
2049
|
+
sheetSkeletonManagerParam && (sheetSkeletonManagerParam.commandId = SetRowHeaderWidthCommand.id, this._currentSkeleton$.next(sheetSkeletonManagerParam));
|
|
1992
2050
|
}
|
|
1993
2051
|
}, __name(_a, "SheetSkeletonManagerService"), _a);
|
|
1994
2052
|
SheetSkeletonManagerService = __decorateClass$V([
|
|
@@ -3515,7 +3573,9 @@ var __defProp$R = Object.defineProperty, __getOwnPropDesc$R = Object.getOwnPrope
|
|
|
3515
3573
|
}, "__decorateClass$R"), __decorateParam$R = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$R"), _a5;
|
|
3516
3574
|
let SheetsZoomRenderController = (_a5 = class extends Disposable {
|
|
3517
3575
|
constructor(_context, _sheetSkeletonManagerService, _commandService, _contextService, _editorBridgeService) {
|
|
3518
|
-
super()
|
|
3576
|
+
super();
|
|
3577
|
+
__publicField(this, "_zoom");
|
|
3578
|
+
this._context = _context, this._sheetSkeletonManagerService = _sheetSkeletonManagerService, this._commandService = _commandService, this._contextService = _contextService, this._editorBridgeService = _editorBridgeService, this._initSkeletonListener(), this._initZoomEventListener();
|
|
3519
3579
|
}
|
|
3520
3580
|
updateZoom(worksheetId, zoomRatio) {
|
|
3521
3581
|
const worksheet = this._context.unit.getSheetBySheetId(worksheetId);
|
|
@@ -3554,7 +3614,7 @@ let SheetsZoomRenderController = (_a5 = class extends Disposable {
|
|
|
3554
3614
|
const worksheet = this._context.unit.getActiveSheet();
|
|
3555
3615
|
if (!worksheet) return;
|
|
3556
3616
|
const zoomRatio = worksheet.getZoomRatio() || 1;
|
|
3557
|
-
this._updateViewZoom(zoomRatio);
|
|
3617
|
+
this._zoom !== zoomRatio && this._updateViewZoom(zoomRatio), this._zoom = zoomRatio;
|
|
3558
3618
|
}));
|
|
3559
3619
|
}
|
|
3560
3620
|
/**
|
|
@@ -10376,44 +10436,72 @@ let HeaderFreezeRenderController = (_a18 = class extends Disposable {
|
|
|
10376
10436
|
})
|
|
10377
10437
|
);
|
|
10378
10438
|
}
|
|
10439
|
+
/**
|
|
10440
|
+
* Update freeze line position when some cmds cause sk change.
|
|
10441
|
+
*/
|
|
10442
|
+
// TODO @lumixraku But there is a _zoomRefresh method? Duplicated?
|
|
10379
10443
|
_commandExecutedListener() {
|
|
10380
|
-
const updateCommandList = [SetFrozenMutation.id, SetZoomRatioOperation.id];
|
|
10381
10444
|
this.disposeWithMe(
|
|
10382
10445
|
// eslint-disable-next-line complexity
|
|
10383
10446
|
this._commandService.onCommandExecuted((command) => {
|
|
10384
|
-
|
|
10385
|
-
|
|
10386
|
-
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
|
|
10404
|
-
|
|
10405
|
-
|
|
10406
|
-
|
|
10407
|
-
|
|
10408
|
-
|
|
10409
|
-
|
|
10410
|
-
|
|
10411
|
-
|
|
10412
|
-
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10447
|
+
switch (command.id) {
|
|
10448
|
+
case SetFrozenMutation.id:
|
|
10449
|
+
case SetZoomRatioOperation.id:
|
|
10450
|
+
{
|
|
10451
|
+
const lastFreeze = this._lastFreeze, workbook = this._context.unit, worksheet = workbook.getActiveSheet(), params = command.params, { unitId, subUnitId } = params;
|
|
10452
|
+
if (!(unitId === workbook.getUnitId() && subUnitId === (worksheet == null ? void 0 : worksheet.getSheetId())))
|
|
10453
|
+
return;
|
|
10454
|
+
const freeze = worksheet.getConfig().freeze;
|
|
10455
|
+
if (this._lastFreeze = freeze, freeze == null)
|
|
10456
|
+
return;
|
|
10457
|
+
let resetScroll = 0;
|
|
10458
|
+
const { startRow = -1, startColumn = -1, ySplit = 0, xSplit = 0 } = freeze;
|
|
10459
|
+
(!lastFreeze || lastFreeze.startRow !== startRow || lastFreeze.ySplit !== ySplit) && (resetScroll |= 2), (!lastFreeze || lastFreeze.startColumn !== startColumn || lastFreeze.xSplit !== xSplit) && (resetScroll |= 1), params.resetScroll === !1 && (resetScroll = 0), this._refreshFreeze(startRow, startColumn, ySplit, xSplit, resetScroll);
|
|
10460
|
+
}
|
|
10461
|
+
break;
|
|
10462
|
+
case SetWorksheetRowHeightMutation.id:
|
|
10463
|
+
{
|
|
10464
|
+
const freeze = this._getFreeze(), isRefresh = freeze && command.params.ranges.some((i) => i.startRow < freeze.startRow);
|
|
10465
|
+
command.params && isRefresh && this._refreshCurrent();
|
|
10466
|
+
}
|
|
10467
|
+
break;
|
|
10468
|
+
case SetWorksheetColWidthMutation.id:
|
|
10469
|
+
{
|
|
10470
|
+
const freeze = this._getFreeze();
|
|
10471
|
+
command.params && freeze && command.params.ranges.some(
|
|
10472
|
+
(i) => i.startColumn < freeze.startColumn
|
|
10473
|
+
) && this._refreshCurrent();
|
|
10474
|
+
}
|
|
10475
|
+
break;
|
|
10476
|
+
case SetWorksheetRowAutoHeightMutation.id:
|
|
10477
|
+
{
|
|
10478
|
+
const params = command.params, freeze = this._getFreeze();
|
|
10479
|
+
if (freeze && freeze.startRow > -1 && params.rowsAutoHeightInfo.some((info) => info.row < freeze.startRow)) {
|
|
10480
|
+
const subscription = this._sheetSkeletonManagerService.currentSkeleton$.subscribe(() => {
|
|
10481
|
+
this._refreshCurrent(), setTimeout(() => {
|
|
10482
|
+
subscription.unsubscribe();
|
|
10483
|
+
});
|
|
10484
|
+
});
|
|
10485
|
+
}
|
|
10486
|
+
}
|
|
10487
|
+
break;
|
|
10488
|
+
case SetColHiddenMutation.id:
|
|
10489
|
+
case SetColVisibleMutation.id:
|
|
10490
|
+
{
|
|
10491
|
+
const params = command.params, freeze = this._getFreeze(), ranges = params.ranges;
|
|
10492
|
+
freeze && freeze.startColumn > -1 && ranges.some((range) => range.startColumn < freeze.startColumn) && this._refreshCurrent();
|
|
10493
|
+
}
|
|
10494
|
+
break;
|
|
10495
|
+
case SetRowHiddenMutation.id:
|
|
10496
|
+
case SetRowVisibleMutation.id:
|
|
10497
|
+
{
|
|
10498
|
+
const params = command.params, freeze = this._getFreeze(), ranges = params.ranges;
|
|
10499
|
+
freeze && freeze.startRow > -1 && ranges.some((range) => range.startRow < freeze.startRow) && this._refreshCurrent();
|
|
10500
|
+
}
|
|
10501
|
+
break;
|
|
10502
|
+
case SetRowHeaderWidthCommand.id:
|
|
10503
|
+
case SetColumnHeaderHeightCommand.id:
|
|
10504
|
+
this._refreshCurrent();
|
|
10417
10505
|
}
|
|
10418
10506
|
})
|
|
10419
10507
|
);
|
|
@@ -10464,8 +10552,7 @@ let HeaderFreezeRenderController = (_a18 = class extends Disposable {
|
|
|
10464
10552
|
return getSheetObject(this._context.unit, this._context);
|
|
10465
10553
|
}
|
|
10466
10554
|
/**
|
|
10467
|
-
*
|
|
10468
|
-
* 但是窗口 resize 并不会进入
|
|
10555
|
+
* Core function of _refreshCurrent
|
|
10469
10556
|
* @param startRow
|
|
10470
10557
|
* @param startColumn
|
|
10471
10558
|
* @param ySplit
|
|
@@ -13452,7 +13539,7 @@ function DefinedName({ disable }) {
|
|
|
13452
13539
|
] });
|
|
13453
13540
|
}
|
|
13454
13541
|
__name(DefinedName, "DefinedName");
|
|
13455
|
-
const formulaBox = "univer-formula-box", nameRanges = "univer-name-ranges", formulaBar = "univer-formula-bar", formulaIcon = "univer-formula-icon", formulaIconDisable = "univer-formula-icon-disable", formulaIconWrapper = "univer-formula-icon-wrapper", iconContainer = "univer-icon-container", iconContainerSuccess = "univer-icon-container-success", formulaActive = "univer-formula-active", iconContainerError = "univer-icon-container-error", iconContainerFx = "univer-icon-container-fx", formulaInput = "univer-formula-input", formulaContainer = "univer-formula-container", sheetEmbeddingFormulaEditorWrap = "univer-sheet-embedding-formula-editor-wrap", formulaContent = "univer-formula-content", arrowContainer = "univer-arrow-container", arrowContainerDisable = "univer-arrow-container-disable", styles$f = {
|
|
13542
|
+
const formulaBox = "univer-formula-box", nameRanges = "univer-name-ranges", formulaBar = "univer-formula-bar", formulaIcon = "univer-formula-icon", formulaIconDisable = "univer-formula-icon-disable", formulaIconWrapper = "univer-formula-icon-wrapper", iconContainer = "univer-icon-container", iconContainerSuccess = "univer-icon-container-success", formulaActive = "univer-formula-active", iconContainerError = "univer-icon-container-error", iconContainerFx = "univer-icon-container-fx", formulaInput = "univer-formula-input", formulaInputMask = "univer-formula-input-mask", formulaContainer = "univer-formula-container", sheetEmbeddingFormulaEditorWrap = "univer-sheet-embedding-formula-editor-wrap", formulaContent = "univer-formula-content", arrowContainer = "univer-arrow-container", arrowContainerDisable = "univer-arrow-container-disable", styles$f = {
|
|
13456
13543
|
formulaBox,
|
|
13457
13544
|
nameRanges,
|
|
13458
13545
|
formulaBar,
|
|
@@ -13465,6 +13552,7 @@ const formulaBox = "univer-formula-box", nameRanges = "univer-name-ranges", form
|
|
|
13465
13552
|
iconContainerError,
|
|
13466
13553
|
iconContainerFx,
|
|
13467
13554
|
formulaInput,
|
|
13555
|
+
formulaInputMask,
|
|
13468
13556
|
formulaContainer,
|
|
13469
13557
|
sheetEmbeddingFormulaEditorWrap,
|
|
13470
13558
|
formulaContent,
|
|
@@ -13472,7 +13560,7 @@ const formulaBox = "univer-formula-box", nameRanges = "univer-name-ranges", form
|
|
|
13472
13560
|
arrowContainerDisable
|
|
13473
13561
|
};
|
|
13474
13562
|
function FormulaBar() {
|
|
13475
|
-
var _a61;
|
|
13563
|
+
var _a61, _b;
|
|
13476
13564
|
const [iconStyle, setIconStyle] = useState(styles$f.formulaGrey), [arrowDirection, setArrowDirection] = useState(
|
|
13477
13565
|
0
|
|
13478
13566
|
/* Down */
|
|
@@ -13481,7 +13569,7 @@ function FormulaBar() {
|
|
|
13481
13569
|
viewDisable: !1
|
|
13482
13570
|
}), [imageDisable, setImageDisable] = useState(!1), currentWorkbook = useActiveWorkbook(), componentManager = useDependency(ComponentManager), workbook = useObservable$1(() => univerInstanceService.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_SHEET), void 0, void 0, []), isRefSelecting = useRef(0), editState = editorBridgeService.getEditLocation(), keyCodeConfig = useKeyEventConfig(isRefSelecting, (_a61 = editState == null ? void 0 : editState.unitId) != null ? _a61 : ""), FormulaEditor = componentManager.get(EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY), formulaAuxUIParts = useComponentsOfPart(SheetsUIPart.FORMULA_AUX), contextService = useDependency(IContextService);
|
|
13483
13571
|
useObservable$1(useMemo(() => contextService.subscribeContextValue$(FOCUSING_FX_BAR_EDITOR), [contextService]));
|
|
13484
|
-
const isFocusFxBar = contextService.getContextValue(FOCUSING_FX_BAR_EDITOR), ref = useRef(null);
|
|
13572
|
+
const isFocusFxBar = contextService.getContextValue(FOCUSING_FX_BAR_EDITOR), ref = useRef(null), editorService = useDependency(IEditorService);
|
|
13485
13573
|
useLayoutEffect(() => {
|
|
13486
13574
|
const subscription = workbook.activeSheet$.pipe(
|
|
13487
13575
|
switchMap((worksheet) => worksheet ? merge(
|
|
@@ -13491,30 +13579,30 @@ function FormulaBar() {
|
|
|
13491
13579
|
selectionManager.selectionSet$
|
|
13492
13580
|
).pipe(
|
|
13493
13581
|
switchMap(() => {
|
|
13494
|
-
var _a62,
|
|
13495
|
-
const
|
|
13582
|
+
var _a62, _b2;
|
|
13583
|
+
const unitId2 = workbook.getUnitId(), subUnitId = worksheet.getSheetId();
|
|
13496
13584
|
if (!((_a62 = selectionManager.getCurrentLastSelection()) == null ? void 0 : _a62.range)) return EMPTY;
|
|
13497
|
-
const primary = (
|
|
13585
|
+
const primary = (_b2 = selectionManager.getCurrentLastSelection()) == null ? void 0 : _b2.primary;
|
|
13498
13586
|
return primary ? of({
|
|
13499
|
-
unitId,
|
|
13587
|
+
unitId: unitId2,
|
|
13500
13588
|
subUnitId,
|
|
13501
13589
|
primary
|
|
13502
13590
|
}) : of(null);
|
|
13503
13591
|
})
|
|
13504
13592
|
) : EMPTY)
|
|
13505
13593
|
).subscribe((cellInfo) => {
|
|
13506
|
-
var _a62,
|
|
13594
|
+
var _a62, _b2, _c, _d, _e, _f;
|
|
13507
13595
|
if (cellInfo) {
|
|
13508
|
-
const { unitId, subUnitId, primary } = cellInfo;
|
|
13509
|
-
if (worksheetProtectionRuleModel.getRule(
|
|
13510
|
-
const editDisable2 = !((
|
|
13596
|
+
const { unitId: unitId2, subUnitId, primary } = cellInfo;
|
|
13597
|
+
if (worksheetProtectionRuleModel.getRule(unitId2, subUnitId)) {
|
|
13598
|
+
const editDisable2 = !((_b2 = (_a62 = permissionService.getPermissionPoint(new WorksheetEditPermission(unitId2, subUnitId).id)) == null ? void 0 : _a62.value) == null || _b2), viewDisable2 = !((_d = (_c = permissionService.getPermissionPoint(new WorksheetViewPermission(unitId2, subUnitId).id)) == null ? void 0 : _c.value) == null || _d);
|
|
13511
13599
|
setDisableInfo({
|
|
13512
13600
|
viewDisable: viewDisable2,
|
|
13513
13601
|
editDisable: editDisable2
|
|
13514
13602
|
});
|
|
13515
13603
|
return;
|
|
13516
13604
|
}
|
|
13517
|
-
const { actualRow, actualColumn } = primary, cellInfoWithPermission = rangeProtectionCache.getCellInfo(
|
|
13605
|
+
const { actualRow, actualColumn } = primary, cellInfoWithPermission = rangeProtectionCache.getCellInfo(unitId2, subUnitId, actualRow, actualColumn);
|
|
13518
13606
|
setDisableInfo({
|
|
13519
13607
|
editDisable: !((_e = cellInfoWithPermission == null ? void 0 : cellInfoWithPermission[UnitAction.Edit]) == null || _e),
|
|
13520
13608
|
viewDisable: !((_f = cellInfoWithPermission == null ? void 0 : cellInfoWithPermission[UnitAction.View]) == null || _f)
|
|
@@ -13535,8 +13623,8 @@ function FormulaBar() {
|
|
|
13535
13623
|
return () => subscription.unsubscribe();
|
|
13536
13624
|
}, [editorBridgeService.visible$]), useEffect(() => {
|
|
13537
13625
|
const subscription = editorBridgeService.currentEditCellState$.subscribe((state) => {
|
|
13538
|
-
var _a62,
|
|
13539
|
-
(_c = (
|
|
13626
|
+
var _a62, _b2, _c;
|
|
13627
|
+
(_c = (_b2 = (_a62 = state == null ? void 0 : state.documentLayoutObject.documentModel) == null ? void 0 : _a62.getBody()) == null ? void 0 : _b2.customBlocks) != null && _c.length ? setImageDisable(!0) : setImageDisable(!1);
|
|
13540
13628
|
});
|
|
13541
13629
|
return () => subscription.unsubscribe();
|
|
13542
13630
|
}, [editorBridgeService.currentEditCellState$]), useEffect(() => {
|
|
@@ -13585,7 +13673,26 @@ function FormulaBar() {
|
|
|
13585
13673
|
formulaEditorManagerService.handleFxBtnClick(!0);
|
|
13586
13674
|
}
|
|
13587
13675
|
__name(handlerFxBtnClick, "handlerFxBtnClick");
|
|
13588
|
-
const { viewDisable, editDisable } = disableInfo, disabled = editDisable || imageDisable;
|
|
13676
|
+
const { viewDisable, editDisable } = disableInfo, disabled = editDisable || imageDisable, shouldSkipFocus = useRef(!1), commandService = useDependency(ICommandService);
|
|
13677
|
+
(_b = currentWorkbook == null ? void 0 : currentWorkbook.getUnitId()) != null;
|
|
13678
|
+
const handlePointerDown = /* @__PURE__ */ __name(() => {
|
|
13679
|
+
try {
|
|
13680
|
+
editorBridgeService.isVisible().visible === !1 && commandService.syncExecuteCommand(
|
|
13681
|
+
SetCellEditVisibleOperation.id,
|
|
13682
|
+
{
|
|
13683
|
+
visible: !0,
|
|
13684
|
+
eventType: DeviceInputEventType.PointerDown,
|
|
13685
|
+
unitId: DOCS_NORMAL_EDITOR_UNIT_ID_KEY
|
|
13686
|
+
}
|
|
13687
|
+
), contextService.setContextValue(FOCUSING_FX_BAR_EDITOR, !0);
|
|
13688
|
+
} catch (e) {
|
|
13689
|
+
throw shouldSkipFocus.current = !0, e;
|
|
13690
|
+
}
|
|
13691
|
+
}, "handlePointerDown"), handlePointerUp = /* @__PURE__ */ __name((e) => {
|
|
13692
|
+
shouldSkipFocus.current && setTimeout(() => {
|
|
13693
|
+
editorService.blur(!0);
|
|
13694
|
+
}, 30), shouldSkipFocus.current = !1;
|
|
13695
|
+
}, "handlePointerUp");
|
|
13589
13696
|
return /* @__PURE__ */ jsxs(
|
|
13590
13697
|
"div",
|
|
13591
13698
|
{
|
|
@@ -13617,29 +13724,38 @@ function FormulaBar() {
|
|
|
13617
13724
|
/* @__PURE__ */ jsx("span", { className: clsx(styles$f.iconContainer, styles$f.iconContainerFx), onClick: handlerFxBtnClick, children: /* @__PURE__ */ jsx(FxSingle, {}) })
|
|
13618
13725
|
] }) }),
|
|
13619
13726
|
/* @__PURE__ */ jsxs("div", { className: styles$f.formulaContainer, children: [
|
|
13620
|
-
/* @__PURE__ */ jsx(
|
|
13621
|
-
|
|
13727
|
+
/* @__PURE__ */ jsx(
|
|
13728
|
+
"div",
|
|
13622
13729
|
{
|
|
13623
|
-
|
|
13624
|
-
|
|
13625
|
-
|
|
13626
|
-
|
|
13627
|
-
|
|
13628
|
-
|
|
13629
|
-
|
|
13630
|
-
|
|
13631
|
-
|
|
13632
|
-
|
|
13633
|
-
|
|
13634
|
-
|
|
13635
|
-
|
|
13636
|
-
|
|
13637
|
-
|
|
13638
|
-
|
|
13639
|
-
|
|
13640
|
-
|
|
13730
|
+
className: styles$f.formulaInput,
|
|
13731
|
+
onPointerDown: handlePointerDown,
|
|
13732
|
+
onPointerUp: handlePointerUp,
|
|
13733
|
+
ref,
|
|
13734
|
+
children: FormulaEditor && /* @__PURE__ */ jsx(
|
|
13735
|
+
FormulaEditor,
|
|
13736
|
+
{
|
|
13737
|
+
disableSelectionOnClick: !0,
|
|
13738
|
+
editorId: DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY,
|
|
13739
|
+
initValue: "",
|
|
13740
|
+
onChange: /* @__PURE__ */ __name(() => {
|
|
13741
|
+
}, "onChange"),
|
|
13742
|
+
isFocus: isFocusFxBar,
|
|
13743
|
+
className: styles$f.formulaContent,
|
|
13744
|
+
unitId: editState == null ? void 0 : editState.unitId,
|
|
13745
|
+
subUnitId: editState == null ? void 0 : editState.sheetId,
|
|
13746
|
+
isSupportAcrossSheet: !0,
|
|
13747
|
+
resetSelectionOnBlur: !1,
|
|
13748
|
+
isSingle: !1,
|
|
13749
|
+
keyboradEventConfig: keyCodeConfig,
|
|
13750
|
+
onFormulaSelectingChange: /* @__PURE__ */ __name((isSelecting) => {
|
|
13751
|
+
isRefSelecting.current = isSelecting, isSelecting ? editorBridgeService.enableForceKeepVisible() : editorBridgeService.disableForceKeepVisible();
|
|
13752
|
+
}, "onFormulaSelectingChange"),
|
|
13753
|
+
autoScrollbar: !1,
|
|
13754
|
+
disableContextMenu: !1
|
|
13755
|
+
}
|
|
13756
|
+
)
|
|
13641
13757
|
}
|
|
13642
|
-
)
|
|
13758
|
+
),
|
|
13643
13759
|
/* @__PURE__ */ jsx("div", { className: clsx(styles$f.arrowContainer, { [styles$f.arrowContainerDisable]: editDisable }), onClick: handleArrowClick, children: arrowDirection === 0 ? /* @__PURE__ */ jsx(DropdownSingle, {}) : /* @__PURE__ */ jsx(DropdownSingle, { style: { transform: "rotateZ(180deg)" } }) })
|
|
13644
13760
|
] })
|
|
13645
13761
|
] }),
|
|
@@ -16678,7 +16794,9 @@ let SheetUIController = (_a22 = class extends Disposable {
|
|
|
16678
16794
|
DeleteRangeProtectionFromContextMenuCommand,
|
|
16679
16795
|
SetRangeProtectionFromContextMenuCommand,
|
|
16680
16796
|
DeleteWorksheetProtectionFormSheetBarCommand,
|
|
16681
|
-
SetWorksheetColAutoWidthCommand
|
|
16797
|
+
SetWorksheetColAutoWidthCommand,
|
|
16798
|
+
SetRowHeaderWidthCommand,
|
|
16799
|
+
SetColumnHeaderHeightCommand
|
|
16682
16800
|
].forEach((c) => {
|
|
16683
16801
|
this.disposeWithMe(this._commandService.registerCommand(c));
|
|
16684
16802
|
});
|
|
@@ -22333,7 +22451,7 @@ let FormulaEditorController = (_a51 = class extends RxDisposable {
|
|
|
22333
22451
|
if (formulaEditorDocObject == null)
|
|
22334
22452
|
return;
|
|
22335
22453
|
const { mainComponent: documentComponent } = formulaEditorDocObject;
|
|
22336
|
-
documentComponent != null && (this._loadedMap.has(documentComponent) ||
|
|
22454
|
+
documentComponent != null && (this._loadedMap.has(documentComponent) || this._loadedMap.add(documentComponent));
|
|
22337
22455
|
}
|
|
22338
22456
|
_listenFxBtnClick() {
|
|
22339
22457
|
this._formulaEditorManagerService.fxBtnClick$.pipe(takeUntil(this.dispose$)).subscribe(() => {
|
|
@@ -22343,11 +22461,14 @@ let FormulaEditorController = (_a51 = class extends RxDisposable {
|
|
|
22343
22461
|
const currentSheet = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET), formulaEditorDataModel = this._univerInstanceService.getUniverDocInstance(
|
|
22344
22462
|
DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY
|
|
22345
22463
|
);
|
|
22346
|
-
this._editorBridgeService.isVisible().visible === !1 && this.
|
|
22347
|
-
|
|
22348
|
-
|
|
22349
|
-
|
|
22350
|
-
|
|
22464
|
+
this._editorBridgeService.isVisible().visible === !1 && this._commandService.syncExecuteCommand(
|
|
22465
|
+
SetCellEditVisibleOperation.id,
|
|
22466
|
+
{
|
|
22467
|
+
visible: !0,
|
|
22468
|
+
eventType: DeviceInputEventType.PointerDown,
|
|
22469
|
+
unitId: (_a61 = currentSheet == null ? void 0 : currentSheet.getUnitId()) != null ? _a61 : ""
|
|
22470
|
+
}
|
|
22471
|
+
);
|
|
22351
22472
|
const content = (_b = formulaEditorDataModel == null ? void 0 : formulaEditorDataModel.getBody()) == null ? void 0 : _b.dataStream;
|
|
22352
22473
|
if (content == null)
|
|
22353
22474
|
return;
|
|
@@ -22369,22 +22490,6 @@ let FormulaEditorController = (_a51 = class extends RxDisposable {
|
|
|
22369
22490
|
}
|
|
22370
22491
|
});
|
|
22371
22492
|
}
|
|
22372
|
-
_initialMain(unitId) {
|
|
22373
|
-
const formulaEditorDocObject = this._renderManagerService.getRenderById(unitId);
|
|
22374
|
-
if (formulaEditorDocObject == null)
|
|
22375
|
-
return;
|
|
22376
|
-
const { mainComponent: documentComponent } = formulaEditorDocObject;
|
|
22377
|
-
documentComponent != null && this.disposeWithMe(
|
|
22378
|
-
documentComponent.onPointerDown$.subscribeEvent(() => {
|
|
22379
|
-
this._editorBridgeService.isVisible().visible === !1 && (this._editorBridgeService.changeVisible({
|
|
22380
|
-
visible: !0,
|
|
22381
|
-
eventType: DeviceInputEventType.PointerDown,
|
|
22382
|
-
unitId
|
|
22383
|
-
}), this._undoRedoService.clearUndoRedo(DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY)), this._contextService.setContextValue(FOCUSING_FX_BAR_EDITOR, !0);
|
|
22384
|
-
})
|
|
22385
|
-
);
|
|
22386
|
-
}
|
|
22387
|
-
// Listen to changes in the size of the formula editor container to set the size of the editor.
|
|
22388
22493
|
_syncEditorSize() {
|
|
22389
22494
|
const addFOrmulaBar$ = this._univerInstanceService.unitAdded$.pipe(filter((unit) => unit.getUnitId() === DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY));
|
|
22390
22495
|
this.disposeWithMe(combineLatest([this._formulaEditorManagerService.position$, addFOrmulaBar$]).subscribe(([position]) => {
|
|
@@ -22978,7 +23083,7 @@ let EditorBridgeRenderController = (_a56 = class extends RxDisposable {
|
|
|
22978
23083
|
}
|
|
22979
23084
|
_showEditorByKeyboard(config) {
|
|
22980
23085
|
const event = config == null ? void 0 : config.event;
|
|
22981
|
-
config == null || !event.data && event.inputType !== "InsertParagraph" || this._commandService.
|
|
23086
|
+
config == null || !event.data && event.inputType !== "InsertParagraph" || this._commandService.syncExecuteCommand(SetCellEditVisibleOperation.id, {
|
|
22982
23087
|
visible: !0,
|
|
22983
23088
|
eventType: DeviceInputEventType.Keyboard,
|
|
22984
23089
|
keycode: event.which,
|
|
@@ -23964,6 +24069,7 @@ export {
|
|
|
23964
24069
|
SetCellEditVisibleOperation,
|
|
23965
24070
|
SetCellEditVisibleWithF2Operation,
|
|
23966
24071
|
SetColumnFrozenCommand,
|
|
24072
|
+
SetColumnHeaderHeightCommand,
|
|
23967
24073
|
SetFormatPainterOperation,
|
|
23968
24074
|
SetInfiniteFormatPainterCommand,
|
|
23969
24075
|
SetOnceFormatPainterCommand,
|
|
@@ -23978,6 +24084,7 @@ export {
|
|
|
23978
24084
|
SetRangeTextColorCommand,
|
|
23979
24085
|
SetRangeUnderlineCommand,
|
|
23980
24086
|
SetRowFrozenCommand,
|
|
24087
|
+
SetRowHeaderWidthCommand,
|
|
23981
24088
|
SetScrollOperation,
|
|
23982
24089
|
SetScrollRelativeCommand,
|
|
23983
24090
|
SetSelectionFrozenCommand,
|