@univerjs/sheets-ui 0.1.0-beta.1 → 0.1.0-beta.3
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/{LICENSE.txt → LICENSE} +0 -2
- package/lib/cjs/index.js +13 -10
- package/lib/es/index.js +7936 -6974
- package/lib/index.css +1 -1
- package/lib/types/commands/commands/__tests__/create-command-test-bed.d.ts +25 -0
- package/lib/types/{components/font-size/FontSize.d.ts → commands/commands/__tests__/hide-row-col-confirm.command.spec.d.ts} +1 -3
- package/lib/types/{components/font-family/FontFamily.d.ts → commands/commands/__tests__/remove-row-col-confirm.command.spec.d.ts} +1 -3
- package/lib/types/commands/commands/__tests__/selection-utils.spec.d.ts +16 -0
- package/lib/types/commands/commands/auto-fill.command.d.ts +1 -11
- package/lib/types/commands/commands/delete-range-move-left-confirm.command .d.ts +17 -0
- package/lib/types/commands/commands/{set-selection-frozen.command.d.ts → delete-range-move-up-confirm.command.d.ts} +1 -1
- package/lib/types/commands/commands/hide-row-col-confirm.command.d.ts +18 -0
- package/lib/types/commands/commands/insert-range-move-down-confirm.command.d.ts +17 -0
- package/lib/types/commands/commands/insert-range-move-right-confirm.command.d.ts +17 -0
- package/lib/types/commands/commands/remove-row-col-confirm.command.d.ts +18 -0
- package/lib/types/commands/commands/set-scroll.command.d.ts +1 -1
- package/lib/types/commands/commands/utils/selection-utils.d.ts +14 -0
- package/lib/types/commands/operations/activate-cell-edit.operation.d.ts +2 -2
- package/lib/types/common/keys.d.ts +1 -0
- package/lib/types/components/font-family/index.d.ts +2 -2
- package/lib/types/components/font-family/interface.d.ts +0 -7
- package/lib/types/components/font-size/index.d.ts +1 -1
- package/lib/types/components/font-size/interface.d.ts +0 -7
- package/lib/types/components/menu-item-input/interface.d.ts +2 -0
- package/lib/types/controllers/auto-fill.controller.d.ts +13 -9
- package/lib/types/controllers/clipboard/clipboard.controller.d.ts +5 -1
- package/lib/types/controllers/clipboard/utils.d.ts +16 -14
- package/lib/types/{components/font-family/FontFamilyItem.d.ts → controllers/editor/__tests__/create-test-bed.d.ts} +10 -3
- package/lib/types/controllers/editor/__tests__/end-edit.controller.spec.d.ts +16 -0
- package/lib/types/controllers/editor/end-edit.controller.d.ts +3 -0
- package/lib/types/controllers/editor/formula-editor.controller.d.ts +1 -0
- package/lib/types/controllers/editor-bridge.controller.d.ts +2 -5
- package/lib/types/controllers/format-painter/format-painter.controller.d.ts +3 -3
- package/lib/types/controllers/freeze.controller.d.ts +11 -3
- package/lib/types/controllers/header-menu.controller.d.ts +4 -2
- package/lib/types/controllers/header-move.controller.d.ts +1 -1
- package/lib/types/controllers/menu/menu.d.ts +2 -10
- package/lib/types/controllers/menu/sheet.menu.d.ts +3 -3
- package/lib/types/controllers/scroll.controller.d.ts +2 -2
- package/lib/types/controllers/selection.controller.d.ts +4 -1
- package/lib/types/controllers/shortcuts/utils.d.ts +24 -5
- package/lib/types/controllers/shortcuts/view.shortcut.d.ts +3 -0
- package/lib/types/controllers/status-bar.controller.d.ts +5 -3
- package/lib/types/index.d.ts +2 -2
- package/lib/types/locale/en-US.d.ts +7 -18
- package/lib/types/locale/zh-CN.d.ts +7 -18
- package/lib/types/services/auto-fill/auto-fill.service.d.ts +33 -29
- package/lib/types/services/auto-fill/rules.d.ts +1 -0
- package/lib/types/services/auto-fill/tools.d.ts +11 -3
- package/lib/types/services/auto-fill/type.d.ts +23 -9
- package/lib/types/services/clipboard/__tests__/clipboard-test-bed.d.ts +1 -0
- package/lib/types/services/clipboard/copy-content-cache.d.ts +2 -2
- package/lib/types/services/clipboard/type.d.ts +16 -14
- package/lib/types/services/editor/formula-editor-manager.service.d.ts +4 -0
- package/lib/types/services/editor-bridge.service.d.ts +52 -13
- package/lib/types/services/mark-selection/mark-selection.service.d.ts +14 -2
- package/lib/types/services/selection/__test__/create-service-test-bed.d.ts +25 -0
- package/lib/types/services/selection/__test__/selection-render.test.d.ts +16 -0
- package/lib/types/services/selection/selection-render.service.d.ts +19 -3
- package/lib/types/services/selection/selection-shape-extension.d.ts +7 -2
- package/lib/types/services/selection/selection-shape.d.ts +1 -2
- package/lib/types/services/shortcut-experience.service.d.ts +45 -0
- package/lib/types/services/status-bar.service.d.ts +7 -4
- package/lib/types/views/header-menu-shape.d.ts +2 -2
- package/lib/types/views/header-resize-shape.d.ts +2 -2
- package/lib/types/views/header-unhide-shape.d.ts +2 -2
- package/lib/types/views/sheet-bar/sheet-bar-tabs/utils/slide-tab-bar.d.ts +3 -1
- package/lib/types/views/status-bar/CopyableStatisticItem.d.ts +2 -1
- package/lib/umd/index.js +13 -10
- package/package.json +48 -45
- /package/lib/types/views/count-bar/{zoom-slider.d.ts → ZoomSlider.d.ts} +0 -0
|
@@ -20,6 +20,7 @@ export interface IFormulaEditorManagerService {
|
|
|
20
20
|
position$: Observable<Nullable<DOMRect>>;
|
|
21
21
|
focus$: Observable<boolean>;
|
|
22
22
|
fxBtnClick$: Observable<boolean>;
|
|
23
|
+
foldBtnStatus$: Observable<boolean>;
|
|
23
24
|
dispose(): void;
|
|
24
25
|
setPosition(param: DOMRect): void;
|
|
25
26
|
getPosition(): Readonly<Nullable<DOMRect>>;
|
|
@@ -34,11 +35,14 @@ export declare class FormulaEditorManagerService implements IDisposable {
|
|
|
34
35
|
readonly focus$: Observable<boolean>;
|
|
35
36
|
private readonly _fxBtnClick$;
|
|
36
37
|
readonly fxBtnClick$: Observable<boolean>;
|
|
38
|
+
private readonly _foldBtnStatus$;
|
|
39
|
+
readonly foldBtnStatus$: Observable<boolean>;
|
|
37
40
|
dispose(): void;
|
|
38
41
|
setPosition(param: DOMRect): void;
|
|
39
42
|
getPosition(): Readonly<Nullable<DOMRect>>;
|
|
40
43
|
setFocus(param?: boolean): void;
|
|
41
44
|
handleFxBtnClick(params: boolean): void;
|
|
45
|
+
handleFoldBtnClick(params: boolean): void;
|
|
42
46
|
private _refresh;
|
|
43
47
|
}
|
|
44
48
|
export declare const IFormulaEditorManagerService: import("@wendellhu/redi").IdentifierDecorator<FormulaEditorManagerService>;
|
|
@@ -13,19 +13,28 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { ICellDataForSheetInterceptor, IPosition, Nullable } from '@univerjs/core';
|
|
17
|
-
import { Disposable, InterceptorManager } from '@univerjs/core';
|
|
18
|
-
import type { IDocumentLayoutObject } from '@univerjs/engine-render';
|
|
16
|
+
import type { ICellDataForSheetInterceptor, IPosition, ISelectionCell, Nullable } from '@univerjs/core';
|
|
17
|
+
import { Disposable, InterceptorManager, IUniverInstanceService, ThemeService } from '@univerjs/core';
|
|
18
|
+
import type { Engine, IDocumentLayoutObject, Scene } from '@univerjs/engine-render';
|
|
19
19
|
import { DeviceInputEventType } from '@univerjs/engine-render';
|
|
20
20
|
import type { ISheetLocation } from '@univerjs/sheets';
|
|
21
21
|
import type { KeyCode } from '@univerjs/ui';
|
|
22
22
|
import type { IDisposable } from '@wendellhu/redi';
|
|
23
23
|
import type { Observable } from 'rxjs';
|
|
24
|
+
import { ISelectionRenderService } from './selection/selection-render.service';
|
|
25
|
+
import { SheetSkeletonManagerService } from './sheet-skeleton-manager.service';
|
|
24
26
|
export interface IEditorBridgeServiceVisibleParam {
|
|
25
27
|
visible: boolean;
|
|
26
28
|
eventType: DeviceInputEventType;
|
|
27
29
|
keycode?: KeyCode;
|
|
28
30
|
}
|
|
31
|
+
export interface ICurrentEditCellParam {
|
|
32
|
+
scene: Scene;
|
|
33
|
+
engine: Engine;
|
|
34
|
+
unitId: string;
|
|
35
|
+
sheetId: string;
|
|
36
|
+
primary: ISelectionCell;
|
|
37
|
+
}
|
|
29
38
|
export interface IEditorBridgeServiceParam {
|
|
30
39
|
unitId: string;
|
|
31
40
|
sheetId: string;
|
|
@@ -45,15 +54,17 @@ export interface IEditorBridgeServiceParam {
|
|
|
45
54
|
declare const BEFORE_CELL_EDIT: import("@univerjs/core").IInterceptor<ICellDataForSheetInterceptor, ISheetLocation>;
|
|
46
55
|
declare const AFTER_CELL_EDIT: import("@univerjs/core").IInterceptor<ICellDataForSheetInterceptor, ISheetLocation>;
|
|
47
56
|
export interface IEditorBridgeService {
|
|
48
|
-
|
|
57
|
+
currentEditCellState$: Observable<Nullable<IEditorBridgeServiceParam>>;
|
|
49
58
|
visible$: Observable<IEditorBridgeServiceVisibleParam>;
|
|
50
59
|
interceptor: InterceptorManager<{
|
|
51
60
|
BEFORE_CELL_EDIT: typeof BEFORE_CELL_EDIT;
|
|
52
61
|
AFTER_CELL_EDIT: typeof AFTER_CELL_EDIT;
|
|
53
62
|
}>;
|
|
54
63
|
dispose(): void;
|
|
55
|
-
|
|
56
|
-
|
|
64
|
+
refreshEditCellState(): void;
|
|
65
|
+
setEditCell(param: ICurrentEditCellParam): void;
|
|
66
|
+
getEditCellState(): Readonly<Nullable<IEditorBridgeServiceParam>>;
|
|
67
|
+
getLatestEditCellState(): Readonly<Nullable<IEditorBridgeServiceParam>>;
|
|
57
68
|
changeVisible(param: IEditorBridgeServiceVisibleParam): void;
|
|
58
69
|
changeEditorDirty(dirtyStatus: boolean): void;
|
|
59
70
|
getEditorDirty(): boolean;
|
|
@@ -64,12 +75,18 @@ export interface IEditorBridgeService {
|
|
|
64
75
|
getCurrentEditorId(): Nullable<string>;
|
|
65
76
|
}
|
|
66
77
|
export declare class EditorBridgeService extends Disposable implements IEditorBridgeService, IDisposable {
|
|
67
|
-
private
|
|
78
|
+
private readonly _sheetSkeletonManagerService;
|
|
79
|
+
private readonly _selectionRenderService;
|
|
80
|
+
private readonly _themeService;
|
|
81
|
+
private readonly _currentUniverService;
|
|
82
|
+
private _editorUnitId;
|
|
68
83
|
private _isForceKeepVisible;
|
|
69
84
|
private _editorIsDirty;
|
|
70
85
|
private _visible;
|
|
71
|
-
private
|
|
72
|
-
|
|
86
|
+
private _currentEditCell;
|
|
87
|
+
private _currentEditCellState;
|
|
88
|
+
private readonly _currentEditCellState$;
|
|
89
|
+
readonly currentEditCellState$: Observable<Nullable<IEditorBridgeServiceParam>>;
|
|
73
90
|
private readonly _visible$;
|
|
74
91
|
readonly visible$: Observable<IEditorBridgeServiceVisibleParam>;
|
|
75
92
|
private readonly _afterVisible$;
|
|
@@ -78,10 +95,32 @@ export declare class EditorBridgeService extends Disposable implements IEditorBr
|
|
|
78
95
|
BEFORE_CELL_EDIT: import("@univerjs/core").IInterceptor<ICellDataForSheetInterceptor, ISheetLocation>;
|
|
79
96
|
AFTER_CELL_EDIT: import("@univerjs/core").IInterceptor<ICellDataForSheetInterceptor, ISheetLocation>;
|
|
80
97
|
}>;
|
|
81
|
-
constructor();
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
98
|
+
constructor(_sheetSkeletonManagerService: SheetSkeletonManagerService, _selectionRenderService: ISelectionRenderService, _themeService: ThemeService, _currentUniverService: IUniverInstanceService);
|
|
99
|
+
refreshEditCellState(): void;
|
|
100
|
+
setEditCell(param: ICurrentEditCellParam): void;
|
|
101
|
+
getEditCellState(): Readonly<Nullable<IEditorBridgeServiceParam>>;
|
|
102
|
+
getLatestEditCellState(): {
|
|
103
|
+
position: {
|
|
104
|
+
startX: number;
|
|
105
|
+
startY: number;
|
|
106
|
+
endX: number;
|
|
107
|
+
endY: number;
|
|
108
|
+
};
|
|
109
|
+
scaleX: number;
|
|
110
|
+
scaleY: number;
|
|
111
|
+
canvasOffset: {
|
|
112
|
+
left: number;
|
|
113
|
+
top: number;
|
|
114
|
+
};
|
|
115
|
+
row: number;
|
|
116
|
+
column: number;
|
|
117
|
+
unitId: string;
|
|
118
|
+
sheetId: string;
|
|
119
|
+
documentLayoutObject: IDocumentLayoutObject;
|
|
120
|
+
editorUnitId: string;
|
|
121
|
+
isInArrayFormulaRange: Nullable<boolean>;
|
|
122
|
+
} | undefined;
|
|
123
|
+
getCurrentEditorId(): string;
|
|
85
124
|
changeVisible(param: IEditorBridgeServiceVisibleParam): void;
|
|
86
125
|
isVisible(): IEditorBridgeServiceVisibleParam;
|
|
87
126
|
enableForceKeepVisible(): void;
|
|
@@ -18,12 +18,22 @@ import { IRenderManagerService } from '@univerjs/engine-render';
|
|
|
18
18
|
import type { ISelectionWithStyle } from '@univerjs/sheets';
|
|
19
19
|
import { SelectionManagerService } from '@univerjs/sheets';
|
|
20
20
|
import { ISelectionRenderService } from '../selection/selection-render.service';
|
|
21
|
+
import { SelectionShape } from '../selection/selection-shape';
|
|
21
22
|
import { SheetSkeletonManagerService } from '../sheet-skeleton-manager.service';
|
|
22
23
|
export interface IMarkSelectionService {
|
|
23
|
-
addShape(selection: ISelectionWithStyle, zIndex?: number): string | null;
|
|
24
|
+
addShape(selection: ISelectionWithStyle, exits?: string[], zIndex?: number): string | null;
|
|
24
25
|
removeShape(id: string): void;
|
|
25
26
|
removeAllShapes(): void;
|
|
26
27
|
refreshShapes(): void;
|
|
28
|
+
getShapeMap(): Map<string, IMarkSelectionInfo>;
|
|
29
|
+
}
|
|
30
|
+
interface IMarkSelectionInfo {
|
|
31
|
+
unitId: string;
|
|
32
|
+
subUnitId: string;
|
|
33
|
+
selection: ISelectionWithStyle;
|
|
34
|
+
zIndex: number;
|
|
35
|
+
control: SelectionShape | null;
|
|
36
|
+
exits: string[];
|
|
27
37
|
}
|
|
28
38
|
export declare const IMarkSelectionService: import("@wendellhu/redi").IdentifierDecorator<IMarkSelectionService>;
|
|
29
39
|
export declare class MarkSelectionService extends Disposable implements IMarkSelectionService {
|
|
@@ -36,8 +46,10 @@ export declare class MarkSelectionService extends Disposable implements IMarkSel
|
|
|
36
46
|
private readonly _selectionManagerService;
|
|
37
47
|
private _shapeMap;
|
|
38
48
|
constructor(_currentService: IUniverInstanceService, _renderManagerService: IRenderManagerService, _selectionRenderService: ISelectionRenderService, _commandService: ICommandService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _themeService: ThemeService, _selectionManagerService: SelectionManagerService);
|
|
39
|
-
addShape(selection: ISelectionWithStyle, zIndex?: number): string | null;
|
|
49
|
+
addShape(selection: ISelectionWithStyle, exits?: string[], zIndex?: number): string | null;
|
|
40
50
|
refreshShapes(): void;
|
|
51
|
+
getShapeMap(): Map<string, IMarkSelectionInfo>;
|
|
41
52
|
removeShape(id: string): void;
|
|
42
53
|
removeAllShapes(): void;
|
|
43
54
|
}
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
import type { IWorkbookData, Workbook } from '@univerjs/core';
|
|
17
|
+
import { Univer } from '@univerjs/core';
|
|
18
|
+
import type { Dependency } from '@wendellhu/redi';
|
|
19
|
+
import { Injector } from '@wendellhu/redi';
|
|
20
|
+
export interface ITestBed {
|
|
21
|
+
univer: Univer;
|
|
22
|
+
get: Injector['get'];
|
|
23
|
+
sheet: Workbook;
|
|
24
|
+
}
|
|
25
|
+
export declare function createCommandTestBed(workbookConfig?: IWorkbookData, dependencies?: Dependency[]): ITestBed;
|
|
@@ -0,0 +1,16 @@
|
|
|
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 {};
|
|
@@ -19,7 +19,9 @@ import type { IMouseEvent, IPointerEvent, Scene, SpreadsheetSkeleton, Viewport }
|
|
|
19
19
|
import { ScrollTimerType } from '@univerjs/engine-render';
|
|
20
20
|
import type { ISelectionStyle, ISelectionWithCoordAndStyle, ISelectionWithStyle } from '@univerjs/sheets';
|
|
21
21
|
import { IShortcutService } from '@univerjs/ui';
|
|
22
|
+
import { Injector } from '@wendellhu/redi';
|
|
22
23
|
import type { Observable } from 'rxjs';
|
|
24
|
+
import { SheetSkeletonManagerService } from '../sheet-skeleton-manager.service';
|
|
23
25
|
import { SelectionShape } from './selection-shape';
|
|
24
26
|
export interface IControlFillConfig {
|
|
25
27
|
oldRange: IRange;
|
|
@@ -45,6 +47,7 @@ export interface ISelectionRenderService {
|
|
|
45
47
|
enableSkipRemainLast(): void;
|
|
46
48
|
disableSkipRemainLast(): void;
|
|
47
49
|
addControlToCurrentByRangeData(data: ISelectionWithCoordAndStyle): void;
|
|
50
|
+
updateControlForCurrentByRangeData(selections: ISelectionWithCoordAndStyle[]): void;
|
|
48
51
|
changeRuntime(skeleton: SpreadsheetSkeleton, scene: Scene, viewport?: Viewport): void;
|
|
49
52
|
getViewPort(): Viewport;
|
|
50
53
|
getCurrentControls(): SelectionShape[];
|
|
@@ -57,11 +60,12 @@ export interface ISelectionRenderService {
|
|
|
57
60
|
convertCellRangeToInfo(primary: Nullable<ISelectionCell>): Nullable<ISelectionCellWithCoord>;
|
|
58
61
|
eventTrigger(evt: IPointerEvent | IMouseEvent, zIndex: number, rangeType: RANGE_TYPE, viewport?: Viewport, scrollTimerType?: ScrollTimerType): void;
|
|
59
62
|
reset(): void;
|
|
63
|
+
refreshSelectionMoveStart(): void;
|
|
60
64
|
}
|
|
61
65
|
/**
|
|
62
|
-
* TODO 注册selection拦截,可能在有公式ArrayObject时,fx公式栏显示不同
|
|
66
|
+
* TODO 注册 selection 拦截,可能在有公式 ArrayObject 时,fx 公式栏显示不同
|
|
63
67
|
*
|
|
64
|
-
* SelectionRenderService 维护viewModel数据list,action也是修改这一层数据,obs监听到数据变动后,自动刷新(control仍然可以持有数据)
|
|
68
|
+
* SelectionRenderService 维护 viewModel 数据 list,action 也是修改这一层数据,obs 监听到数据变动后,自动刷新(control 仍然可以持有数据)
|
|
65
69
|
*
|
|
66
70
|
* This service is related to the drawing of the selection.
|
|
67
71
|
* By modifying the properties of the service,
|
|
@@ -72,6 +76,8 @@ export interface ISelectionRenderService {
|
|
|
72
76
|
export declare class SelectionRenderService implements ISelectionRenderService {
|
|
73
77
|
private readonly _themeService;
|
|
74
78
|
private readonly _shortcutService;
|
|
79
|
+
private readonly _sheetSkeletonManagerService;
|
|
80
|
+
private readonly _injector;
|
|
75
81
|
hasSelection: boolean;
|
|
76
82
|
private _downObserver;
|
|
77
83
|
private _moveObserver;
|
|
@@ -107,7 +113,7 @@ export declare class SelectionRenderService implements ISelectionRenderService {
|
|
|
107
113
|
*/
|
|
108
114
|
readonly selectionMoveStart$: Observable<ISelectionWithCoordAndStyle[]>;
|
|
109
115
|
private _activeViewport;
|
|
110
|
-
constructor(_themeService: ThemeService, _shortcutService: IShortcutService);
|
|
116
|
+
constructor(_themeService: ThemeService, _shortcutService: IShortcutService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _injector: Injector);
|
|
111
117
|
enableHeaderHighlight(): void;
|
|
112
118
|
disableHeaderHighlight(): void;
|
|
113
119
|
enableDetectMergedCell(): void;
|
|
@@ -130,10 +136,20 @@ export declare class SelectionRenderService implements ISelectionRenderService {
|
|
|
130
136
|
* @returns
|
|
131
137
|
*/
|
|
132
138
|
addControlToCurrentByRangeData(data: ISelectionWithCoordAndStyle): void;
|
|
139
|
+
/**
|
|
140
|
+
* update selection
|
|
141
|
+
* @param selectionRange
|
|
142
|
+
* @param curCellRange
|
|
143
|
+
* @returns
|
|
144
|
+
*/
|
|
145
|
+
updateControlForCurrentByRangeData(selections: ISelectionWithCoordAndStyle[]): void;
|
|
146
|
+
refreshSelectionMoveStart(): void;
|
|
133
147
|
changeRuntime(skeleton: SpreadsheetSkeleton, scene: Scene, viewport?: Viewport): void;
|
|
134
148
|
getSelectionDataWithStyle(): ISelectionWithCoordAndStyle[];
|
|
135
149
|
getCurrentControls(): SelectionShape[];
|
|
136
150
|
private _clearSelectionControls;
|
|
151
|
+
private _getFreeze;
|
|
152
|
+
private _getViewportByCell;
|
|
137
153
|
/**
|
|
138
154
|
* Returns the list of active ranges in the active sheet or null if there are no active ranges.
|
|
139
155
|
* If there is a single range selected, this behaves as a getActiveRange() call.
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
16
|
+
import type { IRangeWithCoord, ThemeService } from '@univerjs/core';
|
|
17
17
|
import type { Scene, SpreadsheetSkeleton } from '@univerjs/engine-render';
|
|
18
|
+
import type { Injector } from '@wendellhu/redi';
|
|
18
19
|
import type { SelectionShape } from './selection-shape';
|
|
19
20
|
export interface ISelectionShapeTargetSelection {
|
|
20
21
|
originControl: SelectionShape;
|
|
@@ -25,6 +26,7 @@ export declare class SelectionShapeExtension {
|
|
|
25
26
|
private _skeleton;
|
|
26
27
|
private _scene;
|
|
27
28
|
private readonly _themeService;
|
|
29
|
+
private readonly _injector;
|
|
28
30
|
private _startOffsetX;
|
|
29
31
|
private _startOffsetY;
|
|
30
32
|
private _relativeSelectionPositionRow;
|
|
@@ -35,12 +37,15 @@ export declare class SelectionShapeExtension {
|
|
|
35
37
|
private _upObserver;
|
|
36
38
|
private _helperSelection;
|
|
37
39
|
private _scrollTimer;
|
|
40
|
+
private _activeViewport;
|
|
38
41
|
private _targetSelection;
|
|
39
42
|
private _isInMergeState;
|
|
40
43
|
private _fillControlColors;
|
|
41
|
-
constructor(_control: SelectionShape, _skeleton: SpreadsheetSkeleton, _scene: Scene, _themeService: ThemeService);
|
|
44
|
+
constructor(_control: SelectionShape, _skeleton: SpreadsheetSkeleton, _scene: Scene, _themeService: ThemeService, _injector: Injector);
|
|
42
45
|
get isHelperSelection(): boolean;
|
|
43
46
|
dispose(): void;
|
|
47
|
+
private _getFreeze;
|
|
48
|
+
private _isSelectionInViewport;
|
|
44
49
|
private _clearObserverEvent;
|
|
45
50
|
private _initialControl;
|
|
46
51
|
private _controlMoving;
|
|
@@ -94,6 +94,7 @@ export declare class SelectionShape {
|
|
|
94
94
|
get selectionStyle(): Nullable<ISelectionStyle>;
|
|
95
95
|
get dashRect(): Rect<import("@univerjs/engine-render").IRectProps>;
|
|
96
96
|
get isHelperSelection(): boolean;
|
|
97
|
+
setEvent(state: boolean): void;
|
|
97
98
|
enableHeaderHighlight(): void;
|
|
98
99
|
disableHeaderHighlight(): void;
|
|
99
100
|
refreshSelectionFilled(val: IRangeWithCoord): void;
|
|
@@ -125,6 +126,4 @@ export declare class SelectionShape {
|
|
|
125
126
|
private _updateWidgets;
|
|
126
127
|
private _hasWidgets;
|
|
127
128
|
private _getScale;
|
|
128
|
-
private _getPureScale;
|
|
129
|
-
private _getPixelRatio;
|
|
130
129
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
import type { ISelection, ITextRangeParam, Nullable } from '@univerjs/core';
|
|
17
|
+
import { IUniverInstanceService, LocaleService } from '@univerjs/core';
|
|
18
|
+
import type { KeyCode } from '@univerjs/ui';
|
|
19
|
+
import type { IDisposable } from '@wendellhu/redi';
|
|
20
|
+
export interface IShortcutExperienceSearch {
|
|
21
|
+
unitId: string;
|
|
22
|
+
sheetId: string;
|
|
23
|
+
keycode: KeyCode;
|
|
24
|
+
}
|
|
25
|
+
export interface IShortcutExperienceParam extends IShortcutExperienceSearch {
|
|
26
|
+
selection?: ISelection;
|
|
27
|
+
textSelection?: ITextRangeParam;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* This service is prepared for shortcut experience optimization,
|
|
31
|
+
* including the combined use of enter and tab, the highlighting experience of formulas in the editor, and so on.
|
|
32
|
+
*/
|
|
33
|
+
export declare class ShortcutExperienceService implements IDisposable {
|
|
34
|
+
private readonly _currentUniverService;
|
|
35
|
+
private readonly _localeService;
|
|
36
|
+
private _current;
|
|
37
|
+
private _shortcutParam;
|
|
38
|
+
constructor(_currentUniverService: IUniverInstanceService, _localeService: LocaleService);
|
|
39
|
+
dispose(): void;
|
|
40
|
+
getCurrentBySearch(searchParm: Nullable<IShortcutExperienceSearch>): Nullable<IShortcutExperienceParam>;
|
|
41
|
+
getCurrent(): Nullable<IShortcutExperienceParam>;
|
|
42
|
+
addOrUpdate(insertParam: IShortcutExperienceParam): Nullable<IShortcutExperienceParam>;
|
|
43
|
+
remove(searchParm: Nullable<IShortcutExperienceSearch>): Nullable<IShortcutExperienceParam>;
|
|
44
|
+
private _getCurrentBySearch;
|
|
45
|
+
}
|
|
@@ -24,10 +24,13 @@ export interface IStatusBarService {
|
|
|
24
24
|
getState(): Readonly<Nullable<IStatusBarServiceStatus>>;
|
|
25
25
|
getFunctions(): Readonly<IStatusBarFunction[]>;
|
|
26
26
|
}
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
export interface IStatusBarServiceStatus {
|
|
28
|
+
values: Array<{
|
|
29
|
+
func: IFunctionNames;
|
|
30
|
+
value: number;
|
|
31
|
+
}>;
|
|
32
|
+
pattern: Nullable<string>;
|
|
33
|
+
}
|
|
31
34
|
export interface IStatusBarFunction {
|
|
32
35
|
func: IFunctionNames;
|
|
33
36
|
filter?: (status: IStatusBarServiceStatus) => boolean;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IShapeProps } from '@univerjs/engine-render';
|
|
16
|
+
import type { IShapeProps, UniverRenderingContext } from '@univerjs/engine-render';
|
|
17
17
|
import { Shape } from '@univerjs/engine-render';
|
|
18
18
|
export interface IHeaderMenuShapeProps extends IShapeProps {
|
|
19
19
|
size?: number;
|
|
@@ -33,5 +33,5 @@ export declare class HeaderMenuShape<T extends IHeaderMenuShapeProps = IHeaderMe
|
|
|
33
33
|
private _mode;
|
|
34
34
|
constructor(key?: string, props?: T);
|
|
35
35
|
setShapeProps(props?: T): void;
|
|
36
|
-
protected _draw(ctx:
|
|
36
|
+
protected _draw(ctx: UniverRenderingContext): void;
|
|
37
37
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IShapeProps } from '@univerjs/engine-render';
|
|
16
|
+
import type { IShapeProps, UniverRenderingContext } from '@univerjs/engine-render';
|
|
17
17
|
import { Shape } from '@univerjs/engine-render';
|
|
18
18
|
export interface IHeaderMenuShapeResizeProps extends IShapeProps {
|
|
19
19
|
size?: number;
|
|
@@ -36,6 +36,6 @@ export declare class HeaderMenuResizeShape<T extends IHeaderMenuShapeResizeProps
|
|
|
36
36
|
get size(): number;
|
|
37
37
|
get mode(): HEADER_RESIZE_SHAPE_TYPE;
|
|
38
38
|
get color(): string;
|
|
39
|
-
protected _draw(ctx:
|
|
39
|
+
protected _draw(ctx: UniverRenderingContext): void;
|
|
40
40
|
setShapeProps(props?: T): this;
|
|
41
41
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IShapeProps } from '@univerjs/engine-render';
|
|
16
|
+
import type { IShapeProps, UniverRenderingContext } from '@univerjs/engine-render';
|
|
17
17
|
import { Shape } from '@univerjs/engine-render';
|
|
18
18
|
export declare const enum HeaderUnhideShapeType {
|
|
19
19
|
ROW = 0,
|
|
@@ -39,7 +39,7 @@ export declare class HeaderUnhideShape<T extends IHeaderUnhideShapeProps = IHead
|
|
|
39
39
|
private _unhideType;
|
|
40
40
|
constructor(key?: string, props?: T, onClick?: () => void);
|
|
41
41
|
setShapeProps(props: Partial<IHeaderUnhideShapeProps>): void;
|
|
42
|
-
protected _draw(ctx:
|
|
42
|
+
protected _draw(ctx: UniverRenderingContext): void;
|
|
43
43
|
private _drawOnRow;
|
|
44
44
|
/**
|
|
45
45
|
*
|
|
@@ -29,7 +29,7 @@ export interface SlideTabBarConfig {
|
|
|
29
29
|
currentIndex: number;
|
|
30
30
|
onSlideEnd: (event: MouseEvent, compareIndex: number) => void;
|
|
31
31
|
onChangeName: (id: string, name: string) => void;
|
|
32
|
-
onChangeTab: (event:
|
|
32
|
+
onChangeTab: (event: MouseEvent, id: string) => void;
|
|
33
33
|
onScroll: (state: IScrollState) => void;
|
|
34
34
|
onNameCheckAlert: (text: string) => boolean;
|
|
35
35
|
}
|
|
@@ -53,6 +53,8 @@ export declare class SlideTabItem {
|
|
|
53
53
|
static make(nodeList: NodeList, slideTabBar: SlideTabBar): SlideTabItem[];
|
|
54
54
|
getSlideTabItem(): HTMLElement;
|
|
55
55
|
getEditor(): HTMLSpanElement | null;
|
|
56
|
+
focus(): void;
|
|
57
|
+
selectAll(): void;
|
|
56
58
|
isEditMode(): boolean;
|
|
57
59
|
classList(): DOMTokenList;
|
|
58
60
|
translateX(x: number): 1 | 0 | -1;
|
|
@@ -20,11 +20,12 @@ export interface IStatisticItem {
|
|
|
20
20
|
value: number;
|
|
21
21
|
show: boolean;
|
|
22
22
|
disable: boolean;
|
|
23
|
+
pattern: string | null;
|
|
23
24
|
}
|
|
24
25
|
export declare const functionDisplayNames: FunctionNameMap;
|
|
25
26
|
interface FunctionNameMap {
|
|
26
27
|
[key: string]: string;
|
|
27
28
|
}
|
|
28
29
|
export declare const CopyableStatisticItem: React.FC<IStatisticItem>;
|
|
29
|
-
export declare function formatNumber(
|
|
30
|
+
export declare function formatNumber(item: IStatisticItem): string;
|
|
30
31
|
export {};
|