@univerjs/sheets-ui 0.5.4 → 0.5.5-experimental.20250123-34738ff
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 +44 -48
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +801 -474
- package/lib/es/index.js +17258 -16471
- package/lib/es/locale/en-US.js +2 -2
- package/lib/es/locale/fa-IR.js +2 -2
- package/lib/es/locale/fr-FR.js +2 -2
- package/lib/es/locale/ru-RU.js +2 -2
- package/lib/es/locale/vi-VN.js +2 -2
- package/lib/es/locale/zh-CN.js +2 -2
- package/lib/es/locale/zh-TW.js +2 -2
- package/lib/index.css +1 -1
- package/lib/types/commands/commands/clipboard.command.d.ts +1 -0
- package/lib/types/commands/commands/set-selection.command.d.ts +5 -0
- package/lib/types/common/keys.d.ts +1 -0
- package/lib/types/components/border-panel/BorderPanel.d.ts +1 -2
- package/lib/types/components/border-panel/border-line/BorderLine.d.ts +1 -2
- package/lib/types/components/border-panel/border-line/icons/BorderDashDot.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderDashDotDot.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderDashed.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderDotted.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderHair.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderMedium.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderMediumDashDot.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderMediumDashDotDot.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderMediumDashed.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderThick.d.ts +16 -2
- package/lib/types/components/border-panel/border-line/icons/BorderThin.d.ts +16 -2
- package/lib/types/components/menu-item-input/MenuItemInput.d.ts +1 -2
- package/lib/types/controllers/clipboard/clipboard.controller.d.ts +1 -0
- package/lib/types/controllers/clipboard/utils.d.ts +0 -11
- package/lib/types/controllers/editor/data-sync.controller.d.ts +3 -1
- package/lib/types/controllers/editor/editing.render-controller.d.ts +3 -4
- package/lib/types/controllers/editor/formula-editor.controller.d.ts +4 -2
- package/lib/types/controllers/render-controllers/freeze.render-controller.d.ts +6 -2
- package/lib/types/facade/f-event.d.ts +296 -22
- package/lib/types/facade/f-permission.d.ts +3 -0
- package/lib/types/facade/f-range.d.ts +42 -2
- package/lib/types/facade/f-sheet-hooks.d.ts +3 -0
- package/lib/types/facade/f-univer.d.ts +11 -1
- package/lib/types/facade/f-workbook.d.ts +21 -24
- package/lib/types/facade/f-worksheet.d.ts +29 -5
- package/lib/types/index.d.ts +2 -1
- package/lib/types/services/auto-fill/tools.d.ts +5 -0
- package/lib/types/services/canvas-pop-manager.service.d.ts +41 -6
- package/lib/types/services/clipboard/clipboard.service.d.ts +5 -2
- package/lib/types/services/clipboard/type.d.ts +69 -5
- package/lib/types/services/clipboard/utils.d.ts +1 -1
- package/lib/types/services/editor/cell-editor-resize.service.d.ts +3 -2
- package/lib/types/services/editor-bridge.service.d.ts +3 -1
- package/lib/types/services/hover-manager.service.d.ts +41 -0
- package/lib/types/services/selection/base-selection-render.service.d.ts +4 -0
- package/lib/types/services/selection/selection-control.d.ts +2 -2
- package/lib/types/services/sheet-skeleton-manager.service.d.ts +2 -1
- package/lib/types/views/cell-alert/CellAlertPopup.d.ts +1 -2
- package/lib/types/views/clipboard/ClipboardPopupMenu.d.ts +16 -2
- package/lib/types/views/count-bar/CountBar.d.ts +16 -2
- package/lib/types/views/count-bar/ZoomSlider.d.ts +16 -2
- package/lib/types/views/defined-name/DefinedName.d.ts +16 -2
- package/lib/types/views/defined-name/DefinedNameContainer.d.ts +16 -2
- package/lib/types/views/defined-name/DefinedNameInput.d.ts +1 -2
- package/lib/types/views/defined-name/DefinedNameOverlay.d.ts +16 -2
- package/lib/types/views/editor-container/hooks.d.ts +8 -0
- package/lib/types/views/formula-bar/FormulaBar.d.ts +16 -2
- package/lib/types/views/mobile/sheet-bar/MobileSheetBar.d.ts +16 -2
- package/lib/types/views/permission/error-msg-dialog/index.d.ts +16 -2
- package/lib/types/views/permission/panel/index.d.ts +1 -2
- package/lib/types/views/permission/panel-detail/PermissionDetailFooterPart.d.ts +1 -2
- package/lib/types/views/permission/panel-detail/PermissionDetailMainPart.d.ts +1 -1
- package/lib/types/views/permission/panel-detail/PermissionDetailPanel.d.ts +1 -2
- package/lib/types/views/permission/panel-detail/PermissionDetailUserPart.d.ts +1 -2
- package/lib/types/views/permission/panel-list/index.d.ts +16 -2
- package/lib/types/views/permission/permission-dialog/index.d.ts +16 -2
- package/lib/types/views/permission/spin/index.d.ts +1 -1
- package/lib/types/views/permission/user-dialog/index.d.ts +16 -2
- package/lib/types/views/sheet-bar/SheetBar.d.ts +16 -2
- package/lib/types/views/sheet-bar/sheet-bar-button/SheetBarButton.d.ts +1 -1
- package/lib/types/views/sheet-bar/sheet-bar-menu/SheetBarMenu.d.ts +1 -1
- package/lib/types/views/sheet-bar/sheet-bar-tabs/SheetBarItem.d.ts +1 -1
- package/lib/types/views/sheet-bar/sheet-bar-tabs/SheetBarTabs.d.ts +16 -2
- package/lib/types/views/sheet-container/SheetContainer.d.ts +18 -4
- package/lib/types/views/status-bar/StatusBar.d.ts +16 -2
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +44 -48
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +16 -16
- package/LICENSE +0 -176
- package/lib/types/commands/commands/__tests__/add-worksheet-merge.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/auto-fill.controller.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/create-command-test-bed.d.ts +0 -7
- package/lib/types/commands/commands/__tests__/create-selection-command-test-bed.d.ts +0 -28
- package/lib/types/commands/commands/__tests__/create-sheet-skeleton-test-bed.d.ts +0 -22
- package/lib/types/commands/commands/__tests__/hide-row-col-confirm.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/remove-row-col-confirm.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/selection-utils.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-format-painter.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-frozen.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/set-selections.command.spec.d.ts +0 -16
- package/lib/types/commands/commands/__tests__/sheet-skeleton.spec.d.ts +0 -16
- package/lib/types/controllers/editor/__tests__/create-test-bed.d.ts +0 -7
- package/lib/types/controllers/editor/__tests__/end-edit.controller.spec.d.ts +0 -16
- package/lib/types/controllers/editor/__tests__/mock-function.service.d.ts +0 -5
- package/lib/types/controllers/menu/__tests__/create-menu-test-bed.d.ts +0 -13
- package/lib/types/controllers/menu/__tests__/menu.spec.d.ts +0 -16
- package/lib/types/controllers/menu/__tests__/row-col.menu.spec.d.ts +0 -16
- package/lib/types/controllers/utils/__tests__/cell-tools.spec.d.ts +0 -16
- package/lib/types/facade/__tests__/create-test-bed.d.ts +0 -10
- package/lib/types/facade/__tests__/f-sheet-hooks.spec.d.ts +0 -16
- package/lib/types/services/auto-fill/__tests__/tool.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-copy-filter.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-paste-alignment.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-paste-border.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-paste-col-width.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-paste-font.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-paste-form-excel.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-paste-from-google.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-paste-from-notepad.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-paste-rotate.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-service.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/clipboard-test-bed.d.ts +0 -29
- package/lib/types/services/clipboard/__tests__/constant.d.ts +0 -28
- package/lib/types/services/clipboard/__tests__/mock-clipboard.d.ts +0 -39
- package/lib/types/services/clipboard/__tests__/sheet-paste.spec.d.ts +0 -16
- package/lib/types/services/clipboard/__tests__/utils.spec.d.ts +0 -16
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { IDisposable, Nullable } from '@univerjs/core';
|
|
2
2
|
import { IMouseEvent, IPointerEvent } from '@univerjs/engine-render';
|
|
3
3
|
import { ICellPosWithEvent, IDragCellPosition, IHoverRichTextInfo, IHoverRichTextPosition, IScrollState } from '@univerjs/sheets-ui';
|
|
4
|
+
import { ICellEventParam } from './f-event';
|
|
4
5
|
import { FWorkbook } from '@univerjs/sheets/facade';
|
|
5
6
|
import { IDialogPartMethodOptions, ISidebarMethodOptions } from '@univerjs/ui';
|
|
6
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @ignore
|
|
9
|
+
*/
|
|
7
10
|
export interface IFWorkbookSheetsUIMixin {
|
|
8
11
|
/**
|
|
9
12
|
* Open a sidebar.
|
|
@@ -20,33 +23,32 @@ export interface IFWorkbookSheetsUIMixin {
|
|
|
20
23
|
*/
|
|
21
24
|
openDialog(dialog: IDialogPartMethodOptions): IDisposable;
|
|
22
25
|
/**
|
|
23
|
-
*
|
|
24
|
-
* @param callback - The callback function to be called when a cell is clicked
|
|
25
|
-
* @returns A disposable object that can be used to unsubscribe from the event
|
|
26
|
+
* @deprecated use `univerAPI.addEvent(univerAPI.Event.CellClick, () => {})` instead
|
|
26
27
|
*/
|
|
27
28
|
onCellClick(callback: (cell: IHoverRichTextInfo) => void): IDisposable;
|
|
28
29
|
/**
|
|
29
|
-
*
|
|
30
|
-
* @param callback - The callback function to be called when a cell is hovered
|
|
31
|
-
* @returns A disposable object that can be used to unsubscribe from the event
|
|
30
|
+
* @deprecated use `univerAPI.addEvent(univerAPI.Event.CellHover, () => {})` instead
|
|
32
31
|
*/
|
|
33
32
|
onCellHover(callback: (cell: IHoverRichTextPosition) => void): IDisposable;
|
|
34
33
|
/**
|
|
35
|
-
*
|
|
36
|
-
* @param {function(ICellPosWithEvent): any} callback The callback function accept cell location and event.
|
|
34
|
+
* @deprecated use `univerAPI.addEvent(univerAPI.Event.CellPointerMove, () => {})` instead
|
|
37
35
|
*/
|
|
38
36
|
onCellPointerMove(callback: (cell: ICellPosWithEvent, event: IPointerEvent | IMouseEvent) => void): IDisposable;
|
|
39
37
|
/**
|
|
40
|
-
*
|
|
41
|
-
* @param {function(ICellPosWithEvent): any} callback The callback function accept cell location and event.
|
|
38
|
+
* @deprecated use `univerAPI.addEvent(univerAPI.Event.CellPointerDown, () => {})` instead
|
|
42
39
|
*/
|
|
43
40
|
onCellPointerDown(callback: (cell: ICellPosWithEvent) => void): IDisposable;
|
|
44
41
|
/**
|
|
45
|
-
*
|
|
46
|
-
* @param {function(ICellPosWithEvent): any} callback The callback function accept cell location and event.
|
|
42
|
+
* @deprecated use `univerAPI.addEvent(univerAPI.Event.CellPointerUp, () => {})` instead
|
|
47
43
|
*/
|
|
48
44
|
onCellPointerUp(callback: (cell: ICellPosWithEvent) => void): IDisposable;
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated use `univerAPI.addEvent(univerAPI.Event.DragOver, () => {})` instead
|
|
47
|
+
*/
|
|
49
48
|
onDragOver(callback: (cell: IDragCellPosition) => void): IDisposable;
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated use `univerAPI.addEvent(univerAPI.Event.Drop, () => {})` instead
|
|
51
|
+
*/
|
|
50
52
|
onDrop(callback: (cell: IDragCellPosition) => void): IDisposable;
|
|
51
53
|
/**
|
|
52
54
|
* Start the editing process
|
|
@@ -58,22 +60,18 @@ export interface IFWorkbookSheetsUIMixin {
|
|
|
58
60
|
*/
|
|
59
61
|
startEditing(): boolean;
|
|
60
62
|
/**
|
|
61
|
-
* Use endEditingAsync as instead
|
|
62
|
-
* @deprecated
|
|
63
|
-
* End the editing process
|
|
64
|
-
* @async
|
|
65
|
-
* @param save - Whether to save the changes
|
|
66
|
-
* @returns A promise that resolves to a boolean value
|
|
67
|
-
* @example
|
|
68
|
-
* ``` ts
|
|
69
|
-
* univerAPI.getActiveWorkbook().endEditing(true);
|
|
70
|
-
* ```
|
|
63
|
+
* @deprecated Use `endEditingAsync` as instead
|
|
71
64
|
*/
|
|
72
65
|
endEditing(save?: boolean): Promise<boolean>;
|
|
73
66
|
/**
|
|
74
67
|
* @async
|
|
68
|
+
* End the editing process
|
|
75
69
|
* @param {boolean} save - Whether to save the changes, default is true
|
|
76
70
|
* @returns {Promise<boolean>} A promise that resolves to a boolean value
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* await univerAPI.getActiveWorkbook().endEditingAsync(false);
|
|
74
|
+
* ```
|
|
77
75
|
*/
|
|
78
76
|
endEditingAsync(save?: boolean): Promise<boolean>;
|
|
79
77
|
getScrollStateBySheetId(sheetId: string): Nullable<IScrollState>;
|
|
@@ -115,7 +113,6 @@ export declare class FWorkbookSheetsUIMixin extends FWorkbook implements IFWorkb
|
|
|
115
113
|
openSiderbar(params: ISidebarMethodOptions): IDisposable;
|
|
116
114
|
openDialog(dialog: IDialogPartMethodOptions): IDisposable;
|
|
117
115
|
private _logDeprecation;
|
|
118
|
-
addUIEvent(event: keyof IFSheetsUIEventParamConfig, _callback: (params: IFSheetsUIEventParamConfig[typeof event]) => void): IDisposable;
|
|
119
116
|
generateCellParams(cell: IHoverRichTextPosition | ICellPosWithEvent): ICellEventParam;
|
|
120
117
|
onCellClick(callback: (cell: IHoverRichTextInfo) => void): IDisposable;
|
|
121
118
|
onCellHover(callback: (cell: IHoverRichTextPosition) => void): IDisposable;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { IDisposable, IRange, Nullable } from '@univerjs/core';
|
|
2
|
+
import { SpreadsheetSkeleton } from '@univerjs/engine-render';
|
|
2
3
|
import { IScrollState, IViewportScrollState } from '@univerjs/sheets-ui';
|
|
3
4
|
import { FWorksheet } from '@univerjs/sheets/facade';
|
|
5
|
+
/**
|
|
6
|
+
* @ignore
|
|
7
|
+
*/
|
|
4
8
|
export interface IFWorksheetSkeletonMixin {
|
|
5
9
|
/**
|
|
6
10
|
* Refresh the canvas.
|
|
@@ -65,14 +69,32 @@ export interface IFWorksheetSkeletonMixin {
|
|
|
65
69
|
*/
|
|
66
70
|
getScrollState(): IScrollState;
|
|
67
71
|
/**
|
|
68
|
-
*
|
|
69
|
-
* @
|
|
70
|
-
* @returns {IDisposable} The disposable object to remove the event listener.
|
|
72
|
+
* Get the skeleton service of the worksheet.
|
|
73
|
+
* @returns {Nullable<SpreadsheetSkeleton>} The skeleton of the worksheet.
|
|
71
74
|
* @example
|
|
72
|
-
* ```
|
|
73
|
-
* univerAPI.getActiveWorkbook()
|
|
75
|
+
* ```ts
|
|
76
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
77
|
+
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
78
|
+
* const skeleton = fWorksheet.getSkeleton();
|
|
79
|
+
* console.log(skeleton);
|
|
74
80
|
* ```
|
|
75
81
|
*/
|
|
82
|
+
getSkeleton(): Nullable<SpreadsheetSkeleton>;
|
|
83
|
+
/**
|
|
84
|
+
* Set the given column width to fix-content.
|
|
85
|
+
* @param {number} columnPosition - Column position
|
|
86
|
+
* @param {number} numColumn - Number of columns
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
90
|
+
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
91
|
+
* fWorksheet.setColumnAutoWidth(0, 3);
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
setColumnAutoWidth(columnPosition: number, numColumn: number): FWorksheet;
|
|
95
|
+
/**
|
|
96
|
+
* @deprecated use `univerAPI.addEvent(univerAPI.Event.Scroll, () => {})` instead
|
|
97
|
+
*/
|
|
76
98
|
onScroll(callback: (params: Nullable<IViewportScrollState>) => void): IDisposable;
|
|
77
99
|
}
|
|
78
100
|
export declare class FWorksheetSkeletonMixin extends FWorksheet implements IFWorksheetSkeletonMixin {
|
|
@@ -83,6 +105,8 @@ export declare class FWorksheetSkeletonMixin extends FWorksheet implements IFWor
|
|
|
83
105
|
scrollToCell(row: number, column: number): FWorksheet;
|
|
84
106
|
getScrollState(): IScrollState;
|
|
85
107
|
onScroll(callback: (params: Nullable<IViewportScrollState>) => void): IDisposable;
|
|
108
|
+
getSkeleton(): Nullable<SpreadsheetSkeleton>;
|
|
109
|
+
setColumnAutoWidth(columnPosition: number, numColumn: number): FWorksheet;
|
|
86
110
|
}
|
|
87
111
|
declare module '@univerjs/sheets/facade' {
|
|
88
112
|
interface FWorksheet extends IFWorksheetSkeletonMixin {
|
package/lib/types/index.d.ts
CHANGED
|
@@ -92,6 +92,7 @@ export { FormatPainterStatus, IFormatPainterService } from './services/format-pa
|
|
|
92
92
|
export type { IFormatPainterBeforeApplyHookParams, IFormatPainterHook } from './services/format-painter/format-painter.service';
|
|
93
93
|
export { SELECTION_SHAPE_DEPTH } from './services/selection/const';
|
|
94
94
|
export { type IBaseSheetBarProps } from './views/sheet-bar/sheet-bar-tabs/SheetBarItem';
|
|
95
|
+
export { SetWorksheetColAutoWidthCommand } from './commands/commands/set-worksheet-auto-col-width.command';
|
|
95
96
|
export { AutoClearContentCommand, AutoFillCommand } from './commands/commands/auto-fill.command';
|
|
96
97
|
export { type ISheetPasteByShortKeyParams, type ISheetPasteParams, SheetCopyCommand, SheetCutCommand, SheetPasteBesidesBorderCommand, SheetPasteColWidthCommand, SheetPasteCommand, SheetPasteFormatCommand, SheetPasteShortKeyCommand, SheetPasteValueCommand, } from './commands/commands/clipboard.command';
|
|
97
98
|
export { DeleteRangeMoveLeftConfirmCommand } from './commands/commands/delete-range-move-left-confirm.command';
|
|
@@ -108,7 +109,7 @@ export { ApplyFormatPainterCommand, SetInfiniteFormatPainterCommand, SetOnceForm
|
|
|
108
109
|
export { SetColumnFrozenCommand, SetRowFrozenCommand, SetSelectionFrozenCommand } from './commands/commands/set-frozen.command';
|
|
109
110
|
export { type IScrollCommandParams, type IScrollToCellCommandParams, type ISetScrollRelativeCommandParams, ResetScrollCommand, ScrollCommand, ScrollToCellCommand, SetScrollRelativeCommand, } from './commands/commands/set-scroll.command';
|
|
110
111
|
export { ExpandSelectionCommand, JumpOver, MoveSelectionCommand, MoveSelectionEnterAndTabCommand, SelectAllCommand } from './commands/commands/set-selection.command';
|
|
111
|
-
export { ChangeZoomRatioCommand, SetZoomRatioCommand } from './commands/commands/set-zoom-ratio.command';
|
|
112
|
+
export { ChangeZoomRatioCommand, type ISetZoomRatioCommandParams, SetZoomRatioCommand } from './commands/commands/set-zoom-ratio.command';
|
|
112
113
|
export { ShowMenuListCommand } from './commands/commands/unhide.command';
|
|
113
114
|
export { ChangeSheetProtectionFromSheetBarCommand, DeleteWorksheetProtectionFormSheetBarCommand, } from './commands/commands/worksheet-protection.command';
|
|
114
115
|
export { SetActivateCellEditOperation } from './commands/operations/activate-cell-edit.operation';
|
|
@@ -106,3 +106,8 @@ export declare function getAutoFillRepeatRange(sourceRange: IRange, targetRange:
|
|
|
106
106
|
* @returns
|
|
107
107
|
*/
|
|
108
108
|
export declare function needsUpdateCellValue(cell: ICellData): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Remove cell.custom
|
|
111
|
+
* @param cell
|
|
112
|
+
*/
|
|
113
|
+
export declare function removeCellCustom(cell: Nullable<ICellData>): void;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { DrawingTypeEnum, ICommandInfo, INeedCheckDisposable, Nullable, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
1
|
+
import { DrawingTypeEnum, ICommandInfo, INeedCheckDisposable, IRange, Nullable, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { BaseObject, IBoundRectNoAngle, Viewport, IRenderManagerService } from '@univerjs/engine-render';
|
|
3
|
-
import { ISheetLocationBase, RefRangeService } from '@univerjs/sheets';
|
|
3
|
+
import { ISheetLocationBase, RefRangeService, SheetsSelectionsService } from '@univerjs/sheets';
|
|
4
4
|
import { IPopup, ICanvasPopupService } from '@univerjs/ui';
|
|
5
|
+
import { ISheetSelectionRenderService } from './selection/base-selection-render.service';
|
|
5
6
|
export interface ICanvasPopup extends Omit<IPopup, 'anchorRect' | 'anchorRect$' | 'unitId' | 'subUnitId' | 'canvasElement'> {
|
|
6
7
|
mask?: boolean;
|
|
7
8
|
extraProps?: Record<string, unknown>;
|
|
9
|
+
showOnSelectionMoving?: boolean;
|
|
8
10
|
}
|
|
9
11
|
interface IPopupMenuItem {
|
|
10
12
|
label: string;
|
|
@@ -20,8 +22,12 @@ export declare class SheetCanvasPopManagerService extends Disposable {
|
|
|
20
22
|
private readonly _univerInstanceService;
|
|
21
23
|
private readonly _refRangeService;
|
|
22
24
|
private readonly _commandService;
|
|
25
|
+
private readonly _refSelectionsService;
|
|
26
|
+
private readonly _selectionManagerService;
|
|
23
27
|
private _popupMenuFeatureMap;
|
|
24
|
-
constructor(_globalPopupManagerService: ICanvasPopupService, _renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService, _refRangeService: RefRangeService, _commandService: ICommandService);
|
|
28
|
+
constructor(_globalPopupManagerService: ICanvasPopupService, _renderManagerService: IRenderManagerService, _univerInstanceService: IUniverInstanceService, _refRangeService: RefRangeService, _commandService: ICommandService, _refSelectionsService: ISheetSelectionRenderService, _selectionManagerService: SheetsSelectionsService);
|
|
29
|
+
private _isSelectionMoving;
|
|
30
|
+
private _initMoving;
|
|
25
31
|
/**
|
|
26
32
|
* Register a feature menu callback for a specific drawing type.such as image, chart, etc.
|
|
27
33
|
*/
|
|
@@ -49,20 +55,49 @@ export declare class SheetCanvasPopManagerService extends Disposable {
|
|
|
49
55
|
attachPopupToAbsolutePosition(bound: IBoundRectNoAngle, popup: ICanvasPopup, _unitId?: string, _subUnitId?: string): {
|
|
50
56
|
dispose: () => void;
|
|
51
57
|
canDispose: () => boolean;
|
|
52
|
-
} | null;
|
|
58
|
+
} | null | undefined;
|
|
53
59
|
/**
|
|
54
|
-
*
|
|
60
|
+
* Bind popup to the right part of cell at(row, col).
|
|
61
|
+
* This popup would move with the cell.
|
|
55
62
|
* @param row
|
|
56
63
|
* @param col
|
|
57
64
|
* @param popup
|
|
58
65
|
* @param _unitId
|
|
59
66
|
* @param _subUnitId
|
|
60
67
|
* @param viewport
|
|
68
|
+
* @returns
|
|
69
|
+
*/
|
|
70
|
+
attachPopupToCell(row: number, col: number, popup: ICanvasPopup, _unitId?: string, _subUnitId?: string, viewport?: Viewport): Nullable<INeedCheckDisposable>;
|
|
71
|
+
/**
|
|
72
|
+
* attach Comp to floatDOM
|
|
73
|
+
* @param range
|
|
74
|
+
* @param popup
|
|
75
|
+
* @param _unitId
|
|
76
|
+
* @param _subUnitId
|
|
77
|
+
* @param viewport
|
|
61
78
|
* @param showOnSelectionMoving
|
|
62
79
|
* @returns
|
|
63
80
|
*/
|
|
64
|
-
|
|
81
|
+
attachRangePopup(range: IRange, popup: ICanvasPopup, _unitId?: string, _subUnitId?: string, viewport?: Viewport, showOnSelectionMoving?: boolean): Nullable<INeedCheckDisposable>;
|
|
82
|
+
/**
|
|
83
|
+
*
|
|
84
|
+
* @param initialRow
|
|
85
|
+
* @param initialCol
|
|
86
|
+
* @param currentRender
|
|
87
|
+
* @param skeleton
|
|
88
|
+
* @param activeViewport
|
|
89
|
+
* @returns
|
|
90
|
+
*/
|
|
65
91
|
private _createCellPositionObserver;
|
|
66
92
|
private _calcCellPositionByCell;
|
|
93
|
+
/**
|
|
94
|
+
* Unlike _createCellPositionObserver, this accept a range not a single cell.
|
|
95
|
+
* @param initialRow
|
|
96
|
+
* @param initialCol
|
|
97
|
+
* @param currentRender
|
|
98
|
+
* @param skeleton
|
|
99
|
+
* @param activeViewport
|
|
100
|
+
*/
|
|
101
|
+
private _createRangePositionObserver;
|
|
67
102
|
}
|
|
68
103
|
export {};
|
|
@@ -31,7 +31,7 @@ export interface ISheetClipboardService {
|
|
|
31
31
|
copy(): Promise<boolean>;
|
|
32
32
|
cut(): Promise<boolean>;
|
|
33
33
|
paste(item: ClipboardItem, pasteType?: string): Promise<boolean>;
|
|
34
|
-
legacyPaste(html?: string, text?: string): Promise<boolean>;
|
|
34
|
+
legacyPaste(html?: string, text?: string, files?: File[]): Promise<boolean>;
|
|
35
35
|
rePasteWithPasteType(type: IPasteHookKeyType): boolean;
|
|
36
36
|
disposePasteOptionsCache(): void;
|
|
37
37
|
generateCopyContent(workbookId: string, worksheetId: string, range: IRange): Nullable<ICopyContent>;
|
|
@@ -74,14 +74,17 @@ export declare class SheetClipboardService extends Disposable implements ISheetC
|
|
|
74
74
|
copy(copyType?: COPY_TYPE): Promise<boolean>;
|
|
75
75
|
cut(): Promise<boolean>;
|
|
76
76
|
paste(item: ClipboardItem, pasteType?: "default-paste"): Promise<boolean>;
|
|
77
|
-
legacyPaste(html?: string, text?: string): Promise<boolean>;
|
|
77
|
+
legacyPaste(html?: string, text?: string, files?: File[]): Promise<boolean>;
|
|
78
78
|
rePasteWithPasteType(type: IPasteHookKeyType): boolean;
|
|
79
79
|
updatePasteOptionsCache(cache: IPasteOptionCache | null): void;
|
|
80
80
|
addClipboardHook(hook: ISheetClipboardHook): IDisposable;
|
|
81
81
|
getClipboardHooks(): ISheetClipboardHook[];
|
|
82
82
|
private _generateCopyContent;
|
|
83
83
|
private _notifyClipboardHook;
|
|
84
|
+
private _executePaste;
|
|
85
|
+
private _pasteFiles;
|
|
84
86
|
private _pastePlainText;
|
|
87
|
+
private _pasteUnrecognized;
|
|
85
88
|
private _pasteHTML;
|
|
86
89
|
private _pasteExternal;
|
|
87
90
|
private _pasteInternal;
|
|
@@ -56,20 +56,36 @@ export interface ISpecialPasteInfo {
|
|
|
56
56
|
/**
|
|
57
57
|
* `ClipboardHook` could:
|
|
58
58
|
* 1. Before copy/cut/paste, decide whether to execute the command and prepare caches if necessary.
|
|
59
|
-
*
|
|
60
|
-
*
|
|
59
|
+
* 2. When copying, decide what content could be written into clipboard.
|
|
60
|
+
* 3. When pasting, get access to the clipboard content and append mutations to the paste command.
|
|
61
61
|
*/
|
|
62
62
|
export interface ISheetClipboardHook {
|
|
63
|
+
/**
|
|
64
|
+
* The unique id of the hook.
|
|
65
|
+
*/
|
|
63
66
|
id: string;
|
|
67
|
+
/**
|
|
68
|
+
* Whether this hook is the default hook.
|
|
69
|
+
*/
|
|
64
70
|
isDefaultHook?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Only special paste info should be provided, which will replace the default hook.
|
|
73
|
+
*/
|
|
65
74
|
specialPasteInfo?: ISpecialPasteInfo;
|
|
75
|
+
/**
|
|
76
|
+
* The priority of the hook. The higher the priority, the earlier the hook would be called.
|
|
77
|
+
*/
|
|
66
78
|
priority?: number;
|
|
67
79
|
/**
|
|
68
80
|
* The callback would be called after the clipboard service has decided what region need to be copied.
|
|
69
81
|
* Features could use this hook to build copying cache or any other pre-copy jobs.
|
|
82
|
+
* @param unitId
|
|
83
|
+
* @param subUnitId
|
|
84
|
+
* @param range
|
|
70
85
|
*/
|
|
71
|
-
onBeforeCopy?(unitId: string, subUnitId: string, range: IRange): void;
|
|
86
|
+
onBeforeCopy?(unitId: string, subUnitId: string, range: IRange, copyType: COPY_TYPE): void;
|
|
72
87
|
/**
|
|
88
|
+
* Properties that would be appended to the td element.
|
|
73
89
|
*
|
|
74
90
|
* @param row
|
|
75
91
|
* @param col
|
|
@@ -82,16 +98,21 @@ export interface ISheetClipboardHook {
|
|
|
82
98
|
* @deprecated should be merged with `onCopyCellContent` to `onCopyCell`
|
|
83
99
|
* @param row row of the the copied cell
|
|
84
100
|
* @param col col of the the copied cell
|
|
101
|
+
* @param rowSpan row span of the the copied cell
|
|
102
|
+
* @param colSpan col span of the the copied cell
|
|
103
|
+
* @return content
|
|
85
104
|
*/
|
|
86
105
|
onCopyCellStyle?(row: number, col: number, rowSpan?: number, colSpan?: number): IClipboardPropertyItem | null;
|
|
87
106
|
/**
|
|
88
107
|
* Properties that would be appended to the tr element.
|
|
89
108
|
* @param row each row of the the copied range
|
|
109
|
+
* @return content
|
|
90
110
|
*/
|
|
91
111
|
onCopyRow?(row: number): IClipboardPropertyItem | null;
|
|
92
112
|
/**
|
|
93
113
|
* Properties that would be appended to the col element.
|
|
94
114
|
* @param col each col of the copied range
|
|
115
|
+
* @return content
|
|
95
116
|
*/
|
|
96
117
|
onCopyColumn?(col: number): IClipboardPropertyItem | null;
|
|
97
118
|
/**
|
|
@@ -103,30 +124,73 @@ export interface ISheetClipboardHook {
|
|
|
103
124
|
* The callback would be called after the clipboard service has decided what region need to be pasted.
|
|
104
125
|
* Features could use this hook to build copying cache or any other pre-copy jobs.
|
|
105
126
|
*
|
|
127
|
+
* @param pasteTo
|
|
106
128
|
* @returns if it block copying it should return false
|
|
107
129
|
*/
|
|
108
130
|
onBeforePaste?(pasteTo: ISheetDiscreteRangeLocation): boolean;
|
|
109
131
|
/**
|
|
132
|
+
* Handles pasting cells, it needs to return Undo Mutations & Redo Mutations that handle the cell contents
|
|
110
133
|
*
|
|
111
|
-
* @param
|
|
112
|
-
* @param
|
|
134
|
+
* @param pasteFrom
|
|
135
|
+
* @param pasteTo
|
|
136
|
+
* @param data
|
|
137
|
+
* @param payload
|
|
138
|
+
* @returns undo and redo mutations
|
|
113
139
|
*/
|
|
114
140
|
onPasteCells?(pasteFrom: ISheetDiscreteRangeLocation | null, pasteTo: ISheetDiscreteRangeLocation, data: ObjectMatrix<ICellDataWithSpanInfo>, payload: ICopyPastePayload): {
|
|
115
141
|
undos: IMutationInfo[];
|
|
116
142
|
redos: IMutationInfo[];
|
|
117
143
|
};
|
|
144
|
+
/**
|
|
145
|
+
* Handle the pasted row properties, it needs to return the Undo Mutations & Redo Mutations that handle the row properties
|
|
146
|
+
*
|
|
147
|
+
* @param pasteTo
|
|
148
|
+
* @param rowProperties
|
|
149
|
+
* @param payload
|
|
150
|
+
* @returns undo and redo mutations
|
|
151
|
+
*/
|
|
118
152
|
onPasteRows?(pasteTo: ISheetDiscreteRangeLocation, rowProperties: IClipboardPropertyItem[], payload: ICopyPastePayload): {
|
|
119
153
|
undos: IMutationInfo[];
|
|
120
154
|
redos: IMutationInfo[];
|
|
121
155
|
};
|
|
156
|
+
/**
|
|
157
|
+
* Handle the pasted column properties, it needs to return the Undo Mutations & Redo Mutations that handle the column properties
|
|
158
|
+
*
|
|
159
|
+
* @param pasteTo
|
|
160
|
+
* @param colProperties
|
|
161
|
+
* @param payload
|
|
162
|
+
* @returns undo and redo mutations
|
|
163
|
+
*/
|
|
122
164
|
onPasteColumns?(pasteTo: ISheetDiscreteRangeLocation, colProperties: IClipboardPropertyItem[], payload: ICopyPastePayload): {
|
|
123
165
|
undos: IMutationInfo[];
|
|
124
166
|
redos: IMutationInfo[];
|
|
125
167
|
};
|
|
168
|
+
/**
|
|
169
|
+
* Hanle the pasted plain text, it needs to return the Undo Mutations & Redo Mutations that handle the plain text
|
|
170
|
+
*
|
|
171
|
+
* @param pasteTo
|
|
172
|
+
* @param text
|
|
173
|
+
* @param payload
|
|
174
|
+
* @returns undo and redo mutations
|
|
175
|
+
*/
|
|
126
176
|
onPastePlainText?(pasteTo: ISheetDiscreteRangeLocation, text: string, payload: ICopyPastePayload): {
|
|
127
177
|
undos: IMutationInfo[];
|
|
128
178
|
redos: IMutationInfo[];
|
|
129
179
|
};
|
|
180
|
+
onPasteFiles?(pasteTo: ISheetDiscreteRangeLocation, files: File[], payload: ICopyPastePayload): {
|
|
181
|
+
undos: IMutationInfo[];
|
|
182
|
+
redos: IMutationInfo[];
|
|
183
|
+
};
|
|
184
|
+
onPasteUnrecognized?(pasteTo: ISheetDiscreteRangeLocation): {
|
|
185
|
+
undos: IMutationInfo[];
|
|
186
|
+
redos: IMutationInfo[];
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* Would be called after paste content has been written into Univer.
|
|
190
|
+
* Features could do some cleaning up jobs here.
|
|
191
|
+
*
|
|
192
|
+
* @param success whether the paste operation is successful
|
|
193
|
+
*/
|
|
130
194
|
onAfterPaste?(success: boolean): void;
|
|
131
195
|
/**
|
|
132
196
|
* The callback would be called before the clipboard service decides what region need to be copied from or pasted to.
|
|
@@ -13,7 +13,7 @@ export declare const getRepeatRange: (sourceRange: IRange, targetRange: IRange,
|
|
|
13
13
|
startRange: IRange;
|
|
14
14
|
repeatRelativeRange: IRange;
|
|
15
15
|
}[];
|
|
16
|
-
export declare function
|
|
16
|
+
export declare function htmlIsFromExcel(html: string): boolean;
|
|
17
17
|
export declare function mergeCellValues(...cellValues: IObjectMatrixPrimitiveType<Nullable<ICellData>>[]): IObjectMatrixPrimitiveType<Nullable<ICellData>> | IObjectMatrixPrimitiveType<IObjectMatrixPrimitiveType<Nullable<ICellData>>>;
|
|
18
18
|
export declare function getRangeValuesMergeable(m1: IMutationInfo<ISetRangeValuesMutationParams>, m2: IMutationInfo<ISetRangeValuesMutationParams>): boolean;
|
|
19
19
|
export declare function mergeSetRangeValues(mutations: IMutationInfo[]): IMutationInfo<object>[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Workbook, Disposable } from '@univerjs/core';
|
|
1
|
+
import { Workbook, Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { IRenderContext, IRenderModule, IRenderManagerService } from '@univerjs/engine-render';
|
|
3
3
|
import { ILayoutService } from '@univerjs/ui';
|
|
4
4
|
import { IEditorBridgeService } from '../editor-bridge.service';
|
|
@@ -11,7 +11,8 @@ export declare class SheetCellEditorResizeService extends Disposable implements
|
|
|
11
11
|
private readonly _editorBridgeService;
|
|
12
12
|
private readonly _renderManagerService;
|
|
13
13
|
private readonly _sheetSkeletonManagerService;
|
|
14
|
-
|
|
14
|
+
private readonly _univerInstanceService;
|
|
15
|
+
constructor(_context: IRenderContext<Workbook>, _layoutService: ILayoutService, _cellEditorManagerService: ICellEditorManagerService, _editorBridgeService: IEditorBridgeService, _renderManagerService: IRenderManagerService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _univerInstanceService: IUniverInstanceService);
|
|
15
16
|
fitTextSize(callback?: () => void): void;
|
|
16
17
|
/**
|
|
17
18
|
* Mainly used to pre-calculate the width of the editor,
|
|
@@ -42,6 +42,7 @@ export interface IEditorBridgeService {
|
|
|
42
42
|
currentEditCellLayout$: Observable<Nullable<ICellEditorLayout>>;
|
|
43
43
|
currentEditCell$: Observable<Nullable<IEditorBridgeServiceParam>>;
|
|
44
44
|
visible$: Observable<IEditorBridgeServiceVisibleParam>;
|
|
45
|
+
forceKeepVisible$: Observable<boolean>;
|
|
45
46
|
dispose(): void;
|
|
46
47
|
refreshEditCellState(): void;
|
|
47
48
|
refreshEditCellPosition(resetSizeOnly?: boolean): void;
|
|
@@ -68,7 +69,6 @@ export declare class EditorBridgeService extends Disposable implements IEditorBr
|
|
|
68
69
|
private readonly _refSelectionsService;
|
|
69
70
|
private readonly _contextService;
|
|
70
71
|
private _editorUnitId;
|
|
71
|
-
private _isForceKeepVisible;
|
|
72
72
|
private _editorIsDirty;
|
|
73
73
|
private _isDisabled;
|
|
74
74
|
private _visible;
|
|
@@ -99,6 +99,8 @@ export declare class EditorBridgeService extends Disposable implements IEditorBr
|
|
|
99
99
|
readonly visible$: Observable<IEditorBridgeServiceVisibleParam>;
|
|
100
100
|
private readonly _afterVisible$;
|
|
101
101
|
readonly afterVisible$: Observable<IEditorBridgeServiceVisibleParam>;
|
|
102
|
+
private readonly _forceKeepVisible$;
|
|
103
|
+
readonly forceKeepVisible$: Observable<boolean>;
|
|
102
104
|
constructor(_sheetInterceptorService: SheetInterceptorService, _renderManagerService: IRenderManagerService, _themeService: ThemeService, _univerInstanceService: IUniverInstanceService, _editorService: IEditorService, _refSelectionsService: SheetsSelectionsService, _contextService: IContextService);
|
|
103
105
|
refreshEditCellState(): void;
|
|
104
106
|
refreshEditCellPosition(resetSizeOnly?: boolean): void;
|
|
@@ -45,6 +45,11 @@ export interface IHoverRichTextPosition extends ISheetLocationBase {
|
|
|
45
45
|
drawing?: Nullable<string>;
|
|
46
46
|
event?: IMouseEvent | IPointerEvent;
|
|
47
47
|
}
|
|
48
|
+
export interface IHoverHeaderPosition {
|
|
49
|
+
unitId: string;
|
|
50
|
+
subUnitId: string;
|
|
51
|
+
index: number;
|
|
52
|
+
}
|
|
48
53
|
export declare function getLocationBase(location: ISheetLocation): {
|
|
49
54
|
unitId: string;
|
|
50
55
|
subUnitId: string;
|
|
@@ -57,9 +62,20 @@ export declare class HoverManagerService extends Disposable {
|
|
|
57
62
|
private _currentCell$;
|
|
58
63
|
private _currentRichText$;
|
|
59
64
|
private _currentClickedCell$;
|
|
65
|
+
private _currentDbClickedCell$;
|
|
60
66
|
private _currentCellWithEvent$;
|
|
61
67
|
private _currentPointerDownCell$;
|
|
62
68
|
private _currentPointerUpCell$;
|
|
69
|
+
private _currentHoveredRowHeader$;
|
|
70
|
+
private _currentHoveredColHeader$;
|
|
71
|
+
private _currentRowHeaderClick$;
|
|
72
|
+
private _currentColHeaderClick$;
|
|
73
|
+
private _currentRowHeaderDbClick$;
|
|
74
|
+
private _currentColHeaderDbClick$;
|
|
75
|
+
private _currentRowHeaderPointerDown$;
|
|
76
|
+
private _currentColHeaderPointerDown$;
|
|
77
|
+
private _currentRowHeaderPointerUp$;
|
|
78
|
+
private _currentColHeaderPointerUp$;
|
|
63
79
|
currentCell$: import('rxjs').Observable<Nullable<IHoverCellPosition>>;
|
|
64
80
|
currentRichText$: import('rxjs').Observable<void | IHoverRichTextPosition | null | undefined>;
|
|
65
81
|
/**
|
|
@@ -68,12 +84,26 @@ export declare class HoverManagerService extends Disposable {
|
|
|
68
84
|
currentCellPosWithEvent$: import('rxjs').Observable<void | ICellPosWithEvent | null | undefined>;
|
|
69
85
|
currentPosition$: import('rxjs').Observable<Nullable<IHoverCellPosition>>;
|
|
70
86
|
currentClickedCell$: import('rxjs').Observable<IHoverRichTextInfo>;
|
|
87
|
+
currentDbClickedCell$: import('rxjs').Observable<IHoverRichTextInfo>;
|
|
71
88
|
currentPointerDownCell$: import('rxjs').Observable<ICellPosWithEvent>;
|
|
72
89
|
currentPointerUpCell$: import('rxjs').Observable<ICellPosWithEvent>;
|
|
90
|
+
currentHoveredRowHeader$: import('rxjs').Observable<Nullable<IHoverHeaderPosition>>;
|
|
91
|
+
currentHoveredColHeader$: import('rxjs').Observable<Nullable<IHoverHeaderPosition>>;
|
|
92
|
+
currentRowHeaderClick$: import('rxjs').Observable<IHoverHeaderPosition>;
|
|
93
|
+
currentColHeaderClick$: import('rxjs').Observable<IHoverHeaderPosition>;
|
|
94
|
+
currentRowHeaderDbClick$: import('rxjs').Observable<IHoverHeaderPosition>;
|
|
95
|
+
currentColHeaderDbClick$: import('rxjs').Observable<IHoverHeaderPosition>;
|
|
96
|
+
currentRowHeaderPointerDown$: import('rxjs').Observable<IHoverHeaderPosition>;
|
|
97
|
+
currentColHeaderPointerDown$: import('rxjs').Observable<IHoverHeaderPosition>;
|
|
98
|
+
currentRowHeaderPointerUp$: import('rxjs').Observable<IHoverHeaderPosition>;
|
|
99
|
+
currentColHeaderPointerUp$: import('rxjs').Observable<IHoverHeaderPosition>;
|
|
73
100
|
constructor(_univerInstanceService: IUniverInstanceService, _renderManagerService: IRenderManagerService);
|
|
74
101
|
dispose(): void;
|
|
75
102
|
private _initCellDisposableListener;
|
|
103
|
+
private _getCalcDeps;
|
|
76
104
|
private _calcActiveCell;
|
|
105
|
+
private _calcActiveRowHeader;
|
|
106
|
+
private _calcActiveColHeader;
|
|
77
107
|
triggerPointerDown(unitId: string, event: IPointerEvent | IMouseEvent): void;
|
|
78
108
|
triggerPointerUp(unitId: string, event: IPointerEvent | IMouseEvent): void;
|
|
79
109
|
triggerMouseMove(unitId: string, event: IPointerEvent | IMouseEvent): void;
|
|
@@ -84,5 +114,16 @@ export declare class HoverManagerService extends Disposable {
|
|
|
84
114
|
* @param offsetY
|
|
85
115
|
*/
|
|
86
116
|
triggerClick(unitId: string, offsetX: number, offsetY: number): void;
|
|
117
|
+
triggerDbClick(unitId: string, offsetX: number, offsetY: number): void;
|
|
87
118
|
triggerScroll(): void;
|
|
119
|
+
triggerRowHeaderClick(unitId: string, offsetX: number, offsetY: number): void;
|
|
120
|
+
triggerColHeaderClick(unitId: string, offsetX: number, offsetY: number): void;
|
|
121
|
+
triggerRowHeaderDbClick(unitId: string, offsetX: number, offsetY: number): void;
|
|
122
|
+
triggerColHeaderDbClick(unitId: string, offsetX: number, offsetY: number): void;
|
|
123
|
+
triggerRowHeaderMouseMove(unitId: string, offsetX: number, offsetY: number): void;
|
|
124
|
+
triggerColHeaderMouseMove(unitId: string, offsetX: number, offsetY: number): void;
|
|
125
|
+
triggerRowHeaderPoniterDown(unitId: string, offsetX: number, offsetY: number): void;
|
|
126
|
+
triggerColHeaderPoniterDown(unitId: string, offsetX: number, offsetY: number): void;
|
|
127
|
+
triggerRowHeaderPoniterUp(unitId: string, offsetX: number, offsetY: number): void;
|
|
128
|
+
triggerColHeaderPoniterUp(unitId: string, offsetX: number, offsetY: number): void;
|
|
88
129
|
}
|
|
@@ -39,6 +39,7 @@ export interface ISheetSelectionRenderService {
|
|
|
39
39
|
getCellWithCoordByOffset(x: number, y: number, skeleton?: SpreadsheetSkeleton): Nullable<ICellWithCoord>;
|
|
40
40
|
setSingleSelectionEnabled(enabled: boolean): void;
|
|
41
41
|
refreshSelectionMoveEnd(): void;
|
|
42
|
+
resetSelectionsByModelData(selectionsWithStyleList: readonly ISelectionWithStyle[]): void;
|
|
42
43
|
}
|
|
43
44
|
export declare const ISheetSelectionRenderService: import('@wendellhu/redi').IdentifierDecorator<ISheetSelectionRenderService>;
|
|
44
45
|
/**
|
|
@@ -57,6 +58,7 @@ export declare class BaseSelectionRenderService extends Disposable implements IS
|
|
|
57
58
|
readonly controlFillConfig$: Observable<IControlFillConfig | null>;
|
|
58
59
|
protected _selectionControls: SelectionControl[];
|
|
59
60
|
protected _startRangeWhenPointerDown: IRangeWithCoord;
|
|
61
|
+
protected _activeControlIndex: number;
|
|
60
62
|
/**
|
|
61
63
|
* the posX of viewport when the pointer down
|
|
62
64
|
*/
|
|
@@ -158,6 +160,8 @@ export declare class BaseSelectionRenderService extends Disposable implements IS
|
|
|
158
160
|
* Returns the selected range in the active sheet, or null if there is no active range. If multiple ranges are selected this method returns only the last selected range.
|
|
159
161
|
*/
|
|
160
162
|
getActiveRange(): Nullable<IRange>;
|
|
163
|
+
setActiveSelectionIndex(index: number): void;
|
|
164
|
+
resetActiveSelectionIndex(): void;
|
|
161
165
|
/**
|
|
162
166
|
* get active(actually last) selection control
|
|
163
167
|
* @returns T extends SelectionControl
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ICellWithCoord, IRangeWithCoord, Nullable, ThemeService, Disposable, RANGE_TYPE } from '@univerjs/core';
|
|
2
|
-
import { Scene, Group, Rect } from '@univerjs/engine-render';
|
|
2
|
+
import { Scene, SpreadsheetSkeleton, Group, Rect } from '@univerjs/engine-render';
|
|
3
3
|
import { ISelectionStyle, ISelectionWidgetConfig, ISelectionWithCoord } from '@univerjs/sheets';
|
|
4
4
|
import { ISelectionShapeExtensionOption, SelectionShapeExtension } from './selection-shape-extension';
|
|
5
5
|
import { Subject } from 'rxjs';
|
|
@@ -175,7 +175,7 @@ export declare class SelectionControl extends Disposable {
|
|
|
175
175
|
* Update range and primary range and style.
|
|
176
176
|
* @param selectionWthCoord
|
|
177
177
|
*/
|
|
178
|
-
updateRangeBySelectionWithCoord(selectionWthCoord: ISelectionWithCoord): void;
|
|
178
|
+
updateRangeBySelectionWithCoord(selectionWthCoord: ISelectionWithCoord, sk?: SpreadsheetSkeleton): void;
|
|
179
179
|
/**
|
|
180
180
|
* Update selection model with new range & primary cell(aka: highlight/current), also update row/col selection size & style.
|
|
181
181
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IRange, IRangeWithCoord, Nullable, Workbook, Disposable, Injector } from '@univerjs/core';
|
|
2
|
-
import { IRenderContext, IRenderModule, SpreadsheetSkeleton } from '@univerjs/engine-render';
|
|
2
|
+
import { IRender, IRenderContext, IRenderModule, SpreadsheetSkeleton } from '@univerjs/engine-render';
|
|
3
3
|
export interface ISheetSkeletonManagerParam {
|
|
4
4
|
unitId: string;
|
|
5
5
|
sheetId: string;
|
|
@@ -58,4 +58,5 @@ export declare class SheetSkeletonManagerService extends Disposable implements I
|
|
|
58
58
|
attachRangeWithCoord(range: IRange): Nullable<IRangeWithCoord>;
|
|
59
59
|
private _getSkeleton;
|
|
60
60
|
private _buildSkeleton;
|
|
61
|
+
setColumnHeaderSize(render: IRender, sheetId: string, size: number): void;
|
|
61
62
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ICanvasPopup } from '../../services/canvas-pop-manager.service';
|
|
2
|
-
import { default as React } from 'react';
|
|
3
2
|
/**
|
|
4
3
|
*
|
|
5
4
|
* @param root0
|
|
@@ -7,4 +6,4 @@ import { default as React } from 'react';
|
|
|
7
6
|
*/
|
|
8
7
|
export declare function CellAlert({ popup }: {
|
|
9
8
|
popup: ICanvasPopup;
|
|
10
|
-
}):
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 ClipboardPopupMenu: () => import("react/jsx-runtime").JSX.Element | null;
|