feat(context-menu): add target prop to selectively trigger context menu

This commit is contained in:
metonym 2021-11-18 13:07:09 -08:00
commit f603106b18
4 changed files with 82 additions and 28 deletions

View file

@ -3,6 +3,13 @@ import { SvelteComponentTyped } from "svelte";
export interface ContextMenuProps
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["ul"]> {
/**
* Specify an element or list of elements to trigger the context menu.
* If no element is specified, the context menu applies to the entire window
* @default null
*/
target?: null | HTMLElement | HTMLElement[];
/**
* Set to `true` to open the menu
* Either `x` and `y` must be greater than zero