@univerjs/sheets-ui 1.0.0-rc.0 → 1.0.0
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 +5 -13
- package/lib/cjs/index.js +7439 -6538
- package/lib/cjs/locale/ar-SA.js +0 -1
- package/lib/cjs/locale/ca-ES.js +0 -1
- package/lib/cjs/locale/de-DE.js +0 -1
- package/lib/cjs/locale/en-US.js +0 -1
- package/lib/cjs/locale/es-ES.js +0 -1
- package/lib/cjs/locale/fa-IR.js +0 -1
- package/lib/cjs/locale/fr-FR.js +0 -1
- package/lib/cjs/locale/id-ID.js +0 -1
- package/lib/cjs/locale/it-IT.js +0 -1
- package/lib/cjs/locale/ja-JP.js +0 -1
- package/lib/cjs/locale/ko-KR.js +0 -1
- package/lib/cjs/locale/pl-PL.js +0 -1
- package/lib/cjs/locale/pt-BR.js +0 -1
- package/lib/cjs/locale/ru-RU.js +0 -1
- package/lib/cjs/locale/sk-SK.js +0 -1
- package/lib/cjs/locale/vi-VN.js +0 -1
- package/lib/cjs/locale/zh-CN.js +0 -1
- package/lib/cjs/locale/zh-HK.js +0 -1
- package/lib/cjs/locale/zh-TW.js +0 -1
- package/lib/es/facade.js +5 -13
- package/lib/es/index.js +7444 -6543
- package/lib/facade.js +5 -13
- package/lib/index.js +7444 -6543
- package/lib/types/components/border-panel/BorderPanel.d.ts +17 -0
- package/lib/types/components/border-panel/border-line/BorderLine.d.ts +22 -0
- package/lib/types/components/border-panel/border-line/icons/BorderDashDot.d.ts +18 -0
- package/lib/types/components/border-panel/border-line/icons/BorderDashDotDot.d.ts +18 -0
- package/lib/types/components/border-panel/border-line/icons/BorderDashed.d.ts +18 -0
- package/lib/types/components/border-panel/border-line/icons/BorderDotted.d.ts +18 -0
- package/lib/types/components/border-panel/border-line/icons/BorderDouble.d.ts +18 -0
- package/lib/types/components/border-panel/border-line/icons/BorderHair.d.ts +18 -0
- package/lib/types/components/border-panel/border-line/icons/BorderMedium.d.ts +18 -0
- package/lib/types/components/border-panel/border-line/icons/BorderMediumDashDot.d.ts +18 -0
- package/lib/types/components/border-panel/border-line/icons/BorderMediumDashDotDot.d.ts +18 -0
- package/lib/types/components/border-panel/border-line/icons/BorderMediumDashed.d.ts +18 -0
- package/lib/types/components/border-panel/border-line/icons/BorderThick.d.ts +18 -0
- package/lib/types/components/border-panel/border-line/icons/BorderThin.d.ts +18 -0
- package/lib/types/components/border-panel/interface.d.ts +25 -0
- package/lib/types/components/const.d.ts +16 -0
- package/lib/types/components/hook.d.ts +21 -0
- package/lib/types/components/menu-item-frozen/MenuItemFrozen.d.ts +17 -0
- package/lib/types/components/menu-item-frozen/index.d.ts +17 -0
- package/lib/types/components/menu-item-frozen/interface.d.ts +20 -0
- package/lib/types/components/menu-item-input/MenuItemInput.d.ts +17 -0
- package/lib/types/components/menu-item-input/index.d.ts +17 -0
- package/lib/types/components/menu-item-input/interface.d.ts +25 -0
- package/lib/types/controllers/auto-fill-ui.controller.d.ts +7 -1
- package/lib/types/controllers/cell-alert.controller.d.ts +25 -0
- package/lib/types/controllers/mobile/mobile-sheet-ui.controller.d.ts +35 -0
- package/lib/types/controllers/render-controllers/desktop-cell-edit.render-controller.d.ts +49 -0
- package/lib/types/controllers/render-controllers/editor-bridge.render-controller.d.ts +2 -17
- package/lib/types/controllers/render-controllers/format-painter.render-controller.d.ts +5 -1
- package/lib/types/controllers/render-controllers/mobile/mobile-cell-edit.render-controller.d.ts +30 -0
- package/lib/types/controllers/render-controllers/mobile/mobile-hover.render-controller.d.ts +9 -0
- package/lib/types/controllers/render-controllers/mobile/mobile-scroll.render-controller.d.ts +0 -12
- package/lib/types/controllers/sheet-ui.controller.d.ts +35 -0
- package/lib/types/facade/f-range.d.ts +4 -4
- package/lib/types/facade/f-sheet-hooks.d.ts +125 -0
- package/lib/types/facade/f-workbook-permission.d.ts +39 -0
- package/lib/types/facade/f-workbook.d.ts +2 -2
- package/lib/types/facade/f-worksheet.d.ts +12 -8
- package/lib/types/menu/mobile-menu.d.ts +16 -0
- package/lib/types/menu/mobile-schema.d.ts +17 -0
- package/lib/types/services/canvas-pop-manager.service.d.ts +2 -3
- package/lib/types/services/clipboard/html-to-usm/utils.d.ts +2 -0
- package/lib/types/services/selection/selection-render.service.d.ts +3 -0
- package/lib/types/views/auto-fill-popup-menu/AutoFillPopupMenu.d.ts +1 -5
- package/lib/types/views/auto-fill-popup-menu/component-name.d.ts +16 -0
- package/lib/types/views/cell-popup/index.d.ts +22 -0
- package/lib/types/views/dropdown/cascader-dropdown/index.d.ts +29 -0
- package/lib/types/views/dropdown/color-dropdown/index.d.ts +27 -0
- package/lib/types/views/dropdown/date-dropdown/index.d.ts +30 -0
- package/lib/types/views/dropdown/list-dropdown/index.d.ts +36 -0
- package/lib/types/views/permission/error-msg-dialog/index.d.ts +18 -0
- package/lib/types/views/permission/panel/index.d.ts +24 -0
- package/lib/types/views/permission/panel-list/index.d.ts +16 -0
- package/lib/types/views/permission/permission-dialog/index.d.ts +16 -0
- package/lib/types/views/permission/spin/index.d.ts +22 -0
- package/lib/types/views/permission/user-dialog/index.d.ts +16 -0
- package/lib/types/views/sheet-container/SheetContainer.d.ts +1 -8
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +10 -28
- package/package.json +16 -16
|
@@ -16,14 +16,18 @@
|
|
|
16
16
|
import type { Workbook } from '@univerjs/core';
|
|
17
17
|
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
18
18
|
import { Disposable, ICommandService } from '@univerjs/core';
|
|
19
|
+
import { SheetsSelectionsService } from '@univerjs/sheets';
|
|
20
|
+
import { FormatPainterSessionService } from '@univerjs/ui';
|
|
19
21
|
import { IFormatPainterService } from '../../services/format-painter/format-painter.service';
|
|
20
22
|
import { ISheetSelectionRenderService } from '../../services/selection/base-selection-render.service';
|
|
21
23
|
export declare class FormatPainterRenderController extends Disposable implements IRenderModule {
|
|
22
24
|
private readonly _context;
|
|
23
25
|
private readonly _formatPainterService;
|
|
24
26
|
private readonly _selectionRenderService;
|
|
27
|
+
private readonly _session;
|
|
28
|
+
private readonly _selections;
|
|
25
29
|
private readonly _commandService;
|
|
26
|
-
constructor(_context: IRenderContext<Workbook>, _formatPainterService: IFormatPainterService, _selectionRenderService: ISheetSelectionRenderService, _commandService: ICommandService);
|
|
30
|
+
constructor(_context: IRenderContext<Workbook>, _formatPainterService: IFormatPainterService, _selectionRenderService: ISheetSelectionRenderService, _session: FormatPainterSessionService, _selections: SheetsSelectionsService, _commandService: ICommandService);
|
|
27
31
|
private _initialize;
|
|
28
32
|
private _commandExecutedListener;
|
|
29
33
|
private _bindFormatPainterStatus;
|
package/lib/types/controllers/render-controllers/mobile/mobile-cell-edit.render-controller.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { Workbook } from '@univerjs/core';
|
|
17
|
+
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
18
|
+
import { Disposable, ICommandService } from '@univerjs/core';
|
|
19
|
+
import { IEditorBridgeService } from '../../../services/editor-bridge.service';
|
|
20
|
+
import { HoverManagerService } from '../../../services/hover-manager.service';
|
|
21
|
+
export declare class MobileCellEditRenderController extends Disposable implements IRenderModule {
|
|
22
|
+
private readonly _context;
|
|
23
|
+
private readonly _commandService;
|
|
24
|
+
private readonly _editorBridgeService;
|
|
25
|
+
constructor(_context: IRenderContext<Workbook>, _commandService: ICommandService, _editorBridgeService: IEditorBridgeService, hoverManagerService: HoverManagerService);
|
|
26
|
+
private _initPointerDownListener;
|
|
27
|
+
private _isCurrentEditCell;
|
|
28
|
+
private _hideEditor;
|
|
29
|
+
private _getSheetObject;
|
|
30
|
+
}
|
|
@@ -27,8 +27,13 @@ export declare class MobileHoverRenderController extends Disposable implements I
|
|
|
27
27
|
private readonly _contextService;
|
|
28
28
|
private _active;
|
|
29
29
|
private _tapState;
|
|
30
|
+
private _lastCompletedTap;
|
|
31
|
+
private _completedTapTimer;
|
|
32
|
+
private _suppressEngineDoubleClick;
|
|
33
|
+
private _suppressEngineDoubleClickTimer;
|
|
30
34
|
get active(): boolean;
|
|
31
35
|
constructor(_context: IRenderContext<Workbook>, _hoverManagerService: HoverManagerService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _scrollManagerService: SheetScrollManagerService, _contextService: IContextService);
|
|
36
|
+
dispose(): void;
|
|
32
37
|
private _initPointerEvent;
|
|
33
38
|
private _bindMainComponentEvents;
|
|
34
39
|
private _bindRowHeaderEvents;
|
|
@@ -36,5 +41,9 @@ export declare class MobileHoverRenderController extends Disposable implements I
|
|
|
36
41
|
private _startTap;
|
|
37
42
|
private _updateTapState;
|
|
38
43
|
private _finishTap;
|
|
44
|
+
private _completeTap;
|
|
45
|
+
private _resetCompletedTap;
|
|
46
|
+
private _resetTapSequence;
|
|
47
|
+
private _clearEngineDoubleClickSuppression;
|
|
39
48
|
private _initScrollEvent;
|
|
40
49
|
}
|
package/lib/types/controllers/render-controllers/mobile/mobile-scroll.render-controller.d.ts
CHANGED
|
@@ -46,18 +46,6 @@ export declare class MobileSheetsScrollRenderController extends Disposable imple
|
|
|
46
46
|
* to avoid interfering with header events
|
|
47
47
|
*/
|
|
48
48
|
private _initPointerScrollEvent;
|
|
49
|
-
/**
|
|
50
|
-
* Create zoom indicator overlay element
|
|
51
|
-
*/
|
|
52
|
-
private _createZoomIndicator;
|
|
53
|
-
/**
|
|
54
|
-
* Show zoom indicator with percentage
|
|
55
|
-
*/
|
|
56
|
-
private _showZoomIndicator;
|
|
57
|
-
/**
|
|
58
|
-
* Hide zoom indicator with fade out
|
|
59
|
-
*/
|
|
60
|
-
private _hideZoomIndicator;
|
|
61
49
|
private _updateSceneSize;
|
|
62
50
|
private _getSheetObject;
|
|
63
51
|
private _scrollToSelection;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { Disposable, ICommandService, IConfigService, Injector } from '@univerjs/core';
|
|
17
|
+
import { ComponentManager, ILayoutService, IMenuManagerService, IShortcutService, IUIPartsService } from '@univerjs/ui';
|
|
18
|
+
export declare class SheetUIController extends Disposable {
|
|
19
|
+
protected readonly _injector: Injector;
|
|
20
|
+
protected readonly _componentManager: ComponentManager;
|
|
21
|
+
protected readonly _layoutService: ILayoutService;
|
|
22
|
+
protected readonly _commandService: ICommandService;
|
|
23
|
+
protected readonly _shortcutService: IShortcutService;
|
|
24
|
+
protected readonly _menuManagerService: IMenuManagerService;
|
|
25
|
+
protected readonly _uiPartsService: IUIPartsService;
|
|
26
|
+
protected readonly _configService: IConfigService;
|
|
27
|
+
constructor(_injector: Injector, _componentManager: ComponentManager, _layoutService: ILayoutService, _commandService: ICommandService, _shortcutService: IShortcutService, _menuManagerService: IMenuManagerService, _uiPartsService: IUIPartsService, _configService: IConfigService);
|
|
28
|
+
private _init;
|
|
29
|
+
private _initComponents;
|
|
30
|
+
private _initCommands;
|
|
31
|
+
private _initMenus;
|
|
32
|
+
private _initShortcuts;
|
|
33
|
+
protected _initWorkbenchParts(): void;
|
|
34
|
+
protected _initFocusHandler(): void;
|
|
35
|
+
}
|
|
@@ -144,8 +144,8 @@ interface IFRangeSheetsUIMixin {
|
|
|
144
144
|
attachAlertPopup(alert: Omit<ICellAlert, 'location'>): IDisposable;
|
|
145
145
|
/**
|
|
146
146
|
* Attach a DOM popup to the current range.
|
|
147
|
-
* @param {IFCanvasPopup}
|
|
148
|
-
* @returns {Nullable<IDisposable>}
|
|
147
|
+
* @param {IFCanvasPopup} popup The popup to attach.
|
|
148
|
+
* @returns {Nullable<IDisposable>} A disposable that detaches the popup, or `null` if the popup cannot be attached.
|
|
149
149
|
* @example
|
|
150
150
|
* ```ts
|
|
151
151
|
* // Register a custom popup component
|
|
@@ -173,8 +173,8 @@ interface IFRangeSheetsUIMixin {
|
|
|
173
173
|
attachRangePopup(popup: IFCanvasPopup): Nullable<IDisposable>;
|
|
174
174
|
/**
|
|
175
175
|
* Highlight the range with the specified style and primary cell.
|
|
176
|
-
* @param {Nullable<Partial<ISelectionStyle>>} style - style for highlight range.
|
|
177
|
-
* @param {Nullable<ISelectionCell>} primary - primary cell for highlight range.
|
|
176
|
+
* @param {Nullable<Partial<ISelectionStyle>>} [style] - style for highlight range.
|
|
177
|
+
* @param {Nullable<ISelectionCell>} [primary] - primary cell for highlight range.
|
|
178
178
|
* @returns {IDisposable} The disposable object to remove the highlight.
|
|
179
179
|
* @example
|
|
180
180
|
* ```ts
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { ICellCustomRender, IDisposable, Nullable } from '@univerjs/core';
|
|
17
|
+
import type { IDragCellPosition, IEditorBridgeServiceVisibleParam, IHoverCellPosition } from '@univerjs/sheets-ui';
|
|
18
|
+
import { InterceptorEffectEnum } from '@univerjs/core';
|
|
19
|
+
import { FSheetHooks } from '@univerjs/sheets/facade';
|
|
20
|
+
/**
|
|
21
|
+
* @ignore
|
|
22
|
+
*/
|
|
23
|
+
export interface IFSheetHooksUIMixin {
|
|
24
|
+
/**
|
|
25
|
+
* The onCellPointerMove event is fired when a pointer changes coordinates.
|
|
26
|
+
* @deprecated use `univerAPI.addEvent(univerAPI.Event.CellPointerMove, (params) => {})` instead
|
|
27
|
+
* @param {function(Nullable<IHoverCellPosition>): void} callback - function that will be called when the event is fired
|
|
28
|
+
* @returns {IDisposable} A disposable object that can be used to unsubscribe from the event
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* univerAPI.getSheetHooks().onCellPointerMove((cellPos) => { console.log(cellPos)});
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
onCellPointerMove(callback: (cellPos: Nullable<IHoverCellPosition>) => void): IDisposable;
|
|
35
|
+
/**
|
|
36
|
+
* The onCellPointerOver event is fired when a pointer is moved into a cell's hit test boundaries.
|
|
37
|
+
* @deprecated use `univerAPI.addEvent(univerAPI.Event.CellHover, (params) => {})` instead
|
|
38
|
+
* @param {function(Nullable<IHoverCellPosition>): void} callback - function that will be called when the event is fired
|
|
39
|
+
* @returns {IDisposable} A disposable object that can be used to unsubscribe from the event
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* univerAPI.getSheetHooks().onCellPointerOver((cellPos) => { console.log(cellPos)});
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
onCellPointerOver(callback: (cellPos: Nullable<IHoverCellPosition>) => void): IDisposable;
|
|
46
|
+
/**
|
|
47
|
+
* The onCellDragOver event is fired when an element or text selection is being dragged into a cell's hit test boundaries.
|
|
48
|
+
* @deprecated use `univerAPI.addEvent(univerAPI.Event.DragOver, (params) => {})` instead
|
|
49
|
+
* @param {function (Nullable<IDragCellPosition>): void} callback Callback function that will be called when the event is fired
|
|
50
|
+
* @returns {IDisposable} A disposable object that can be used to unsubscribe from the event
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* univerAPI.getSheetHooks().onCellDragOver((cellPos) => { console.log(cellPos)});
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
onCellDragOver(callback: (cellPos: Nullable<IDragCellPosition>) => void): IDisposable;
|
|
57
|
+
/**
|
|
58
|
+
* The onCellDrop event is fired when an element or text selection is being dropped on the cell.
|
|
59
|
+
* @deprecated use `univerAPI.addEvent(univerAPI.Event.Drop, (params) => {})` instead
|
|
60
|
+
* @param {function(Nullable<IDragCellPosition>): void} callback Callback function that will be called when the event is fired
|
|
61
|
+
* @returns {IDisposable} A disposable object that can be used to unsubscribe from the event
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* univerAPI.getSheetHooks().onCellDrop((cellPos) => { console.log(cellPos)});
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
onCellDrop(callback: (cellPos: Nullable<IDragCellPosition>) => void): IDisposable;
|
|
68
|
+
/**
|
|
69
|
+
* The onCellRender event is fired when a cell is rendered.
|
|
70
|
+
* @param {Nullable<ICellCustomRender[]>} customRender Custom render function
|
|
71
|
+
* @param {InterceptorEffectEnum} [effect] The effect of the interceptor
|
|
72
|
+
* @param {number} priority The priority of the interceptor
|
|
73
|
+
* @returns {IDisposable} A disposable object that can be used to unsubscribe from the event
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
univerAPI.getSheetHooks().onCellRender([{
|
|
77
|
+
drawWith: (ctx, info) => {
|
|
78
|
+
const { row, col } = info;
|
|
79
|
+
// Update to any cell location you want
|
|
80
|
+
if (row === 1 && col === 2) {
|
|
81
|
+
const { primaryWithCoord } = info;
|
|
82
|
+
const { startX, startY } = primaryWithCoord;
|
|
83
|
+
ctx.fillText('Univer', startX, startY + 10);
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
}])
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
onCellRender(customRender: Nullable<ICellCustomRender[]>, effect?: InterceptorEffectEnum, priority?: number): IDisposable;
|
|
90
|
+
/**
|
|
91
|
+
* The onBeforeCellEdit event is fired before a cell is edited.
|
|
92
|
+
* @deprecated use `univerAPI.addEvent(univerAPI.Event.BeforeSheetEditStart, (params) => {})` instead
|
|
93
|
+
* @param callback Callback function that will be called when the event is fired
|
|
94
|
+
* @returns A disposable object that can be used to unsubscribe from the event
|
|
95
|
+
* @example
|
|
96
|
+
* ```ts
|
|
97
|
+
* univerAPI.getSheetHooks().onBeforeCellEdit((params) => {console.log(params)})
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
onBeforeCellEdit(callback: (params: IEditorBridgeServiceVisibleParam) => void): IDisposable;
|
|
101
|
+
/**
|
|
102
|
+
* The onAfterCellEdit event is fired after a cell is edited.
|
|
103
|
+
* @deprecated use `univerAPI.addEvent(univerAPI.Event.SheetEditEnded, (params) => {})` instead
|
|
104
|
+
* @param callback Callback function that will be called when the event is fired
|
|
105
|
+
* @returns A disposable object that can be used to unsubscribe from the event
|
|
106
|
+
* @example
|
|
107
|
+
* ```ts
|
|
108
|
+
* univerAPI.getSheetHooks().onAfterCellEdit((params) => {console.log(params)})
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
onAfterCellEdit(callback: (params: IEditorBridgeServiceVisibleParam) => void): IDisposable;
|
|
112
|
+
}
|
|
113
|
+
export declare class FSheetHooksUIMixin extends FSheetHooks implements IFSheetHooksUIMixin {
|
|
114
|
+
onCellPointerMove(callback: (cellPos: Nullable<IHoverCellPosition>) => void): IDisposable;
|
|
115
|
+
onCellPointerOver(callback: (cellPos: Nullable<IHoverCellPosition>) => void): IDisposable;
|
|
116
|
+
onCellDragOver(callback: (cellPos: Nullable<IDragCellPosition>) => void): IDisposable;
|
|
117
|
+
onCellDrop(callback: (cellPos: Nullable<IDragCellPosition>) => void): IDisposable;
|
|
118
|
+
onCellRender(customRender: Nullable<ICellCustomRender[]>, effect?: InterceptorEffectEnum, priority?: number): IDisposable;
|
|
119
|
+
onBeforeCellEdit(callback: (params: IEditorBridgeServiceVisibleParam) => void): IDisposable;
|
|
120
|
+
onAfterCellEdit(callback: (params: IEditorBridgeServiceVisibleParam) => void): IDisposable;
|
|
121
|
+
}
|
|
122
|
+
declare module '@univerjs/sheets/facade' {
|
|
123
|
+
interface FSheetHooks extends IFSheetHooksUIMixin {
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { FWorkbookPermission } from '@univerjs/sheets/facade';
|
|
17
|
+
/**
|
|
18
|
+
* @ignore
|
|
19
|
+
*/
|
|
20
|
+
export interface IFWorkbookPermissionSheetsUIMixin {
|
|
21
|
+
/**
|
|
22
|
+
* Set visibility of unauthorized pop-up window
|
|
23
|
+
* @param {boolean} visible - visibility of unauthorized pop-up window
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
27
|
+
* const permission = fWorkbook.getWorkbookPermission();
|
|
28
|
+
* permission.setPermissionDialogVisible(false);
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
setPermissionDialogVisible(visible: boolean): void;
|
|
32
|
+
}
|
|
33
|
+
export declare class FWorkbookPermissionSheetsUIMixin extends FWorkbookPermission implements IFWorkbookPermissionSheetsUIMixin {
|
|
34
|
+
setPermissionDialogVisible(visible: boolean): void;
|
|
35
|
+
}
|
|
36
|
+
declare module '@univerjs/sheets/facade' {
|
|
37
|
+
interface FWorkbookPermission extends IFWorkbookPermissionSheetsUIMixin {
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -83,7 +83,7 @@ export interface IFWorkbookSheetsUIMixin {
|
|
|
83
83
|
startEditing(): boolean;
|
|
84
84
|
/**
|
|
85
85
|
* End the editing process of the current active cell
|
|
86
|
-
* @param {boolean} save - Whether to save the changes, default is true
|
|
86
|
+
* @param {boolean} [save] - Whether to save the changes, default is true
|
|
87
87
|
* @returns {Promise<boolean>} Whether the editing process is ended successfully
|
|
88
88
|
* @example
|
|
89
89
|
* ```ts
|
|
@@ -116,7 +116,7 @@ export interface IFWorkbookSheetsUIMixin {
|
|
|
116
116
|
/**
|
|
117
117
|
* Get scroll state of specified sheet.
|
|
118
118
|
* @param {string} sheetId - sheet id
|
|
119
|
-
* @returns {IScrollState} scroll state
|
|
119
|
+
* @returns {Nullable<IScrollState>} The sheet scroll state, or a nullish value when no state is available.
|
|
120
120
|
* @example
|
|
121
121
|
* ``` ts
|
|
122
122
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
@@ -39,8 +39,8 @@ export interface IFWorksheetUIMixin {
|
|
|
39
39
|
/**
|
|
40
40
|
* Highlight multiple ranges on the worksheet.
|
|
41
41
|
* @param {FRange[]} ranges The ranges to highlight.
|
|
42
|
-
* @param {Nullable<Partial<ISelectionStyle>>} style - style for highlight ranges.
|
|
43
|
-
* @param {Nullable<ISelectionCell>} primary - primary cell for highlight ranges.
|
|
42
|
+
* @param {Nullable<Partial<ISelectionStyle>>} [style] - style for highlight ranges.
|
|
43
|
+
* @param {Nullable<ISelectionCell>} [primary] - primary cell for highlight ranges.
|
|
44
44
|
* @return {IDisposable} An IDisposable to remove the highlights.
|
|
45
45
|
* @example
|
|
46
46
|
* ```ts
|
|
@@ -87,7 +87,7 @@ export interface IFWorksheetUIMixin {
|
|
|
87
87
|
getZoom(): number;
|
|
88
88
|
/**
|
|
89
89
|
* Get visible range of main viewport.
|
|
90
|
-
* @returns {IRange}
|
|
90
|
+
* @returns {IRange | null} The visible range of the main viewport, or `null` if no sheet skeleton is available.
|
|
91
91
|
* @example
|
|
92
92
|
* ```ts
|
|
93
93
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
@@ -95,13 +95,15 @@ export interface IFWorksheetUIMixin {
|
|
|
95
95
|
* if (!fWorksheet) return;
|
|
96
96
|
* const visibleRange = fWorksheet.getVisibleRange();
|
|
97
97
|
* console.log(visibleRange);
|
|
98
|
-
*
|
|
98
|
+
* if (visibleRange) {
|
|
99
|
+
* console.log(fWorksheet.getRange(visibleRange).getA1Notation());
|
|
100
|
+
* }
|
|
99
101
|
* ```
|
|
100
102
|
*/
|
|
101
103
|
getVisibleRange(): IRange | null;
|
|
102
104
|
/**
|
|
103
105
|
* Get visible ranges of all viewports.
|
|
104
|
-
* @returns {
|
|
106
|
+
* @returns {Map<SHEET_VIEWPORT_KEY, IRange> | null} Visible ranges keyed by viewport in a `Map`, or `null` if no sheet skeleton is available.
|
|
105
107
|
* @example
|
|
106
108
|
* ```ts
|
|
107
109
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
@@ -110,7 +112,9 @@ export interface IFWorksheetUIMixin {
|
|
|
110
112
|
* const visibleRanges = fWorksheet.getVisibleRangesOfAllViewports();
|
|
111
113
|
* console.log(visibleRanges);
|
|
112
114
|
* const mainLeftTopViewportRange = visibleRanges?.get(univerAPI.Enum.SHEET_VIEWPORT_KEY.VIEW_MAIN_LEFT_TOP);
|
|
113
|
-
*
|
|
115
|
+
* if (mainLeftTopViewportRange) {
|
|
116
|
+
* console.log(fWorksheet.getRange(mainLeftTopViewportRange).getA1Notation());
|
|
117
|
+
* }
|
|
114
118
|
* ```
|
|
115
119
|
*/
|
|
116
120
|
getVisibleRangesOfAllViewports(): Map<SHEET_VIEWPORT_KEY, IRange> | null;
|
|
@@ -257,7 +261,7 @@ export interface IFWorksheetUIMixin {
|
|
|
257
261
|
*/
|
|
258
262
|
customizeRowHeader(cfg: IRowsHeaderCfgParam): void;
|
|
259
263
|
/**
|
|
260
|
-
*
|
|
264
|
+
* Sets the height of the column header in pixels.
|
|
261
265
|
* @param {number} height - The height to set.
|
|
262
266
|
* @returns {FWorksheet} - The FWorksheet instance for chaining.
|
|
263
267
|
* @example
|
|
@@ -270,7 +274,7 @@ export interface IFWorksheetUIMixin {
|
|
|
270
274
|
*/
|
|
271
275
|
setColumnHeaderHeight(height: number): FWorksheet;
|
|
272
276
|
/**
|
|
273
|
-
*
|
|
277
|
+
* Sets the width of the row header in pixels.
|
|
274
278
|
* @param {number} width - The width to set.
|
|
275
279
|
* @returns {FWorksheet} - The FWorksheet instance for chaining.
|
|
276
280
|
* @example
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { menuSchema } from './schema';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { MenuSchemaType } from '@univerjs/ui';
|
|
17
|
+
export declare const mobileMenuSchema: MenuSchemaType;
|
|
@@ -101,7 +101,7 @@ export declare class SheetCanvasPopManagerService extends Disposable {
|
|
|
101
101
|
* @param _unitId
|
|
102
102
|
* @param _subUnitId
|
|
103
103
|
* @param viewport
|
|
104
|
-
* @returns
|
|
104
|
+
* @returns A disposable that detaches the popup, or `null` if it cannot be attached.
|
|
105
105
|
*/
|
|
106
106
|
attachPopupToCell(row: number, col: number, popup: ICanvasPopup, _unitId?: string, _subUnitId?: string, viewport?: Viewport): Nullable<INeedCheckDisposable>;
|
|
107
107
|
/**
|
|
@@ -128,8 +128,7 @@ export declare class SheetCanvasPopManagerService extends Disposable {
|
|
|
128
128
|
private _calcCellPositionByCell;
|
|
129
129
|
/**
|
|
130
130
|
* Unlike _createCellPositionObserver, this accept a range not a single cell.
|
|
131
|
-
* @param
|
|
132
|
-
* @param initialCol
|
|
131
|
+
* @param range
|
|
133
132
|
* @param currentRender
|
|
134
133
|
* @param skeleton
|
|
135
134
|
* @param activeViewport
|
|
@@ -24,6 +24,8 @@ export declare function convertToCellStyle(cell: ICellDataWithSpanInfo, dataStre
|
|
|
24
24
|
v?: Nullable<import("@univerjs/core").CellValue>;
|
|
25
25
|
t?: Nullable<import("@univerjs/core").CellValueType>;
|
|
26
26
|
f?: Nullable<string>;
|
|
27
|
+
ft?: Nullable<import("@univerjs/core").FormulaType>;
|
|
28
|
+
fd?: Nullable<import("@univerjs/core").BooleanNumber>;
|
|
27
29
|
ref?: Nullable<string>;
|
|
28
30
|
xf?: Nullable<string>;
|
|
29
31
|
si?: Nullable<string>;
|
|
@@ -32,6 +32,7 @@ export declare class SheetSelectionRenderService extends BaseSelectionRenderServ
|
|
|
32
32
|
protected readonly _contextService: IContextService;
|
|
33
33
|
private readonly _workbookSelections;
|
|
34
34
|
private _renderDisposable;
|
|
35
|
+
private _selectionBeforeModifierClick;
|
|
35
36
|
constructor(_context: IRenderContext<Workbook>, injector: Injector, themeService: ThemeService, shortcutService: IShortcutService, selectionManagerService: SheetsSelectionsService, sheetSkeletonManagerService: SheetSkeletonManagerService, _logService: ILogService, _commandService: ICommandService, _contextService: IContextService);
|
|
36
37
|
private _init;
|
|
37
38
|
dispose(): void;
|
|
@@ -73,4 +74,6 @@ export declare class SheetSelectionRenderService extends BaseSelectionRenderServ
|
|
|
73
74
|
* @param scrollTimerType
|
|
74
75
|
*/
|
|
75
76
|
protected _onPointerDown(evt: IPointerEvent | IMouseEvent, _zIndex: number | undefined, rangeType: RANGE_TYPE | undefined, viewport: Nullable<Viewport>, scrollTimerType?: ScrollTimerType): void;
|
|
77
|
+
private _updateSelectionControl;
|
|
78
|
+
endSelection(): void;
|
|
76
79
|
}
|
|
@@ -15,10 +15,6 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { DropdownMenu } from '@univerjs/design';
|
|
17
17
|
import { AUTO_FILL_APPLY_TYPE } from '@univerjs/sheets';
|
|
18
|
-
export interface IAnchorPoint {
|
|
19
|
-
row: number;
|
|
20
|
-
col: number;
|
|
21
|
-
}
|
|
22
18
|
export interface IAutoFillPopupMenuItem {
|
|
23
19
|
label: string;
|
|
24
20
|
value: AUTO_FILL_APPLY_TYPE;
|
|
@@ -28,4 +24,4 @@ export interface IAutoFillPopupMenuItem {
|
|
|
28
24
|
export interface IAutoFillPopupMenuProps {
|
|
29
25
|
DropdownMenuComponent?: typeof DropdownMenu;
|
|
30
26
|
}
|
|
31
|
-
export declare function AutoFillPopupMenu({ DropdownMenuComponent }?: IAutoFillPopupMenuProps): import("react").JSX.Element
|
|
27
|
+
export declare function AutoFillPopupMenu({ DropdownMenuComponent }?: IAutoFillPopupMenuProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 AUTO_FILL_POPUP_MENU_COMPONENT = "sheets.component.auto-fill-popup-menu";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { ISheetLocationBase } from '@univerjs/sheets';
|
|
17
|
+
import type { IPopup } from '@univerjs/ui';
|
|
18
|
+
export declare const CellPopup: (props: {
|
|
19
|
+
popup: IPopup<ISheetLocationBase & {
|
|
20
|
+
direction: "horizontal" | "vertical";
|
|
21
|
+
}>;
|
|
22
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { ICascaderOption } from '@univerjs/design';
|
|
17
|
+
import type { IPopup } from '@univerjs/ui';
|
|
18
|
+
import type { IBaseDropdownProps } from '../type';
|
|
19
|
+
export interface ICascaderDropdownProps {
|
|
20
|
+
options: ICascaderOption[];
|
|
21
|
+
defaultValue?: string[];
|
|
22
|
+
onChange: (value: string[]) => void;
|
|
23
|
+
}
|
|
24
|
+
export declare function CascaderDropdown(props: {
|
|
25
|
+
popup: IPopup<ICascaderDropdownProps & IBaseDropdownProps>;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare namespace CascaderDropdown {
|
|
28
|
+
var componentKey: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { IPopup } from '@univerjs/ui';
|
|
17
|
+
import type { IBaseDropdownProps } from '../type';
|
|
18
|
+
export interface IColorDropdownProps {
|
|
19
|
+
defaultValue?: string;
|
|
20
|
+
onChange?: (value: string) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function ColorDropdown(props: {
|
|
23
|
+
popup: IPopup<IColorDropdownProps & IBaseDropdownProps>;
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare namespace ColorDropdown {
|
|
26
|
+
var componentKey: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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 { DateKit } from '@univerjs/core';
|
|
17
|
+
import type { IPopup } from '@univerjs/ui';
|
|
18
|
+
import type { IBaseDropdownProps } from '../type';
|
|
19
|
+
export interface IDateDropdownProps {
|
|
20
|
+
defaultValue?: DateKit;
|
|
21
|
+
onChange?: (value: DateKit | undefined) => boolean | Promise<boolean>;
|
|
22
|
+
patternType?: 'datetime' | 'date' | 'time';
|
|
23
|
+
showTime?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare function DateDropdown(props: {
|
|
26
|
+
popup: IPopup<IDateDropdownProps & IBaseDropdownProps>;
|
|
27
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export declare namespace DateDropdown {
|
|
29
|
+
var componentKey: string;
|
|
30
|
+
}
|