@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
26 lines (25 loc) • 1.18 kB
TypeScript
interface UseContextMenuHandlersOptions {
/** Props of the child element that opens the dropdown */
childProps: Record<string, any>;
/** If set, right-click trigger is disabled and the browser's default context menu is shown */
disabled: boolean | undefined;
/** Current opened state, used to set `data-expanded` on the child */
opened: boolean;
/** Delay in ms before a touch long-press opens the dropdown, `500` by default */
longPressDelay?: number;
/** Sets the floating reference to a virtual element positioned at the cursor */
setReference: (node: object) => void;
/** Called to open the dropdown after the reference has been set */
open: () => void;
}
export declare function useContextMenuHandlers({ childProps, disabled, opened, longPressDelay, setReference, open, }: UseContextMenuHandlersOptions): {
onContextMenu: (event?: any) => void;
onMouseDown: (event?: any) => void;
onTouchStart: (event?: any) => void;
onTouchEnd: (event?: any) => void;
onTouchCancel: (event?: any) => void;
onTouchMove: (event?: any) => void;
style: any;
'data-expanded': boolean | undefined;
};
export {};