@univerjs/sheets-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 +11 -11
- package/lib/es/index.js +2290 -2143
- package/lib/types/common/keys.d.ts +4 -0
- package/lib/types/controllers/checkbox.controller.d.ts +13 -0
- package/lib/types/controllers/editor/data-sync.controller.d.ts +27 -0
- package/lib/types/controllers/editor/editing.render-controller.d.ts +8 -34
- package/lib/types/controllers/editor/formula-editor.controller.d.ts +3 -14
- package/lib/types/controllers/editor/utils/isRangeSelector.d.ts +17 -0
- package/lib/types/controllers/menu/delete.menu.d.ts +1 -1
- package/lib/types/controllers/menu/insert.menu.d.ts +1 -1
- package/lib/types/controllers/permission/sheet-permission-init.controller.d.ts +0 -2
- package/lib/types/controllers/permission/sheet-permission-view-model.controller.d.ts +11 -0
- package/lib/types/controllers/render-controllers/editor-bridge.render-controller.d.ts +17 -5
- package/lib/types/index.d.ts +2 -1
- package/lib/types/services/editor/cell-editor-resize.service.d.ts +35 -0
- package/lib/types/services/editor-bridge.service.d.ts +39 -7
- package/lib/types/services/hover-manager.service.d.ts +1 -1
- package/lib/types/services/permission/sheet-permission-panel.model.d.ts +2 -2
- package/lib/types/services/selection/selection-render.service.d.ts +2 -2
- package/lib/umd/index.js +8 -8
- package/package.json +12 -12
- package/LICENSE +0 -176
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export declare const SHEET_ZOOM_RANGE: number[];
|
|
17
|
+
/**
|
|
18
|
+
* TODO@ggg: To avoid introducing the range-selector of the sheet-formula-ui package into sheet-ui, use a component key for now
|
|
19
|
+
*/
|
|
20
|
+
export declare const RANGE_SELECTOR_COMPONENT_KEY = "RANGE_SELECTOR_COMPONENT_KEY";
|
|
17
21
|
export declare enum SHEET_VIEW_KEY {
|
|
18
22
|
MAIN = "__SpreadsheetRender__",
|
|
19
23
|
ROW = "__SpreadsheetRowHeader__",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Disposable, ICommandService } from '@univerjs/core';
|
|
2
|
+
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
3
|
+
import { HoverManagerService } from '../services/hover-manager.service';
|
|
4
|
+
export declare class SheetCheckboxController extends Disposable {
|
|
5
|
+
private _hoverManagerService;
|
|
6
|
+
private readonly _commandService;
|
|
7
|
+
private readonly _renderManagerService;
|
|
8
|
+
private _isPointer;
|
|
9
|
+
constructor(_hoverManagerService: HoverManagerService, _commandService: ICommandService, _renderManagerService: IRenderManagerService);
|
|
10
|
+
private get _mainComponent();
|
|
11
|
+
private _initHover;
|
|
12
|
+
private _initPointerEvent;
|
|
13
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
3
|
+
import { RangeProtectionRuleModel, WorksheetProtectionRuleModel } from '@univerjs/sheets';
|
|
4
|
+
import { IEditorBridgeService } from '../../services/editor-bridge.service';
|
|
5
|
+
import { FormulaEditorController } from './formula-editor.controller';
|
|
6
|
+
/**
|
|
7
|
+
* sync data between cell editor and formula editor
|
|
8
|
+
*/
|
|
9
|
+
export declare class EditorDataSyncController extends Disposable {
|
|
10
|
+
private readonly _univerInstanceService;
|
|
11
|
+
private readonly _renderManagerService;
|
|
12
|
+
private readonly _editorBridgeService;
|
|
13
|
+
private readonly _commandService;
|
|
14
|
+
private readonly _rangeProtectionRuleModel;
|
|
15
|
+
private readonly _worksheetProtectionRuleModel;
|
|
16
|
+
private readonly _formulaEditorController;
|
|
17
|
+
constructor(_univerInstanceService: IUniverInstanceService, _renderManagerService: IRenderManagerService, _editorBridgeService: IEditorBridgeService, _commandService: ICommandService, _rangeProtectionRuleModel: RangeProtectionRuleModel, _worksheetProtectionRuleModel: WorksheetProtectionRuleModel, _formulaEditorController: FormulaEditorController);
|
|
18
|
+
private _initialize;
|
|
19
|
+
private _getEditorViewModel;
|
|
20
|
+
private _syncFormulaEditorContent;
|
|
21
|
+
private _editorSyncHandler;
|
|
22
|
+
private _commandExecutedListener;
|
|
23
|
+
private _syncActionsAndRender;
|
|
24
|
+
private _syncContentAndRender;
|
|
25
|
+
private _checkAndSetRenderStyleConfig;
|
|
26
|
+
private _clearParagraph;
|
|
27
|
+
}
|
|
@@ -4,13 +4,11 @@ import { DocSelectionManagerService } from '@univerjs/docs';
|
|
|
4
4
|
import { IEditorService } from '@univerjs/docs-ui';
|
|
5
5
|
import { IFunctionService, LexerTreeBuilder } from '@univerjs/engine-formula';
|
|
6
6
|
import { SheetsSelectionsService } from '@univerjs/sheets';
|
|
7
|
-
import { ILayoutService } from '@univerjs/ui';
|
|
8
7
|
import { ICellEditorManagerService } from '../../services/editor/cell-editor-manager.service';
|
|
8
|
+
import { SheetCellEditorResizeService } from '../../services/editor/cell-editor-resize.service';
|
|
9
9
|
import { IEditorBridgeService } from '../../services/editor-bridge.service';
|
|
10
|
-
import { SheetSkeletonManagerService } from '../../services/sheet-skeleton-manager.service';
|
|
11
10
|
export declare class EditingRenderController extends Disposable implements IRenderModule {
|
|
12
11
|
private readonly _context;
|
|
13
|
-
private readonly _layoutService;
|
|
14
12
|
private readonly _undoRedoService;
|
|
15
13
|
private readonly _contextService;
|
|
16
14
|
private readonly _instanceSrv;
|
|
@@ -23,7 +21,7 @@ export declare class EditingRenderController extends Disposable implements IRend
|
|
|
23
21
|
private readonly _commandService;
|
|
24
22
|
protected readonly _localService: LocaleService;
|
|
25
23
|
private readonly _editorService;
|
|
26
|
-
private readonly
|
|
24
|
+
private readonly _sheetCellEditorResizeService;
|
|
27
25
|
/**
|
|
28
26
|
* It is used to distinguish whether the user has actively moved the cursor in the editor, mainly through mouse clicks.
|
|
29
27
|
*/
|
|
@@ -33,54 +31,27 @@ export declare class EditingRenderController extends Disposable implements IRend
|
|
|
33
31
|
private _workbookSelections;
|
|
34
32
|
private _d;
|
|
35
33
|
_cursorTimeout: NodeJS.Timeout;
|
|
36
|
-
constructor(_context: IRenderContext<Workbook>,
|
|
34
|
+
constructor(_context: IRenderContext<Workbook>, selectionManagerService: SheetsSelectionsService, _undoRedoService: IUndoRedoService, _contextService: IContextService, _instanceSrv: IUniverInstanceService, _renderManagerService: IRenderManagerService, _editorBridgeService: IEditorBridgeService, _cellEditorManagerService: ICellEditorManagerService, _lexerTreeBuilder: LexerTreeBuilder, _functionService: IFunctionService, _textSelectionManagerService: DocSelectionManagerService, _commandService: ICommandService, _localService: LocaleService, _editorService: IEditorService, _sheetCellEditorResizeService: SheetCellEditorResizeService);
|
|
37
35
|
dispose(): void;
|
|
38
36
|
private _disposeCurrent;
|
|
39
37
|
private _init;
|
|
40
38
|
private _initEditorVisibilityListener;
|
|
41
39
|
private _listenEditorFocus;
|
|
42
|
-
private _getEditorSkeleton;
|
|
43
|
-
private _getEditorViewModel;
|
|
44
40
|
private _initialCursorSync;
|
|
45
41
|
private _initSkeletonListener;
|
|
46
|
-
resizeCellEditor(): void;
|
|
47
42
|
/**
|
|
48
43
|
* Should update current editing cell info when selection is changed.
|
|
49
44
|
* @param d DisposableCollection
|
|
50
45
|
*/
|
|
51
46
|
private _subscribeToCurrentCell;
|
|
52
|
-
private _fitTextSize;
|
|
53
|
-
/**
|
|
54
|
-
* Mainly used to pre-calculate the width of the editor,
|
|
55
|
-
* to determine whether it needs to be automatically widened.
|
|
56
|
-
*/
|
|
57
|
-
private _predictingSize;
|
|
58
|
-
private _getEditorMaxSize;
|
|
59
|
-
/**
|
|
60
|
-
* Mainly used to calculate the volume of scenes and objects,
|
|
61
|
-
* determine whether a scrollbar appears,
|
|
62
|
-
* and calculate the editor's boundaries relative to the browser.
|
|
63
|
-
*/
|
|
64
|
-
private _editAreaProcessing;
|
|
65
|
-
/**
|
|
66
|
-
* Since the document does not support cell background color, an additional rect needs to be added.
|
|
67
|
-
*/
|
|
68
|
-
private _addBackground;
|
|
69
|
-
private _handleEditorVisible;
|
|
70
|
-
private _resetBodyStyle;
|
|
71
|
-
/**
|
|
72
|
-
* Should activate the editor when the user inputs text.
|
|
73
|
-
* @param d DisposableCollection
|
|
74
|
-
*/
|
|
75
|
-
private _initialKeyboardListener;
|
|
76
|
-
private _showEditorByKeyboard;
|
|
77
47
|
/**
|
|
78
48
|
* Listen to document edits to refresh the size of the sheet editor, not for normal editor.
|
|
79
49
|
*/
|
|
80
50
|
private _commandExecutedListener;
|
|
51
|
+
private _handleEditorVisible;
|
|
52
|
+
private _handleEditorInvisible;
|
|
81
53
|
private _setOpenForCurrent;
|
|
82
54
|
private _getEditorObject;
|
|
83
|
-
private _handleEditorInvisible;
|
|
84
55
|
submitCellData(documentDataModel: DocumentDataModel): Promise<void>;
|
|
85
56
|
private _submitCellData;
|
|
86
57
|
private _exitInput;
|
|
@@ -92,6 +63,9 @@ export declare class EditingRenderController extends Disposable implements IRend
|
|
|
92
63
|
private _cursorStateListener;
|
|
93
64
|
private _moveInEditor;
|
|
94
65
|
private _isCurrentSheetFocused;
|
|
66
|
+
private _getEditorSkeleton;
|
|
67
|
+
private _getEditorViewModel;
|
|
68
|
+
private _emptyDocumentDataModel;
|
|
95
69
|
}
|
|
96
70
|
export declare function getCellDataByInput(cellData: ICellData, documentDataModel: Nullable<DocumentDataModel>, lexerTreeBuilder: LexerTreeBuilder, getSnapshot: (data: DocumentDataModel) => IDocumentData, localeService: LocaleService, functionService: IFunctionService): ICellData | null;
|
|
97
71
|
export declare function isRichText(body: IDocumentBody): boolean;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ICommandService, IContextService, IUndoRedoService, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
|
2
2
|
import { DocSelectionManagerService } from '@univerjs/docs';
|
|
3
3
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
4
|
-
import { RangeProtectionRuleModel, WorksheetProtectionRuleModel } from '@univerjs/sheets';
|
|
5
4
|
import { IFormulaEditorManagerService } from '../../services/editor/formula-editor-manager.service';
|
|
6
5
|
import { IEditorBridgeService } from '../../services/editor-bridge.service';
|
|
7
6
|
export declare class FormulaEditorController extends RxDisposable {
|
|
@@ -12,26 +11,16 @@ export declare class FormulaEditorController extends RxDisposable {
|
|
|
12
11
|
private readonly _contextService;
|
|
13
12
|
private readonly _formulaEditorManagerService;
|
|
14
13
|
private readonly _undoRedoService;
|
|
15
|
-
private readonly _rangeProtectionRuleModel;
|
|
16
|
-
private readonly _worksheetProtectionRuleModel;
|
|
17
14
|
private readonly _textSelectionManagerService;
|
|
18
15
|
private _loadedMap;
|
|
19
|
-
constructor(_univerInstanceService: IUniverInstanceService, _renderManagerService: IRenderManagerService, _editorBridgeService: IEditorBridgeService, _commandService: ICommandService, _contextService: IContextService, _formulaEditorManagerService: IFormulaEditorManagerService, _undoRedoService: IUndoRedoService,
|
|
16
|
+
constructor(_univerInstanceService: IUniverInstanceService, _renderManagerService: IRenderManagerService, _editorBridgeService: IEditorBridgeService, _commandService: ICommandService, _contextService: IContextService, _formulaEditorManagerService: IFormulaEditorManagerService, _undoRedoService: IUndoRedoService, _textSelectionManagerService: DocSelectionManagerService);
|
|
20
17
|
private _initialize;
|
|
18
|
+
private _handleContentChange;
|
|
21
19
|
private _create;
|
|
22
20
|
private _listenFxBtnClick;
|
|
23
|
-
private _listenFoldBtnClick;
|
|
24
21
|
private _initialMain;
|
|
25
22
|
private _syncEditorSize;
|
|
26
23
|
private _scheduledCallback;
|
|
27
24
|
private _clearScheduledCallback;
|
|
28
|
-
|
|
29
|
-
private _editorSyncHandler;
|
|
30
|
-
private _commandExecutedListener;
|
|
31
|
-
private _syncActionsAndRender;
|
|
32
|
-
private _syncContentAndRender;
|
|
33
|
-
private _checkAndSetRenderStyleConfig;
|
|
34
|
-
private _clearParagraph;
|
|
35
|
-
private _autoScroll;
|
|
36
|
-
private _getEditorViewModel;
|
|
25
|
+
autoScroll(): void;
|
|
37
26
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare const RANGE_SELECTOR_SYMBOLS = "range-selector";
|
|
17
|
+
export declare const isRangeSelector: (unitId: string) => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
|
|
2
1
|
import { IAccessor } from '@univerjs/core';
|
|
2
|
+
import { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
|
|
3
3
|
export declare const DELETE_RANGE_MENU_ID = "sheet.menu.delete";
|
|
4
4
|
export declare function DeleteRangeMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<string>;
|
|
5
5
|
export declare function RemoveColMenuItemFactory(accessor: IAccessor): IMenuButtonItem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
|
|
2
1
|
import { IAccessor } from '@univerjs/core';
|
|
2
|
+
import { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
|
|
3
3
|
export declare const COL_INSERT_MENU_ID = "sheet.menu.col-insert";
|
|
4
4
|
export declare function ColInsertMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<string>;
|
|
5
5
|
export declare const ROW_INSERT_MENU_ID = "sheet.menu.row-insert";
|
|
@@ -21,8 +21,6 @@ export declare class SheetPermissionInitController extends Disposable {
|
|
|
21
21
|
private _initWorksheetPermissionPointsChange;
|
|
22
22
|
private _initWorksheetPermissionFromSnapshot;
|
|
23
23
|
private _initUserChange;
|
|
24
|
-
private _initViewModelByRangeInterceptor;
|
|
25
|
-
private _initViewModelBySheetInterceptor;
|
|
26
24
|
refreshPermission(unitId: string, permissionId: string): void;
|
|
27
25
|
private _refreshPermissionByCollaCreate;
|
|
28
26
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Disposable, IPermissionService } from '@univerjs/core';
|
|
2
|
+
import { RangeProtectionCache, SheetInterceptorService, WorksheetProtectionRuleModel } from '@univerjs/sheets';
|
|
3
|
+
export declare class SheetPermissionViewModelController extends Disposable {
|
|
4
|
+
private _permissionService;
|
|
5
|
+
private _worksheetProtectionRuleModel;
|
|
6
|
+
private _sheetInterceptorService;
|
|
7
|
+
private _rangeProtectionCache;
|
|
8
|
+
constructor(_permissionService: IPermissionService, _worksheetProtectionRuleModel: WorksheetProtectionRuleModel, _sheetInterceptorService: SheetInterceptorService, _rangeProtectionCache: RangeProtectionCache);
|
|
9
|
+
private _initViewModelByRangeInterceptor;
|
|
10
|
+
private _initViewModelBySheetInterceptor;
|
|
11
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Workbook, ICommandService, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
|
2
|
-
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
3
|
-
import { IRangeSelectorService } from '@univerjs/docs-ui';
|
|
1
|
+
import { Workbook, ICommandService, IContextService, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
|
2
|
+
import { IRenderContext, IRenderModule, IRenderManagerService } from '@univerjs/engine-render';
|
|
3
|
+
import { IEditorService, IRangeSelectorService } from '@univerjs/docs-ui';
|
|
4
4
|
import { SheetsSelectionsService } from '@univerjs/sheets';
|
|
5
5
|
import { IEditorBridgeService } from '../../services/editor-bridge.service';
|
|
6
|
+
import { SheetSkeletonManagerService } from '../../services/sheet-skeleton-manager.service';
|
|
6
7
|
export declare class EditorBridgeRenderController extends RxDisposable implements IRenderModule {
|
|
7
8
|
private readonly _context;
|
|
8
9
|
private readonly _instanceSrv;
|
|
@@ -10,18 +11,29 @@ export declare class EditorBridgeRenderController extends RxDisposable implement
|
|
|
10
11
|
private readonly _editorBridgeService;
|
|
11
12
|
private readonly _selectionManagerService;
|
|
12
13
|
private readonly _rangeSelectorService;
|
|
14
|
+
private readonly _contextService;
|
|
15
|
+
private readonly _renderManagerService;
|
|
16
|
+
private readonly _editorService;
|
|
17
|
+
private readonly _sheetSkeletonManagerService;
|
|
13
18
|
private _d;
|
|
14
|
-
constructor(_context: IRenderContext<Workbook>, _instanceSrv: IUniverInstanceService, _commandService: ICommandService, _editorBridgeService: IEditorBridgeService, _selectionManagerService: SheetsSelectionsService, _rangeSelectorService: IRangeSelectorService);
|
|
19
|
+
constructor(_context: IRenderContext<Workbook>, _instanceSrv: IUniverInstanceService, _commandService: ICommandService, _editorBridgeService: IEditorBridgeService, _selectionManagerService: SheetsSelectionsService, _rangeSelectorService: IRangeSelectorService, _contextService: IContextService, _renderManagerService: IRenderManagerService, _editorService: IEditorService, _sheetSkeletonManagerService: SheetSkeletonManagerService);
|
|
15
20
|
private _init;
|
|
16
21
|
private _disposeCurrent;
|
|
17
22
|
private _initSelectionChangeListener;
|
|
18
23
|
private _updateEditorPosition;
|
|
19
24
|
private _initEventListener;
|
|
25
|
+
/**
|
|
26
|
+
* Should activate the editor when the user inputs text.
|
|
27
|
+
* @param d DisposableCollection
|
|
28
|
+
*/
|
|
29
|
+
private _initialKeyboardListener;
|
|
30
|
+
private _commandExecutedListener;
|
|
31
|
+
private _showEditorByKeyboard;
|
|
20
32
|
private _tryHideEditor;
|
|
21
33
|
private _hideEditor;
|
|
22
34
|
private _initialRangeSelector;
|
|
23
35
|
private _rangeSelector;
|
|
24
36
|
private _getCurrentUnitIdAndSheetId;
|
|
25
37
|
private _getSheetObject;
|
|
26
|
-
private
|
|
38
|
+
private _isCurrentSheetFocused;
|
|
27
39
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ export { DragManagerService } from './services/drag-manager.service';
|
|
|
59
59
|
export { CellAlertManagerService, CellAlertType, type ICellAlert } from './services/cell-alert-manager.service';
|
|
60
60
|
export { HoverRenderController } from './controllers/hover-render.controller';
|
|
61
61
|
export { DragRenderController } from './controllers/drag-render.controller';
|
|
62
|
-
export { SHEET_VIEW_KEY } from './common/keys';
|
|
62
|
+
export { RANGE_SELECTOR_COMPONENT_KEY, SHEET_VIEW_KEY } from './common/keys';
|
|
63
63
|
export { type ICanvasPopup, SheetCanvasPopManagerService } from './services/canvas-pop-manager.service';
|
|
64
64
|
export { mergeSetRangeValues } from './services/clipboard/utils';
|
|
65
65
|
export type { IAutoFillLocation } from './services/auto-fill/type';
|
|
@@ -90,6 +90,7 @@ export { FONT_FAMILY_COMPONENT, FONT_FAMILY_ITEM_COMPONENT } from './components/
|
|
|
90
90
|
export { FONT_SIZE_COMPONENT } from './components/font-size/interface';
|
|
91
91
|
export { attachPrimaryWithCoord, attachSelectionWithCoord } from './services/selection/util';
|
|
92
92
|
export { SELECTION_SHAPE_DEPTH } from './services/selection/const';
|
|
93
|
+
export { isRangeSelector, RANGE_SELECTOR_SYMBOLS } from './controllers/editor/utils/isRangeSelector';
|
|
93
94
|
export { menuSchema } from './controllers/menu.schema';
|
|
94
95
|
export { getCellRealRange } from './common/utils';
|
|
95
96
|
export { AddWorksheetMergeAllCommand, AddWorksheetMergeCommand, AddWorksheetMergeHorizontalCommand, AddWorksheetMergeVerticalCommand } from './commands/commands/add-worksheet-merge.command';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Workbook, Disposable } from '@univerjs/core';
|
|
2
|
+
import { IRenderContext, IRenderModule, IRenderManagerService } from '@univerjs/engine-render';
|
|
3
|
+
import { ILayoutService } from '@univerjs/ui';
|
|
4
|
+
import { IEditorBridgeService } from '../editor-bridge.service';
|
|
5
|
+
import { SheetSkeletonManagerService } from '../sheet-skeleton-manager.service';
|
|
6
|
+
import { ICellEditorManagerService } from './cell-editor-manager.service';
|
|
7
|
+
export declare class SheetCellEditorResizeService extends Disposable implements IRenderModule {
|
|
8
|
+
private readonly _context;
|
|
9
|
+
private readonly _layoutService;
|
|
10
|
+
private readonly _cellEditorManagerService;
|
|
11
|
+
private readonly _editorBridgeService;
|
|
12
|
+
private readonly _renderManagerService;
|
|
13
|
+
private readonly _sheetSkeletonManagerService;
|
|
14
|
+
constructor(_context: IRenderContext<Workbook>, _layoutService: ILayoutService, _cellEditorManagerService: ICellEditorManagerService, _editorBridgeService: IEditorBridgeService, _renderManagerService: IRenderManagerService, _sheetSkeletonManagerService: SheetSkeletonManagerService);
|
|
15
|
+
fitTextSize(callback?: () => void): void;
|
|
16
|
+
/**
|
|
17
|
+
* Mainly used to pre-calculate the width of the editor,
|
|
18
|
+
* to determine whether it needs to be automatically widened.
|
|
19
|
+
*/
|
|
20
|
+
private _predictingSize;
|
|
21
|
+
private _getEditorMaxSize;
|
|
22
|
+
/**
|
|
23
|
+
* Mainly used to calculate the volume of scenes and objects,
|
|
24
|
+
* determine whether a scrollbar appears,
|
|
25
|
+
* and calculate the editor's boundaries relative to the browser.
|
|
26
|
+
*/
|
|
27
|
+
private _editAreaProcessing;
|
|
28
|
+
/**
|
|
29
|
+
* Since the document does not support cell background color, an additional rect needs to be added.
|
|
30
|
+
*/
|
|
31
|
+
private _addBackground;
|
|
32
|
+
resizeCellEditor(callback?: () => void): void;
|
|
33
|
+
private _getEditorObject;
|
|
34
|
+
private _getEditorSkeleton;
|
|
35
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICellData, ICellDataForSheetInterceptor, IDisposable, IPosition, ISelectionCell, Nullable, Disposable, IContextService, InterceptorManager, IUniverInstanceService, ThemeService } from '@univerjs/core';
|
|
1
|
+
import { ICellData, ICellDataForSheetInterceptor, IDisposable, IPosition, ISelectionCell, Nullable, Workbook, Worksheet, Disposable, IContextService, InterceptorManager, IUniverInstanceService, ThemeService } from '@univerjs/core';
|
|
2
2
|
import { Engine, IDocumentLayoutObject, Scene, DeviceInputEventType, IRenderManagerService } from '@univerjs/engine-render';
|
|
3
3
|
import { ISheetLocation, SheetsSelectionsService } from '@univerjs/sheets';
|
|
4
4
|
import { KeyCode } from '@univerjs/ui';
|
|
@@ -17,21 +17,25 @@ export interface ICurrentEditCellParam {
|
|
|
17
17
|
sheetId: string;
|
|
18
18
|
primary: ISelectionCell;
|
|
19
19
|
}
|
|
20
|
-
export interface
|
|
20
|
+
export interface ICellEditorState {
|
|
21
21
|
unitId: string;
|
|
22
22
|
sheetId: string;
|
|
23
23
|
row: number;
|
|
24
24
|
column: number;
|
|
25
|
+
documentLayoutObject: IDocumentLayoutObject;
|
|
26
|
+
editorUnitId: string;
|
|
27
|
+
isInArrayFormulaRange?: Nullable<boolean>;
|
|
28
|
+
}
|
|
29
|
+
export interface ICellEditorLayout {
|
|
25
30
|
position: IPosition;
|
|
26
31
|
canvasOffset: {
|
|
27
32
|
left: number;
|
|
28
33
|
top: number;
|
|
29
34
|
};
|
|
30
|
-
documentLayoutObject: IDocumentLayoutObject;
|
|
31
35
|
scaleX: number;
|
|
32
36
|
scaleY: number;
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
}
|
|
38
|
+
export interface IEditorBridgeServiceParam extends ICellEditorState, ICellEditorLayout {
|
|
35
39
|
}
|
|
36
40
|
interface ISheetLocationForEditor extends ISheetLocation {
|
|
37
41
|
origin: Nullable<ICellData>;
|
|
@@ -40,7 +44,9 @@ declare const BEFORE_CELL_EDIT: import('@univerjs/core').IInterceptor<ICellDataF
|
|
|
40
44
|
declare const AFTER_CELL_EDIT: import('@univerjs/core').IInterceptor<ICellDataForSheetInterceptor, ISheetLocationForEditor>;
|
|
41
45
|
declare const AFTER_CELL_EDIT_ASYNC: import('@univerjs/core').IInterceptor<Promise<Nullable<ICellDataForSheetInterceptor>>, ISheetLocationForEditor>;
|
|
42
46
|
export interface IEditorBridgeService {
|
|
43
|
-
currentEditCellState$: Observable<Nullable<
|
|
47
|
+
currentEditCellState$: Observable<Nullable<ICellEditorState>>;
|
|
48
|
+
currentEditCellLayout$: Observable<Nullable<ICellEditorLayout>>;
|
|
49
|
+
currentEditCell$: Observable<Nullable<IEditorBridgeServiceParam>>;
|
|
44
50
|
visible$: Observable<IEditorBridgeServiceVisibleParam>;
|
|
45
51
|
interceptor: InterceptorManager<{
|
|
46
52
|
BEFORE_CELL_EDIT: typeof BEFORE_CELL_EDIT;
|
|
@@ -52,6 +58,8 @@ export interface IEditorBridgeService {
|
|
|
52
58
|
refreshEditCellPosition(resetSizeOnly?: boolean): void;
|
|
53
59
|
setEditCell(param: ICurrentEditCellParam): void;
|
|
54
60
|
getEditCellState(): Readonly<Nullable<IEditorBridgeServiceParam>>;
|
|
61
|
+
getEditCellLayout(): Readonly<Nullable<ICellEditorLayout>>;
|
|
62
|
+
getEditLocation(): Readonly<Nullable<ICellEditorState>>;
|
|
55
63
|
getLatestEditCellState(): Readonly<Nullable<IEditorBridgeServiceParam>>;
|
|
56
64
|
changeVisible(param: IEditorBridgeServiceVisibleParam): void;
|
|
57
65
|
changeEditorDirty(dirtyStatus: boolean): void;
|
|
@@ -61,6 +69,7 @@ export interface IEditorBridgeService {
|
|
|
61
69
|
disableForceKeepVisible(): void;
|
|
62
70
|
isForceKeepVisible(): boolean;
|
|
63
71
|
getCurrentEditorId(): Nullable<string>;
|
|
72
|
+
beforeSetRangeValue(workbook: Workbook, worksheet: Worksheet, row: number, column: number, cellData: ICellData): Promise<Nullable<ICellData>>;
|
|
64
73
|
}
|
|
65
74
|
export declare class EditorBridgeService extends Disposable implements IEditorBridgeService, IDisposable {
|
|
66
75
|
private readonly _renderManagerService;
|
|
@@ -72,11 +81,31 @@ export declare class EditorBridgeService extends Disposable implements IEditorBr
|
|
|
72
81
|
private _editorUnitId;
|
|
73
82
|
private _isForceKeepVisible;
|
|
74
83
|
private _editorIsDirty;
|
|
84
|
+
private _isDisabled;
|
|
75
85
|
private _visible;
|
|
76
86
|
private _currentEditCell;
|
|
77
87
|
private _currentEditCellState;
|
|
88
|
+
private _currentEditCellLayout;
|
|
78
89
|
private readonly _currentEditCellState$;
|
|
79
|
-
readonly currentEditCellState$: Observable<Nullable<
|
|
90
|
+
readonly currentEditCellState$: Observable<Nullable<ICellEditorState>>;
|
|
91
|
+
private readonly _currentEditCellLayout$;
|
|
92
|
+
readonly currentEditCellLayout$: Observable<Nullable<ICellEditorLayout>>;
|
|
93
|
+
readonly currentEditCell$: Observable<{
|
|
94
|
+
position: IPosition;
|
|
95
|
+
canvasOffset: {
|
|
96
|
+
left: number;
|
|
97
|
+
top: number;
|
|
98
|
+
};
|
|
99
|
+
scaleX: number;
|
|
100
|
+
scaleY: number;
|
|
101
|
+
unitId: string;
|
|
102
|
+
sheetId: string;
|
|
103
|
+
row: number;
|
|
104
|
+
column: number;
|
|
105
|
+
documentLayoutObject: IDocumentLayoutObject;
|
|
106
|
+
editorUnitId: string;
|
|
107
|
+
isInArrayFormulaRange?: Nullable<boolean>;
|
|
108
|
+
} | null>;
|
|
80
109
|
private readonly _visible$;
|
|
81
110
|
readonly visible$: Observable<IEditorBridgeServiceVisibleParam>;
|
|
82
111
|
private readonly _afterVisible$;
|
|
@@ -92,6 +121,8 @@ export declare class EditorBridgeService extends Disposable implements IEditorBr
|
|
|
92
121
|
setEditCell(param: ICurrentEditCellParam): void;
|
|
93
122
|
private _clearCurrentEditCellState;
|
|
94
123
|
getEditCellState(): Readonly<Nullable<IEditorBridgeServiceParam>>;
|
|
124
|
+
getEditCellLayout(): Readonly<Nullable<ICellEditorLayout>>;
|
|
125
|
+
getEditLocation(): Readonly<Nullable<ICellEditorState>>;
|
|
95
126
|
getLatestEditCellState(): {
|
|
96
127
|
position: {
|
|
97
128
|
startX: number;
|
|
@@ -121,6 +152,7 @@ export declare class EditorBridgeService extends Disposable implements IEditorBr
|
|
|
121
152
|
isForceKeepVisible(): boolean;
|
|
122
153
|
changeEditorDirty(dirtyStatus: boolean): void;
|
|
123
154
|
getEditorDirty(): boolean;
|
|
155
|
+
beforeSetRangeValue(workbook: Workbook, worksheet: Worksheet, row: number, column: number, cellData: ICellData): Promise<Nullable<ICellDataForSheetInterceptor>>;
|
|
124
156
|
}
|
|
125
157
|
export declare const IEditorBridgeService: import('@wendellhu/redi').IdentifierDecorator<EditorBridgeService>;
|
|
126
158
|
export {};
|
|
@@ -39,7 +39,7 @@ export declare class HoverManagerService extends Disposable {
|
|
|
39
39
|
rect: Nullable<IBoundRectNoAngle>;
|
|
40
40
|
} | null | undefined>;
|
|
41
41
|
currentPosition$: import('rxjs').Observable<Nullable<IHoverCellPosition>>;
|
|
42
|
-
currentClickedCell$: import('rxjs').Observable<
|
|
42
|
+
currentClickedCell$: import('rxjs').Observable<IHoverRichTextPosition>;
|
|
43
43
|
constructor(_univerInstanceService: IUniverInstanceService, _renderManagerService: IRenderManagerService);
|
|
44
44
|
dispose(): void;
|
|
45
45
|
private _initCellDisposableListener;
|
|
@@ -22,8 +22,8 @@ export declare class SheetPermissionPanelModel {
|
|
|
22
22
|
private _visible;
|
|
23
23
|
setVisible(v: boolean): void;
|
|
24
24
|
getVisible(): boolean;
|
|
25
|
-
rangeErrorMsg$: import('rxjs').Observable<string>;
|
|
26
|
-
setRangeErrorMsg(msg: string): void;
|
|
25
|
+
rangeErrorMsg$: import('rxjs').Observable<string | undefined>;
|
|
26
|
+
setRangeErrorMsg(msg: string | undefined): void;
|
|
27
27
|
rule$: import('rxjs').Observable<IPermissionPanelRule>;
|
|
28
28
|
get rule(): IPermissionPanelRule;
|
|
29
29
|
setRule(ruleObj: Partial<IPermissionPanelRule>): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ICommandService, IContextService, ILogService, Injector, ThemeService
|
|
1
|
+
import { Workbook, ICommandService, IContextService, ILogService, Injector, ThemeService } from '@univerjs/core';
|
|
2
|
+
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
2
3
|
import { SheetsSelectionsService } from '@univerjs/sheets';
|
|
3
4
|
import { IShortcutService } from '@univerjs/ui';
|
|
4
|
-
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
5
5
|
import { SheetSkeletonManagerService } from '../sheet-skeleton-manager.service';
|
|
6
6
|
import { BaseSelectionRenderService } from './base-selection-render.service';
|
|
7
7
|
/**
|