context-menu
Classes
ContextMenuState
This class is a singleton that represents the state of the context menu.
It autohides based on the hovered state and filters items based on a query.
Properties
expanded
Is menu fully expanded
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:76
filteredItems
Filtered items.
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:91
hidingDelay
Delay before hiding menu in miliseconds.
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:65
items
Items of the menu.
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:73
minHeight
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:40
minWidth
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:41
onHide
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:70
pos
Position of the menu, in client coordinates.
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:38
searchbar
Visibility of the searchbar.
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:68
sort
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:88
target
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:35
Accessors
focused
Parameters
• f: boolean
Returns
boolean
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:116
hovered
Returns hovered state.
Sets hovered state and manages autohide.
Parameters
• v: boolean
Returns
boolean
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:151
query
Parameters
• q: string
Returns
string
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:80
visible
Parameters
• v: boolean
Returns
boolean
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:46
instance
Returns the singleton instance.
Returns
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:28
Methods
triggerFirstItem()
Returns
void
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:12
triggerItem()
Parameters
• i: number
Returns
void
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:15
Type Aliases
ShowContextMenu()
Parameters
• params
• params.expand?: boolean
• params.items: Partial
<MenuItem
>[]
• params.onHide?
• params.pos: Position
• params.searchbar?: boolean
• params.sort?: boolean
Whether to sort the items. Default to false.
• params.target?: HTMLElement
Returns
void
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:160
Variables
contextMenu
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:158
Functions
showContextMenu()
Shows the context menu with the given items at the given position.
Helper function to use the context menu singleton.
Parameters
• params
• params.expand?: boolean
• params.items: Partial
<MenuItem
>[]
• params.onHide?
• params.pos: Position
• params.searchbar?: boolean
• params.sort?: boolean
Whether to sort the items. Default to false.
• params.target?: HTMLElement
Returns
void
Defined in
tmp/commons/src/lib/components/menu/context-menu.svelte.ts:176