@muraldevkit/ui-toolkit 4.38.0 → 4.39.0
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.
|
@@ -30,6 +30,12 @@ export interface MrlMenuProps {
|
|
|
30
30
|
* with opening/closing the menu.
|
|
31
31
|
*/
|
|
32
32
|
disableArrowOpen?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Disable flipping of the menu when it goes off the screen
|
|
35
|
+
*
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
disableFlipping?: boolean;
|
|
33
39
|
/** Unique identifier for the menu */
|
|
34
40
|
id?: string;
|
|
35
41
|
/**
|
|
@@ -118,7 +124,7 @@ export interface MrlMenuProps {
|
|
|
118
124
|
* @param {MrlMenuProps} props - The props for the MrlMenu component
|
|
119
125
|
* @returns {Element} - rendered MrlMenu component
|
|
120
126
|
*/
|
|
121
|
-
export declare function MrlMenu({ actionState, alignment, children, closeOnScroll, closeParent, customPosition, clickOutsideEvent, disableArrowOpen, id, isInternal, isSubMenu, spacing, menuOffset, portalProps, position, triggerStopPropagation, onClose, triggerRef, ...remainingProps }: MrlMenuProps): JSX.Element;
|
|
127
|
+
export declare function MrlMenu({ actionState, alignment, children, closeOnScroll, closeParent, customPosition, clickOutsideEvent, disableArrowOpen, disableFlipping, id, isInternal, isSubMenu, spacing, menuOffset, portalProps, position, triggerStopPropagation, onClose, triggerRef, ...remainingProps }: MrlMenuProps): JSX.Element;
|
|
122
128
|
export declare namespace MrlMenu {
|
|
123
129
|
var componentType: string;
|
|
124
130
|
}
|
|
@@ -33,6 +33,12 @@ export interface MrlPopoverProps {
|
|
|
33
33
|
* Example usage: MrlCallout component should not close when clicking outside, so it's set to true
|
|
34
34
|
*/
|
|
35
35
|
disableClickOutside?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Disable flipping of the popover when it goes off the screen
|
|
38
|
+
*
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
disableFlipping?: boolean;
|
|
36
42
|
/**
|
|
37
43
|
* If the popover should disable focus trap
|
|
38
44
|
*
|
|
@@ -125,7 +131,7 @@ export interface MrlPopoverProps {
|
|
|
125
131
|
* @param {MrlPopoverProps} props - The props for the MrlPopover component
|
|
126
132
|
* @returns {Element} - rendered MrlPopover component
|
|
127
133
|
*/
|
|
128
|
-
export declare function MrlPopover({ alignment, ariaLabel, ariaLabelledBy, children, className, customPosition, disableClickToOpen, disableClickOutside, disableFocusTrap, hasCloseButton, spacing, id, isSubMenu, actionState, position, point, portalProps, kind, offset, onClose, onOpen, triggerRef, ...rest }: MrlPopoverProps): JSX.Element;
|
|
134
|
+
export declare function MrlPopover({ alignment, ariaLabel, ariaLabelledBy, children, className, customPosition, disableClickToOpen, disableClickOutside, disableFlipping, disableFocusTrap, hasCloseButton, spacing, id, isSubMenu, actionState, position, point, portalProps, kind, offset, onClose, onOpen, triggerRef, ...rest }: MrlPopoverProps): JSX.Element;
|
|
129
135
|
export declare namespace MrlPopover {
|
|
130
136
|
var componentType: string;
|
|
131
137
|
}
|
|
@@ -11,6 +11,7 @@ import { Alignment, Position } from './constants';
|
|
|
11
11
|
* @param {boolean} isElementVisible - Tells the hook if the element is visible. If false, the hook will not calculate the position.
|
|
12
12
|
* @param {number} menuOffset - The offset of the menu from the trigger element.
|
|
13
13
|
* @param disable - Whether to disable the hook.
|
|
14
|
+
* @param disableFlipping - Whether to disable flipping logic when the menu overflows the screen.
|
|
14
15
|
* @returns {Position} The calculated position of the menu element.
|
|
15
16
|
*/
|
|
16
|
-
export declare const useTriggerPosition: (triggerRef: RefObject<HTMLElement> | undefined, elementRef: RefObject<HTMLElement>, menuAlign: Alignment, isElementVisible?: boolean, menuOffset?: number, disable?: boolean) => Position;
|
|
17
|
+
export declare const useTriggerPosition: (triggerRef: RefObject<HTMLElement> | undefined, elementRef: RefObject<HTMLElement>, menuAlign: Alignment, isElementVisible?: boolean, menuOffset?: number, disable?: boolean, disableFlipping?: boolean) => Position;
|
|
@@ -6,6 +6,7 @@ import { Alignment, Position } from './constants';
|
|
|
6
6
|
* @param {number} offset - The offset distance between the menu and the trigger.
|
|
7
7
|
* @param {DOMRect} elementRect - The bounding rectangle of the menu element.
|
|
8
8
|
* @param {DOMRect} [triggerRect] - The bounding rectangle of the trigger element.
|
|
9
|
+
* @param {boolean} [disableFlipping] - If true, prevents flipping to the opposite side when overflowing.
|
|
9
10
|
* @returns {Position} The calculated position of the menu.
|
|
10
11
|
*/
|
|
11
|
-
export declare const getPosition: (menuAlign: Alignment, offset: number, elementRect: DOMRect, triggerRect?: DOMRect) => Position;
|
|
12
|
+
export declare const getPosition: (menuAlign: Alignment, offset: number, elementRect: DOMRect, triggerRect?: DOMRect, disableFlipping?: boolean) => Position;
|