forked from alibaba/lowcode-engine
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcontext-menu.ts
More file actions
63 lines (51 loc) · 1.7 KB
/
context-menu.ts
File metadata and controls
63 lines (51 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { IPublicEnumContextMenuType } from '../enum';
import { IPublicModelNode } from '../model';
import { IPublicTypeI18nData } from './i8n-data';
import { IPublicTypeHelpTipConfig } from './widget-base-config';
export interface IPublicTypeContextMenuItem extends Omit<IPublicTypeContextMenuAction, 'condition' | 'disabled' | 'items'> {
disabled?: boolean;
items?: Omit<IPublicTypeContextMenuItem, 'items'>[];
}
export interface IPublicTypeContextMenuAction {
/**
* 动作的唯一标识符
* Unique identifier for the action
*/
name: string;
/**
* 显示的标题,可以是字符串或国际化数据
* Display title, can be a string or internationalized data
*/
title?: string | IPublicTypeI18nData;
/**
* 菜单项类型
* Menu item type
* @see IPublicEnumContextMenuType
* @default IPublicEnumContextMenuType.MENU_ITEM
*/
type?: IPublicEnumContextMenuType;
/**
* 点击时执行的动作,可选
* Action to execute on click, optional
*/
action?: (nodes?: IPublicModelNode[], event?: MouseEvent) => void;
/**
* 子菜单项或生成子节点的函数,可选,仅支持两级
* Sub-menu items or function to generate child node, optional
*/
items?: Omit<IPublicTypeContextMenuAction, 'items'>[] | ((nodes?: IPublicModelNode[]) => Omit<IPublicTypeContextMenuAction, 'items'>[]);
/**
* 显示条件函数
* Function to determine display condition
*/
condition?: (nodes?: IPublicModelNode[]) => boolean;
/**
* 禁用条件函数,可选
* Function to determine disabled condition, optional
*/
disabled?: (nodes?: IPublicModelNode[]) => boolean;
/**
* 帮助提示,可选
*/
help?: IPublicTypeHelpTipConfig;
}