@univerjs/ui 0.5.0-alpha.0 → 0.5.0-beta.1
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 +15 -15
- package/lib/es/index.js +3801 -3995
- package/lib/types/index.d.ts +2 -4
- package/lib/types/services/menu/menu.d.ts +0 -32
- package/lib/types/views/components/ribbon/hook.d.ts +1 -24
- package/lib/umd/index.js +15 -15
- package/package.json +9 -11
- package/lib/types/commands/operations/editor/set-editor-resize.operation.d.ts +0 -2
- package/lib/types/services/menu/menu.service.d.ts +0 -57
package/lib/types/index.d.ts
CHANGED
|
@@ -49,8 +49,7 @@ export { DesktopLayoutService, ILayoutService } from './services/layout/layout.s
|
|
|
49
49
|
export { DesktopLocalFileService } from './services/local-file/desktop-local-file.service';
|
|
50
50
|
export { ILocalFileService, type IOpenFileOptions } from './services/local-file/local-file.service';
|
|
51
51
|
export { DesktopLocalStorageService } from './services/local-storage/local-storage.service';
|
|
52
|
-
export { type ICustomComponentProps, type IDisplayMenuItem, type IMenuButtonItem, type IMenuItem, type IMenuItemFactory, type IMenuSelectorItem, type IValueOption, type MenuConfig,
|
|
53
|
-
export { IMenuService, MenuService } from './services/menu/menu.service';
|
|
52
|
+
export { type ICustomComponentProps, type IDisplayMenuItem, type IMenuButtonItem, type IMenuItem, type IMenuItemFactory, type IMenuSelectorItem, type IValueOption, type MenuConfig, type MenuItemDefaultValueType, MenuItemType, } from './services/menu/menu';
|
|
54
53
|
export { IMenuManagerService, MenuManagerService, type MenuSchemaType } from './services/menu/menu-manager.service';
|
|
55
54
|
export { type IMenuSchema } from './services/menu/menu-manager.service';
|
|
56
55
|
export { ContextMenuGroup, ContextMenuPosition, MenuManagerPosition, RibbonDataGroup, RibbonFormulasGroup, RibbonInsertGroup, RibbonOthersGroup, RibbonPosition, RibbonStartGroup, RibbonViewGroup, } from './services/menu/types';
|
|
@@ -83,10 +82,9 @@ export { FloatDom } from './views/components/dom/FloatDom';
|
|
|
83
82
|
export { GlobalZone } from './views/components/global-zone/GlobalZone';
|
|
84
83
|
export { CanvasPopup } from './views/components/popup/CanvasPopup';
|
|
85
84
|
export { ToolbarButton } from './views/components/ribbon/Button/ToolbarButton';
|
|
86
|
-
export {
|
|
85
|
+
export { useToolbarItemStatus } from './views/components/ribbon/hook';
|
|
87
86
|
export { Ribbon } from './views/components/ribbon/Ribbon';
|
|
88
87
|
export { ToolbarItem } from './views/components/ribbon/ToolbarItem';
|
|
89
88
|
export { type ISidebarMethodOptions } from './views/components/sidebar/interface';
|
|
90
89
|
export { Sidebar } from './views/components/sidebar/Sidebar';
|
|
91
|
-
export { SetEditorResizeOperation } from './commands/operations/editor/set-editor-resize.operation';
|
|
92
90
|
export { ToggleShortcutPanelOperation } from './commands/operations/toggle-shortcut-panel.operation';
|
|
@@ -1,32 +1,6 @@
|
|
|
1
1
|
import { IAccessor } from '@univerjs/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
export type OneOrMany<T> = T | T[];
|
|
4
|
-
/** @deprecated */
|
|
5
|
-
export declare enum MenuPosition {
|
|
6
|
-
VOID = "void",
|
|
7
|
-
TOOLBAR_START = "ribbon.start",
|
|
8
|
-
TOOLBAR_INSERT = "ribbon.insert",
|
|
9
|
-
TOOLBAR_FORMULAS = "ribbon.formulas",
|
|
10
|
-
TOOLBAR_DATA = "ribbon.data",
|
|
11
|
-
TOOLBAR_VIEW = "ribbon.view",
|
|
12
|
-
TOOLBAR_OTHERS = "ribbon.others",
|
|
13
|
-
CONTEXT_MENU = "contextMenu.mainArea",
|
|
14
|
-
FOOTER = "footer"
|
|
15
|
-
}
|
|
16
|
-
/** @deprecated */
|
|
17
|
-
export declare enum MenuGroup {
|
|
18
|
-
TOOLBAR_HISTORY = 0,
|
|
19
|
-
TOOLBAR_FORMAT = 1,
|
|
20
|
-
TOOLBAR_LAYOUT = 2,
|
|
21
|
-
TOOLBAR_FORMULAS_INSERT = 3,
|
|
22
|
-
TOOLBAR_FORMULAS_VIEW = 4,
|
|
23
|
-
TOOLBAR_FILE = 5,
|
|
24
|
-
TOOLBAR_OTHERS = 6,
|
|
25
|
-
CONTEXT_MENU_FORMAT = 7,
|
|
26
|
-
CONTEXT_MENU_LAYOUT = 8,
|
|
27
|
-
CONTEXT_MENU_DATA = 9,
|
|
28
|
-
CONTEXT_MENU_OTHERS = 10
|
|
29
|
-
}
|
|
30
4
|
export declare enum MenuItemType {
|
|
31
5
|
/** Button style menu item. */
|
|
32
6
|
BUTTON = 0,
|
|
@@ -50,12 +24,6 @@ interface IMenuItemBase<V> {
|
|
|
50
24
|
description?: string;
|
|
51
25
|
icon?: string | Observable<string>;
|
|
52
26
|
tooltip?: string;
|
|
53
|
-
/** The group that the item belongs to. */
|
|
54
|
-
/** @deprecated group will be removed in the future. */
|
|
55
|
-
group?: MenuGroup;
|
|
56
|
-
/** In what menu should the item display. */
|
|
57
|
-
/** @deprecated positions will be removed in the future. */
|
|
58
|
-
positions?: OneOrMany<MenuPosition | string>;
|
|
59
27
|
type: MenuItemType;
|
|
60
28
|
/**
|
|
61
29
|
* Custom label component id.
|
|
@@ -1,26 +1,4 @@
|
|
|
1
|
-
import { IDisplayMenuItem, IMenuItem
|
|
2
|
-
type MenuPositionWithCustom = MenuPosition | string;
|
|
3
|
-
export interface IMenuGroup {
|
|
4
|
-
name: MenuPositionWithCustom;
|
|
5
|
-
menuItems: Array<IDisplayMenuItem<IMenuItem>>;
|
|
6
|
-
}
|
|
7
|
-
export interface IToolbarRenderHookHandler {
|
|
8
|
-
/** The activated category. */
|
|
9
|
-
category: MenuPositionWithCustom;
|
|
10
|
-
/** Update current activate category. */
|
|
11
|
-
setCategory: (position: MenuPositionWithCustom) => void;
|
|
12
|
-
visibleItems: IDisplayMenuItem<IMenuItem>[];
|
|
13
|
-
/** Menu grouped in this category. */
|
|
14
|
-
groups: IMenuGroup[];
|
|
15
|
-
groupsByKey: Record<MenuGroup, Array<IDisplayMenuItem<IMenuItem>>>;
|
|
16
|
-
}
|
|
17
|
-
export declare function useSimpleToolbarGroups(category: MenuPositionWithCustom): IDisplayMenuItem<IMenuItem>[];
|
|
18
|
-
/**
|
|
19
|
-
* If your custom toolbar component need to render menu items by their category,
|
|
20
|
-
* you can use this hook to get the toolbar status.
|
|
21
|
-
* @returns toolbar status
|
|
22
|
-
*/
|
|
23
|
-
export declare function useToolbarGroups(categories: MenuPositionWithCustom[], initCategory?: string): IToolbarRenderHookHandler;
|
|
1
|
+
import { IDisplayMenuItem, IMenuItem } from '../../../services/menu/menu';
|
|
24
2
|
export interface IToolbarItemStatus {
|
|
25
3
|
disabled: boolean;
|
|
26
4
|
value: any;
|
|
@@ -33,4 +11,3 @@ export interface IToolbarItemStatus {
|
|
|
33
11
|
* @returns The menu item's status
|
|
34
12
|
*/
|
|
35
13
|
export declare function useToolbarItemStatus(menuItem: IDisplayMenuItem<IMenuItem>): IToolbarItemStatus;
|
|
36
|
-
export {};
|