pivotick / GraphUI / MenuActionItemOptions
Type Alias: MenuActionItemOptions<TThis>
MenuActionItemOptions<
TThis> =object
Defined in: interfaces/GraphUI.ts:1134
Options to define an action item in a menu. Can be used in contextual menus or multi-select menus.
Type Parameters
TThis
TThis extends UIElement = UIElement
Properties
dividerBefore?
optionaldividerBefore:boolean
Defined in: interfaces/GraphUI.ts:1169
Draw a rule above this row, to group what follows apart from what came before.
iconClass?
optionaliconClass:IconClass
Defined in: interfaces/GraphUI.ts:1137
iconUnicode?
optionaliconUnicode:IconUnicode
Defined in: interfaces/GraphUI.ts:1136
Unicode character for the icon (optional)
imagePath?
optionalimagePath:ImagePath
Defined in: interfaces/GraphUI.ts:1139
onclick()?
optionalonclick: (this,evt,element?) =>void
Defined in: interfaces/GraphUI.ts:1148
Optional: a row that only opens a MenuActionItemOptions.submenu needs no action of its own.
Parameters
this
TThis
evt
PointerEvent | MouseEvent
element?
Node | Node[] | Edge | Edge[] | Note | Note[] | null
Returns
void
shortcut?
optionalshortcut:string
Defined in: interfaces/GraphUI.ts:1171
The keybinding activates this function. This is just visual. The actual binding is defined in UIManager
submenu?
optionalsubmenu:MenuActionItemOptions<TThis>[] | (element) =>MenuActionItemOptions<TThis>[]
Defined in: interfaces/GraphUI.ts:1157
Rows that open in a panel beside this one, which then carries the click. The function form is resolved every time the menu opens, so a submenu may depend on the element it was opened over.
A row with a submenu keeps its own onclick if it has one; the click opens the panel either way, and closes it again on a second click.
suffix?
optionalsuffix:HTMLElement
Defined in: interfaces/GraphUI.ts:1167
An element pinned to the row's right-hand end, after the label — a count, a badge, anything the row's own text should not have to carry.
Held by the caller rather than described to the library, so it can still be written to once the menu is drawn: a value that is still being fetched fills its slot when it arrives. An element is in one place at a time, so a row built fresh on every open needs a fresh one too.
svgIcon?
optionalsvgIcon:SVGIcon
Defined in: interfaces/GraphUI.ts:1138
text
text:
string
Defined in: interfaces/GraphUI.ts:1141
Text of the option.
title?
optionaltitle:string
Defined in: interfaces/GraphUI.ts:1143
Title to be shown when hovering over the option.
variant?
optionalvariant:UIBaseVariant|UIOutlineVariant|UIOutlineSoftVariant
Defined in: interfaces/GraphUI.ts:1145
Default
outline-primaryvisible?
optionalvisible:boolean| (element) =>boolean
Defined in: interfaces/GraphUI.ts:1146