@univerjs/ui 0.6.9 → 0.6.10-alpha.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 +45 -45
- package/lib/es/index.js +4000 -3892
- package/lib/index.js +4000 -3892
- package/lib/types/components/menu/desktop/Menu.d.ts +1 -0
- package/lib/types/components/menu/desktop/tiny-menu-group.d.ts +8 -0
- package/lib/types/controllers/ui/ui.controller.d.ts +4 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/services/menu/menu-manager.service.d.ts +3 -0
- package/lib/types/services/menu/types.d.ts +9 -1
- package/lib/types/services/popup/canvas-popup.service.d.ts +2 -0
- package/lib/types/views/components/popup/RectPopup.d.ts +7 -3
- package/lib/types/views/components/ribbon/Ribbon.d.ts +1 -0
- package/lib/umd/index.js +45 -45
- package/package.json +6 -6
|
@@ -11,6 +11,7 @@ export interface IBaseMenuProps {
|
|
|
11
11
|
*/
|
|
12
12
|
overViewport?: 'scroll';
|
|
13
13
|
onOptionSelect?: (option: IValueOption) => void;
|
|
14
|
+
style?: React.CSSProperties;
|
|
14
15
|
}
|
|
15
16
|
/** @deprecated */
|
|
16
17
|
export declare const Menu: (props: IBaseMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IValueOption } from '../../../services/menu/menu';
|
|
2
|
+
import { IMenuSchema } from '../../../services/menu/menu-manager.service';
|
|
3
|
+
interface IUITinyMenuGroupProps {
|
|
4
|
+
item: IMenuSchema;
|
|
5
|
+
onOptionSelect?: (option: IValueOption) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function UITinyMenuGroup(props: IUITinyMenuGroupProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export {};
|
|
@@ -31,6 +31,10 @@ export interface IWorkbenchOptions {
|
|
|
31
31
|
* If Univer should make the context menu usable.
|
|
32
32
|
*/
|
|
33
33
|
contextMenu?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* If Univer should make the header menu visible.
|
|
36
|
+
*/
|
|
37
|
+
headerMenu?: boolean;
|
|
34
38
|
}
|
|
35
39
|
export interface IUIController {
|
|
36
40
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -74,6 +74,7 @@ export { UNIVER_UI_PLUGIN_NAME } from './ui-plugin';
|
|
|
74
74
|
export * from './utils';
|
|
75
75
|
export { ComponentContainer, type IComponentContainerProps, useComponentsOfPart } from './views/components/ComponentContainer';
|
|
76
76
|
export { ZenZone } from './views/components/zen-zone/ZenZone';
|
|
77
|
+
export { Menu as DesktopMenu } from './components/menu/desktop/Menu';
|
|
77
78
|
export { type IConfirmPartMethodOptions } from './views/components/confirm-part/interface';
|
|
78
79
|
export { DesktopContextMenu as ContextMenu } from './views/components/context-menu/ContextMenu';
|
|
79
80
|
export { MobileContextMenu } from './views/components/context-menu/MobileContextMenu';
|
|
@@ -5,8 +5,10 @@ export declare const IMenuManagerService: import('@wendellhu/redi').IdentifierDe
|
|
|
5
5
|
export interface IMenuSchema {
|
|
6
6
|
key: string;
|
|
7
7
|
order: number;
|
|
8
|
+
title?: string;
|
|
8
9
|
item?: IMenuItem;
|
|
9
10
|
children?: IMenuSchema[];
|
|
11
|
+
tiny?: boolean;
|
|
10
12
|
}
|
|
11
13
|
export interface IMenuManagerService {
|
|
12
14
|
readonly menuChanged$: Observable<void>;
|
|
@@ -18,6 +20,7 @@ export interface IMenuManagerService {
|
|
|
18
20
|
export type MenuSchemaType = {
|
|
19
21
|
order?: number;
|
|
20
22
|
menuItemFactory?: (accessor: IAccessor) => IMenuItem;
|
|
23
|
+
title?: string;
|
|
21
24
|
} | {
|
|
22
25
|
[key: string]: MenuSchemaType;
|
|
23
26
|
};
|
|
@@ -54,9 +54,17 @@ export declare enum ContextMenuPosition {
|
|
|
54
54
|
COL_HEADER = "contextMenu.colHeader",
|
|
55
55
|
ROW_HEADER = "contextMenu.rowHeader",
|
|
56
56
|
FOOTER_TABS = "contextMenu.footerTabs",
|
|
57
|
-
FOOTER_MENU = "contextMenu.footerMenu"
|
|
57
|
+
FOOTER_MENU = "contextMenu.footerMenu",
|
|
58
|
+
/**
|
|
59
|
+
* paragraph context menu in doc
|
|
60
|
+
*/
|
|
61
|
+
PARAGRAPH = "contextMenu.paragraph"
|
|
58
62
|
}
|
|
59
63
|
export declare enum ContextMenuGroup {
|
|
64
|
+
/**
|
|
65
|
+
* quick context menu, displayed as icon
|
|
66
|
+
*/
|
|
67
|
+
QUICK = "contextMenu.quick",
|
|
60
68
|
FORMAT = "contextMenu.format",
|
|
61
69
|
LAYOUT = "contextMenu.layout",
|
|
62
70
|
DATA = "contextMenu.data",
|
|
@@ -15,6 +15,8 @@ export interface IPopup extends Omit<IRectPopupProps, 'children' | 'hidden' | 'e
|
|
|
15
15
|
hideOnInvisible?: boolean;
|
|
16
16
|
hiddenType?: 'hide' | 'destroy';
|
|
17
17
|
hiddenRects$?: Observable<IBoundRectNoAngle[]>;
|
|
18
|
+
customActive?: boolean;
|
|
19
|
+
onActiveChange?: (active: boolean) => void;
|
|
18
20
|
}
|
|
19
21
|
export interface ICanvasPopupService {
|
|
20
22
|
addPopup(item: IPopup): string;
|
|
@@ -14,15 +14,19 @@ export interface IRectPopupProps {
|
|
|
14
14
|
*/
|
|
15
15
|
anchorRect$: Observable<IAbsolutePosition>;
|
|
16
16
|
excludeRects?: RefObject<Nullable<IAbsolutePosition[]>>;
|
|
17
|
-
direction?: 'vertical' | 'horizontal' | 'top' | 'right' | 'left' | 'bottom' | 'bottom-center' | 'top-center';
|
|
17
|
+
direction?: 'vertical' | 'horizontal' | 'top' | 'right' | 'left' | 'right-center' | 'left-center' | 'bottom' | 'bottom-center' | 'top-center';
|
|
18
18
|
hidden?: boolean;
|
|
19
19
|
onClickOutside?: (e: MouseEvent) => void;
|
|
20
20
|
excludeOutside?: HTMLElement[];
|
|
21
21
|
onContextMenu?: () => void;
|
|
22
|
-
onPointerEnter?: (e: React.
|
|
23
|
-
onPointerLeave?: (e: React.
|
|
22
|
+
onPointerEnter?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
23
|
+
onPointerLeave?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
24
24
|
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
|
|
25
25
|
portal?: boolean;
|
|
26
|
+
mask?: boolean;
|
|
27
|
+
zIndex?: number;
|
|
28
|
+
maskZIndex?: number;
|
|
29
|
+
onMaskClick?: () => void;
|
|
26
30
|
}
|
|
27
31
|
export interface IPopupLayoutInfo extends Pick<IRectPopupProps, 'direction'> {
|
|
28
32
|
position: IAbsolutePosition;
|