@univerjs/sheets-ui 1.0.2 → 1.0.4
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 +581 -326
- package/lib/es/index.js +584 -330
- package/lib/index.css +0 -8
- package/lib/index.js +584 -330
- package/lib/types/commands/commands/set-selection.command.d.ts +2 -0
- package/lib/types/{views/editor-container/index.d.ts → common/selection-input.d.ts} +3 -2
- package/lib/types/config/config.d.ts +6 -0
- package/lib/types/controllers/editor/data-sync.controller.d.ts +1 -0
- package/lib/types/controllers/editor/editing.render-controller.d.ts +1 -0
- package/lib/types/controllers/render-controllers/contextmenu.render-controller.d.ts +6 -3
- package/lib/types/controllers/render-controllers/desktop-cell-edit.render-controller.d.ts +3 -1
- package/lib/types/index.d.ts +6 -4
- package/lib/types/menu/menu.d.ts +2 -0
- package/lib/types/services/editor-bridge.service.d.ts +4 -0
- package/lib/types/services/hover-manager.service.d.ts +2 -2
- package/lib/types/services/selection/base-selection-render.service.d.ts +2 -0
- package/lib/types/services/selection/selection-control.d.ts +6 -1
- package/lib/types/services/selection/selection-render.service.d.ts +1 -0
- package/lib/types/views/defined-name/DefinedNameOverlay.d.ts +5 -2
- package/lib/types/views/editor-container/focus-editor.d.ts +3 -2
- package/lib/umd/index.js +11 -11
- package/package.json +13 -13
|
@@ -48,6 +48,8 @@ export interface IExpandSelectionCommandParams {
|
|
|
48
48
|
jumpOver?: JumpOver;
|
|
49
49
|
nextStep?: number;
|
|
50
50
|
extra?: string;
|
|
51
|
+
/** Use the normal selection's primary cell to start a formula reference. */
|
|
52
|
+
fromCurrentSelection?: boolean;
|
|
51
53
|
}
|
|
52
54
|
export declare const ExpandSelectionCommand: ICommand<IExpandSelectionCommandParams>;
|
|
53
55
|
export interface ISelectAllCommandParams {
|
|
@@ -13,5 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
export
|
|
16
|
+
import type { IMouseEvent } from '@univerjs/engine-render';
|
|
17
|
+
export declare function isSheetContextMenuGesture(event: Pick<IMouseEvent, 'button' | 'ctrlKey'>, isMac: boolean, refSelectionsEnabled: boolean): boolean;
|
|
18
|
+
export declare function isSheetMultiSelectModifier(event: Pick<IMouseEvent, 'ctrlKey' | 'metaKey'>, isMac: boolean): boolean;
|
|
@@ -23,6 +23,12 @@ export interface IUniverSheetsUIConfig {
|
|
|
23
23
|
menu?: MenuConfig;
|
|
24
24
|
disableAutoFocus?: true;
|
|
25
25
|
override?: DependencyOverride;
|
|
26
|
+
/**
|
|
27
|
+
* Whether arrow keys may wrap to another row or column at worksheet boundaries.
|
|
28
|
+
* Does not affect Enter/Tab cycling within selected ranges.
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
allowArrowKeyWrapOnSheetBoundary?: boolean;
|
|
26
32
|
/**
|
|
27
33
|
* The maximum count of rows triggering auto height. This is used to avoid performance issue.
|
|
28
34
|
* @default 1000
|
|
@@ -47,6 +47,7 @@ export declare class EditorDataSyncController extends Disposable {
|
|
|
47
47
|
private _syncFormulaBarTextColorOnThemeChange;
|
|
48
48
|
private _refreshRenderStyleConfig;
|
|
49
49
|
private _checkAndSetRenderStyleConfig;
|
|
50
|
+
private _getFormulaBarTextColor;
|
|
50
51
|
protected _getSourceStyleRenderValue(isFormulaBar: boolean): BooleanNumber;
|
|
51
52
|
private _clearParagraph;
|
|
52
53
|
}
|
|
@@ -67,6 +67,7 @@ export declare class EditingRenderController extends Disposable {
|
|
|
67
67
|
*/
|
|
68
68
|
private _commandExecutedListener;
|
|
69
69
|
private _handleEditorVisible;
|
|
70
|
+
private _resizeEditorOnOpen;
|
|
70
71
|
private _cacheEmptyCellTextStyle;
|
|
71
72
|
private _refreshCurrentSelections;
|
|
72
73
|
private _handleEditorInvisible;
|
|
@@ -17,9 +17,9 @@ import type { Workbook } from '@univerjs/core';
|
|
|
17
17
|
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
18
18
|
import type { ISheetEmbedRuntimeDomScope } from '../../services/sheet-embed-integration.service';
|
|
19
19
|
import type { ISheetHostChromeOverride } from '../../services/sheet-host-chrome-override.service';
|
|
20
|
-
import { Disposable, Injector } from '@univerjs/core';
|
|
20
|
+
import { Disposable, IContextService, Injector } from '@univerjs/core';
|
|
21
21
|
import { SheetsSelectionsService } from '@univerjs/sheets';
|
|
22
|
-
import { IContextMenuService } from '@univerjs/ui';
|
|
22
|
+
import { IContextMenuService, IPlatformService } from '@univerjs/ui';
|
|
23
23
|
import { ISheetSelectionRenderService } from '../../services/selection/base-selection-render.service';
|
|
24
24
|
/**
|
|
25
25
|
* This controller subscribe to context menu events in sheet rendering views and invoke context menu at a correct
|
|
@@ -31,8 +31,11 @@ export declare class SheetContextMenuRenderController extends Disposable impleme
|
|
|
31
31
|
private readonly _selectionManagerService;
|
|
32
32
|
private readonly _selectionRenderService;
|
|
33
33
|
private readonly _injector;
|
|
34
|
-
|
|
34
|
+
private readonly _platformService;
|
|
35
|
+
private readonly _contextService;
|
|
36
|
+
constructor(_context: IRenderContext<Workbook>, _contextMenuService: IContextMenuService, _selectionManagerService: SheetsSelectionsService, _selectionRenderService: ISheetSelectionRenderService, _injector: Injector, _platformService: IPlatformService, _contextService: IContextService);
|
|
35
37
|
private _init;
|
|
38
|
+
private _isContextMenuGesture;
|
|
36
39
|
private _initEmbedRuntimeSessionListener;
|
|
37
40
|
private _shouldSuppressHostContextMenu;
|
|
38
41
|
private _getSheetHostChromeOverrideService;
|
|
@@ -18,6 +18,7 @@ import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
|
18
18
|
import { ICommandService, IContextService, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
|
19
19
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
20
20
|
import { SheetsSelectionsService } from '@univerjs/sheets';
|
|
21
|
+
import { IPlatformService } from '@univerjs/ui';
|
|
21
22
|
import { IEditorBridgeService } from '../../services/editor-bridge.service';
|
|
22
23
|
import { ISheetEmbedRuntimeFocusCoordinator } from '../../services/sheet-embed-integration.service';
|
|
23
24
|
export declare class DesktopCellEditRenderController extends RxDisposable implements IRenderModule {
|
|
@@ -28,9 +29,10 @@ export declare class DesktopCellEditRenderController extends RxDisposable implem
|
|
|
28
29
|
private readonly _selectionManagerService;
|
|
29
30
|
private readonly _contextService;
|
|
30
31
|
private readonly _renderManagerService;
|
|
32
|
+
private readonly _platformService;
|
|
31
33
|
private readonly _embedRuntimeFocusCoordinator?;
|
|
32
34
|
private _d;
|
|
33
|
-
constructor(_context: IRenderContext<Workbook>, _instanceService: IUniverInstanceService, _commandService: ICommandService, _editorBridgeService: IEditorBridgeService, _selectionManagerService: SheetsSelectionsService, _contextService: IContextService, _renderManagerService: IRenderManagerService, _embedRuntimeFocusCoordinator?: ISheetEmbedRuntimeFocusCoordinator | undefined);
|
|
35
|
+
constructor(_context: IRenderContext<Workbook>, _instanceService: IUniverInstanceService, _commandService: ICommandService, _editorBridgeService: IEditorBridgeService, _selectionManagerService: SheetsSelectionsService, _contextService: IContextService, _renderManagerService: IRenderManagerService, _platformService: IPlatformService, _embedRuntimeFocusCoordinator?: ISheetEmbedRuntimeFocusCoordinator | undefined);
|
|
34
36
|
private _init;
|
|
35
37
|
private _disposeCurrent;
|
|
36
38
|
private _initEventListener;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -143,13 +143,15 @@ export { calculateDocSkeletonRects, getCustomRangePosition, getEditingCustomRang
|
|
|
143
143
|
export { AutoFillPopupMenu } from './views/auto-fill-popup-menu/AutoFillPopupMenu';
|
|
144
144
|
export { BorderLine } from './views/border-panel/border-line/BorderLine';
|
|
145
145
|
export { BORDER_LINE_CHILDREN, BORDER_SIZE_CHILDREN } from './views/border-panel/interface';
|
|
146
|
-
export {
|
|
146
|
+
export { DEFINED_NAME_CONTAINER } from './views/defined-name/component-name';
|
|
147
|
+
export { EditorContainer } from './views/editor-container/EditorContainer';
|
|
148
|
+
export { useKeyEventConfig } from './views/editor-container/hooks';
|
|
147
149
|
export { FormulaBar } from './views/formula-bar';
|
|
148
150
|
export { useActiveWorkbook, useActiveWorksheet, useWorkbooks } from './views/hook';
|
|
149
151
|
export type { IRangeProtectionRenderCellData } from './views/permission/extensions/range-protection.render';
|
|
150
|
-
export {
|
|
151
|
-
export {
|
|
152
|
+
export type { IPermissionDetailUserPartProps } from './views/permission/panel-detail/PermissionDetailUserPart';
|
|
153
|
+
export type { IBaseSheetBarProps } from './views/sheet-bar/sheet-bar-tabs/SheetBarItem';
|
|
152
154
|
export { SheetBar } from './views/sheet-bar/SheetBar';
|
|
153
155
|
export { SHEET_FOOTER_BAR_HEIGHT } from './views/sheet-container/SheetContainer';
|
|
154
|
-
export {
|
|
156
|
+
export type { IStatisticItem } from './views/status-bar/CopyableStatisticItem';
|
|
155
157
|
export { functionDisplayNames } from './views/status-bar/CopyableStatisticItem';
|
package/lib/types/menu/menu.d.ts
CHANGED
|
@@ -71,6 +71,8 @@ export declare const COPY_SPECIAL_MENU_ID = "sheet.menu.copy-special";
|
|
|
71
71
|
export declare function CopySpacialMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey>;
|
|
72
72
|
export declare const PASTE_SPECIAL_MENU_ID = "sheet.menu.paste-special";
|
|
73
73
|
export declare function PasteSpacialMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey>;
|
|
74
|
+
export declare const PASTE_RIBBON_MENU_ID = "sheet.menu.paste";
|
|
75
|
+
export declare function PasteRibbonMenuItemFactory(accessor: IAccessor): IMenuSelectorItem<LocaleKey>;
|
|
74
76
|
export declare function PasteValueMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey, string>;
|
|
75
77
|
export declare function PasteFormatMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey, string>;
|
|
76
78
|
export declare function PasteColWidthMenuItemFactory(accessor: IAccessor): IMenuButtonItem<LocaleKey, string>;
|
|
@@ -110,7 +110,7 @@ export declare class HoverManagerService extends Disposable {
|
|
|
110
110
|
currentCellPosWithEvent$: import("rxjs").Observable<void | ICellPosWithEvent | null | undefined>;
|
|
111
111
|
currentPosition$: import("rxjs").Observable<Nullable<IHoverCellPosition>>;
|
|
112
112
|
currentClickedCell$: import("rxjs").Observable<IHoverRichTextInfo>;
|
|
113
|
-
currentDbClickedCell$: import("rxjs").Observable<IHoverRichTextInfo>;
|
|
113
|
+
currentDbClickedCell$: import("rxjs").Observable<IHoverRichTextInfo & ICellWithEvent>;
|
|
114
114
|
currentPointerDownCell$: import("rxjs").Observable<ICellPosWithEvent>;
|
|
115
115
|
currentPointerUpCell$: import("rxjs").Observable<ICellPosWithEvent>;
|
|
116
116
|
currentHoveredRowHeader$: import("rxjs").Observable<Nullable<IHoverHeaderPosition>>;
|
|
@@ -140,7 +140,7 @@ export declare class HoverManagerService extends Disposable {
|
|
|
140
140
|
* @param offsetY
|
|
141
141
|
*/
|
|
142
142
|
triggerClick(unitId: string, offsetX: number, offsetY: number): void;
|
|
143
|
-
triggerDbClick(unitId: string,
|
|
143
|
+
triggerDbClick(unitId: string, event: IPointerEvent | IMouseEvent): void;
|
|
144
144
|
triggerScroll(): void;
|
|
145
145
|
triggerRowHeaderClick(unitId: string, offsetX: number, offsetY: number): void;
|
|
146
146
|
triggerColHeaderClick(unitId: string, offsetX: number, offsetY: number): void;
|
|
@@ -216,6 +216,8 @@ export declare class BaseSelectionRenderService extends Disposable implements IS
|
|
|
216
216
|
x: number;
|
|
217
217
|
y: number;
|
|
218
218
|
}): Nullable<ISelectionWithCoord>;
|
|
219
|
+
protected _isContextMenuGesture(evt: IPointerEvent | IMouseEvent): boolean;
|
|
220
|
+
protected _isMultiSelectModifier(evt: IPointerEvent | IMouseEvent): boolean;
|
|
219
221
|
protected _checkClearPreviousControls(evt: IPointerEvent | IMouseEvent): void;
|
|
220
222
|
protected _makeSelectionByTwoCells(currentCell: ICellWithCoord, startSelectionRange: IRangeWithCoord, skeleton: SpreadsheetSkeleton, rangeType: RANGE_TYPE, activeControl: SelectionControl): void;
|
|
221
223
|
isSelectionEnabled(): boolean;
|
|
@@ -61,6 +61,9 @@ export declare class SelectionControl extends Disposable {
|
|
|
61
61
|
protected _scene: Scene;
|
|
62
62
|
protected _zIndex: number;
|
|
63
63
|
protected readonly _themeService: ThemeService;
|
|
64
|
+
private _moveAnimationFrame;
|
|
65
|
+
private _animatedRange;
|
|
66
|
+
private _restoreMoveEvents;
|
|
64
67
|
private _isHelperSelection;
|
|
65
68
|
/**
|
|
66
69
|
* For ref selections, there is no auto fill.
|
|
@@ -196,7 +199,9 @@ export declare class SelectionControl extends Disposable {
|
|
|
196
199
|
* Update range and primary range and style.
|
|
197
200
|
* @param selectionWthCoord
|
|
198
201
|
*/
|
|
199
|
-
updateRangeBySelectionWithCoord(selectionWthCoord: ISelectionWithCoord, sk?: SpreadsheetSkeleton): void;
|
|
202
|
+
updateRangeBySelectionWithCoord(selectionWthCoord: ISelectionWithCoord, sk?: SpreadsheetSkeleton, animate?: boolean): void;
|
|
203
|
+
private _animateMove;
|
|
204
|
+
private _stopMoveAnimation;
|
|
200
205
|
/**
|
|
201
206
|
* Update primary range.
|
|
202
207
|
* highlight cell would update if primary cell has value.
|
|
@@ -75,5 +75,6 @@ export declare class SheetSelectionRenderService extends BaseSelectionRenderServ
|
|
|
75
75
|
*/
|
|
76
76
|
protected _onPointerDown(evt: IPointerEvent | IMouseEvent, _zIndex: number | undefined, rangeType: RANGE_TYPE | undefined, viewport: Nullable<Viewport>, scrollTimerType?: ScrollTimerType): void;
|
|
77
77
|
private _updateSelectionControl;
|
|
78
|
+
private _canAnimateSelection;
|
|
78
79
|
endSelection(): void;
|
|
79
80
|
}
|
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
interface IDefinedNameOverlayProps {
|
|
17
17
|
search: string;
|
|
18
18
|
isInputEvent: boolean;
|
|
19
|
-
|
|
19
|
+
onClose: () => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function DefinedNameOverlay({ search, isInputEvent, onClose }: IDefinedNameOverlayProps): import("react").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -14,12 +14,13 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IDisposable } from '@univerjs/core';
|
|
17
|
+
import type { IEditorService } from '@univerjs/docs-ui';
|
|
17
18
|
import type { ISheetEmbedInteractionBoundaryService, ISheetEmbedRuntimeFocusCoordinator } from '../../services/sheet-embed-integration.service';
|
|
18
|
-
export declare function focusSheetCellEditorElement(
|
|
19
|
+
export declare function focusSheetCellEditorElement(editorService: IEditorService): boolean;
|
|
19
20
|
export declare function registerSheetCellEditorRuntimePortal(options: {
|
|
20
21
|
embedId: string;
|
|
22
|
+
editorService: IEditorService;
|
|
21
23
|
ownerDocument?: Document;
|
|
22
24
|
interactionBoundaryService?: ISheetEmbedInteractionBoundaryService;
|
|
23
25
|
focusCoordinator?: ISheetEmbedRuntimeFocusCoordinator;
|
|
24
26
|
}): IDisposable;
|
|
25
|
-
export declare function resolveSheetCellEditorPortalRoot(ownerDocument?: Document): HTMLElement | null;
|