@muraldevkit/ui-toolkit 4.12.0 → 4.13.0-dev-u4HR.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MenuPosition, ActionState, MenuAlignment } from '../../menu/constants';
|
|
3
|
+
interface PopoverWithSelectProps {
|
|
4
|
+
hasCloseButton?: boolean;
|
|
5
|
+
menuAlign?: MenuPosition;
|
|
6
|
+
spacing?: 'default' | 'compact';
|
|
7
|
+
alignment?: MenuAlignment;
|
|
8
|
+
actionState?: ActionState;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
triggerAlignment?: 'left' | 'right' | 'center';
|
|
11
|
+
kind?: 'inverse' | 'primary';
|
|
12
|
+
point?: boolean;
|
|
13
|
+
disableFocusTrap?: boolean;
|
|
14
|
+
scrolling?: boolean;
|
|
15
|
+
position?: MenuPosition;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Demo of a popover with a select inside
|
|
19
|
+
*
|
|
20
|
+
* @param {PopoverWithSelectProps} props - The props for the menu with trigger
|
|
21
|
+
* @returns {Element} The menu with trigger demo
|
|
22
|
+
*/
|
|
23
|
+
export declare const PopoverWithSelect: ({ menuAlign, alignment, actionState, onClose, triggerAlignment, spacing, kind, point, hasCloseButton, disableFocusTrap }: PopoverWithSelectProps) => JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Hook to detect clicks outside of a given DOM element.
|
|
2
|
+
* Hook to detect clicks outside of a given DOM element, with an optional exclusion for selectors.
|
|
3
3
|
*
|
|
4
|
-
* @param menuRef - Reference to the DOM element
|
|
4
|
+
* @param menuRef - Reference to the DOM element to detect outside clicks for.
|
|
5
5
|
* @param triggerRef - Reference to the DOM element that caused this menu to be shown.
|
|
6
|
-
* @param eventType - Event type to listen for
|
|
7
|
-
* @param onOutsideClick - Function to call when a click is detected outside the menuRef element
|
|
8
|
-
* @param disabled - If the hook should be disabled
|
|
6
|
+
* @param eventType - Event type to listen for.
|
|
7
|
+
* @param onOutsideClick - Function to call when a click is detected outside the menuRef element.
|
|
8
|
+
* @param disabled - If the hook should be disabled.
|
|
9
|
+
* @param excludeSelectors - Optional array of CSS selectors to exclude from the outside click detection.
|
|
9
10
|
*/
|
|
10
|
-
export declare const useClickOutside: (menuRef: React.RefObject<HTMLElement>, triggerRef: React.RefObject<HTMLElement> | undefined, eventType: "click" | "mousedown" | "mouseup" | undefined, onOutsideClick: () => void, disabled?: boolean) => void;
|
|
11
|
+
export declare const useClickOutside: (menuRef: React.RefObject<HTMLElement>, triggerRef: React.RefObject<HTMLElement> | undefined, eventType: "click" | "mousedown" | "mouseup" | undefined, onOutsideClick: () => void, disabled?: boolean, excludeSelectors?: string[]) => void;
|