defaultMenuOptions
Description
An array of objects with default configuration parameters for context menu itemsinfo
This helper gets deprecated in version 3.0. To get the complete menu configuration with conditional options, use getMenuOptions().
defaultMenuOptions contains only the menu options that are always available. Options that appear conditionally (such as menu items related to split tasks) are not included here.
Default config
defaultMenuOptions = [
{
id: "add-task",
text: "Add",
icon: "wxi-plus",
data: [
{ id: "add-task:child", text: "Child task" },
{ id: "add-task:before", text: "Task above" },
{ id: "add-task:after", text: "Task below" },
],
},
{ comp: "separator" },
{
id: "convert-task",
text: "Convert to",
icon: "wxi-swap-horizontal",
dataFactory: type => {
return {
id: `convert-task:${type.id}`,
text: `${type.label}`,
check: exclude(type.id),
};
},
},
{
id: "edit-task",
text: "Edit",
icon: "wxi-edit",
subtext: "Ctrl+E",
},
{ id: "cut-task", text: "Cut", icon: "wxi-content-cut", subtext: "Ctrl+X" },
{
id: "copy-task",
text: "Copy",
icon: "wxi-content-copy",
subtext: "Ctrl+C",
},
{
id: "paste-task",
text: "Paste",
icon: "wxi-content-paste",
subtext: "Ctrl+V",
},
{
id: "move-task",
text: "Move",
icon: "wxi-swap-vertical",
data: [
{ id: "move-task:up", text: "Up" },
{ id: "move-task:down", text: "Down" },
],
},
{ comp: "separator" },
{ id: "indent-task:add", text: "Indent", icon: "wxi-indent" },
{ id: "indent-task:remove", text: "Outdent", icon: "wxi-unindent" },
{ comp: "separator" },
{
id: "delete-task",
icon: "wxi-delete",
text: "Delete",
subtext: "Ctrl+D / BS",
},
];
Parameters
The array includes objects with the next parameters for each menu item:
id- the id of a menu itemtext- the text for an itemicon- the name of an icon displayed before the text. It converts to addingi class={item.icon}, so any icons with the wxi- prefix can be used here, e.g wxi-plus or any customer icons defined on the page.comp- the component type of an item. Use"separator"to render a visual divider between menu sectionstype- deprecated usecompinstead. Will be removed in v3.0data- an array of sub items for a menu item. Used to create a tree-like menu structurecheck- the function that checks if the menu should be shown for the specified task
Related articles: