@univerjs/sheets-ui 1.1.0 → 1.3.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/index.js +233 -154
- package/lib/es/index.js +235 -156
- package/lib/index.css +4 -0
- package/lib/index.js +235 -156
- package/lib/types/controllers/editor/utils/get-edit-cell-input-position.d.ts +31 -0
- package/lib/types/controllers/mobile/ui-mobile.controller.d.ts +0 -1
- package/lib/types/controllers/render-controllers/header-unhide.render-controller.d.ts +1 -1
- package/lib/types/controllers/render-controllers/mobile/mobile-header-resize.render-controller.d.ts +4 -7
- package/lib/types/menu/menu.d.ts +1 -1
- package/lib/types/menu/sheet.menu.d.ts +1 -1
- package/lib/types/mobile-plugin.d.ts +1 -1
- package/lib/umd/index.js +5 -7
- package/package.json +14 -14
|
@@ -0,0 +1,31 @@
|
|
|
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 { Nullable } from '@univerjs/core';
|
|
17
|
+
import type { ICellEditorLayout } from '../../../services/editor-bridge.service';
|
|
18
|
+
/**
|
|
19
|
+
* Get the position of the hidden editor input for the current edit cell.
|
|
20
|
+
*
|
|
21
|
+
* The OS anchors the IME candidate window to the focused input, so the input should stay on the
|
|
22
|
+
* selected cell even before the cell editor opens. The position is kept inside the sheet canvas,
|
|
23
|
+
* so a cell scrolled out of view never moves the input outside the sheet.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getEditCellInputPosition(layout: Pick<ICellEditorLayout, 'position' | 'canvasOffset'>, canvasSize?: Nullable<{
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
}>): {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
};
|
|
@@ -43,4 +43,3 @@ export declare class SheetUIMobileController extends Disposable {
|
|
|
43
43
|
private _initMobileFxShortcut;
|
|
44
44
|
}
|
|
45
45
|
export declare function isMobileKeyboardVisible(stableHeight: number, visibleBottom: number): boolean;
|
|
46
|
-
export declare function shouldHideMobileEditorOnKeyboardClose(keyboardClosed: boolean, editorExpanded: boolean, functionPanelOpen: boolean, forceKeepVisible: boolean): boolean;
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { Workbook } from '@univerjs/core';
|
|
17
17
|
import type { IRenderContext } from '@univerjs/engine-render';
|
|
18
|
-
import type { IHeaderUnhideRangeVisibleCheck } from '../../services/header-unhide-range.service';
|
|
19
18
|
import { ICommandService, InterceptorManager, RxDisposable } from '@univerjs/core';
|
|
19
|
+
import type { IHeaderUnhideRangeVisibleCheck } from '../../services/header-unhide-range.service';
|
|
20
20
|
import { HeaderUnhideRangeService } from '../../services/header-unhide-range.service';
|
|
21
21
|
import { SheetSkeletonManagerService } from '../../services/sheet-skeleton-manager.service';
|
|
22
22
|
export declare const HEADER_UNHIDE_RANGE_VISIBLE_CHECK: import("@univerjs/core").IInterceptor<boolean, IHeaderUnhideRangeVisibleCheck>;
|
package/lib/types/controllers/render-controllers/mobile/mobile-header-resize.render-controller.d.ts
CHANGED
|
@@ -32,10 +32,7 @@ export declare class MobileHeaderResizeRenderController extends Disposable imple
|
|
|
32
32
|
private _columnResizeButton;
|
|
33
33
|
private _resizeHelperShape;
|
|
34
34
|
private _isDragging;
|
|
35
|
-
private
|
|
36
|
-
private _touchStartY;
|
|
37
|
-
private _touchMoveHandler;
|
|
38
|
-
private _touchEndHandler;
|
|
35
|
+
private _resizeListeners;
|
|
39
36
|
private _selectionSubscription;
|
|
40
37
|
private _scrollSubscription;
|
|
41
38
|
constructor(_context: IRenderContext<Workbook>, _sheetSkeletonManagerService: SheetSkeletonManagerService, _selectionManagerService: SheetsSelectionsService, _commandService: ICommandService, _contextService: IContextService, _scrollManagerService: SheetScrollManagerService);
|
|
@@ -48,13 +45,13 @@ export declare class MobileHeaderResizeRenderController extends Disposable imple
|
|
|
48
45
|
private _showRowResizeButton;
|
|
49
46
|
private _showColumnResizeButton;
|
|
50
47
|
private _updateButtonPositionOnScroll;
|
|
51
|
-
private
|
|
48
|
+
private _bindPointerEventsToButton;
|
|
52
49
|
private _startResize;
|
|
53
|
-
private
|
|
50
|
+
private _setupPointerHandlers;
|
|
51
|
+
private _bindResizeListeners;
|
|
54
52
|
private _createResizeHelper;
|
|
55
53
|
private _updateResizeHelper;
|
|
56
54
|
private _updateResizeButton;
|
|
57
55
|
private _cleanupResize;
|
|
58
|
-
private _cleanupTouchHandlers;
|
|
59
56
|
private _cancelResize;
|
|
60
57
|
}
|
package/lib/types/menu/menu.d.ts
CHANGED
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { IAccessor } from '@univerjs/core';
|
|
17
17
|
import type { IMenuButtonItem, IMenuSelectorItem } from '@univerjs/ui';
|
|
18
|
-
import type { LocaleKey } from '../locale/types';
|
|
19
18
|
import { HorizontalAlign, VerticalAlign, WrapStrategy } from '@univerjs/core';
|
|
20
19
|
import { Observable } from 'rxjs';
|
|
20
|
+
import type { LocaleKey } from '../locale/types';
|
|
21
21
|
export declare enum SheetMenuPosition {
|
|
22
22
|
ROW_HEADER_CONTEXT_MENU = "ROW_HEADER_CONTEXT_MENU",
|
|
23
23
|
COL_HEADER_CONTEXT_MENU = "COL_HEADER_CONTEXT_MENU",
|
|
@@ -19,7 +19,7 @@ import type { LocaleKey } from '../locale/types';
|
|
|
19
19
|
export declare function DeleteSheetMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
|
|
20
20
|
export declare function CopySheetMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
|
|
21
21
|
export declare function RenameSheetMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
|
|
22
|
-
export declare function ChangeColorSheetMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey>;
|
|
22
|
+
export declare function ChangeColorSheetMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey, string, string>;
|
|
23
23
|
export declare function HideSheetMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
|
|
24
24
|
export declare function UnHideSheetMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey>;
|
|
25
25
|
export declare function ShowMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey>;
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IUniverSheetsUIConfig } from './config/config';
|
|
17
16
|
import { IConfigService, Injector, IUniverInstanceService, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
18
17
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
18
|
+
import type { IUniverSheetsUIConfig } from './config/config';
|
|
19
19
|
export declare class UniverSheetsMobileUIPlugin extends Plugin {
|
|
20
20
|
private readonly _config;
|
|
21
21
|
readonly _injector: Injector;
|