| 1 |
/// <reference types="react" /> |
| 2 |
import { Options as OffsetOptions } from './thirdparty/popper-core/modifiers/offset'; |
| 3 |
import { Placement } from './thirdparty/popper-core'; |
| 4 |
import '@patternfly/react-styles/css/components/Popper/Popper.css'; |
| 5 |
export declare const getOpacityTransition: (animationDuration: number) => string; |
| 6 |
/** Properties of Popper that can be used to customize its behavior. */ |
| 7 |
export interface PopperOptions { |
| 8 |
/** popper direction */ |
| 9 |
direction?: 'up' | 'down'; |
| 10 |
/** Horizontal position of the popper. Use the additional prop preventOverflow if seeing clipping. */ |
| 11 |
position?: 'right' | 'left' | 'center' | 'start' | 'end'; |
| 12 |
/** Instead of direction and position can set the placement of the popper */ |
| 13 |
placement?: Placement; |
| 14 |
/** Custom width of the popper. If the value is "trigger", it will set the width to the trigger element's width */ |
| 15 |
width?: string | 'trigger'; |
| 16 |
/** Minimum width of the popper. If the value is "trigger", it will set the min width to the trigger element's width */ |
| 17 |
minWidth?: string | 'trigger'; |
| 18 |
/** Maximum width of the popper. If the value is "trigger", it will set the max width to the trigger element's width */ |
| 19 |
maxWidth?: string | 'trigger'; |
| 20 |
/** The container to append the popper to. Defaults to 'inline'. */ |
| 21 |
appendTo?: HTMLElement | (() => HTMLElement) | 'inline'; |
| 22 |
/** z-index of the popper element */ |
| 23 |
zIndex?: number; |
| 24 |
/** |
| 25 |
* Map class names to positions, for example: |
| 26 |
* { |
| 27 |
* top: styles.modifiers.top, |
| 28 |
* bottom: styles.modifiers.bottom, |
| 29 |
* left: styles.modifiers.left, |
| 30 |
* right: styles.modifiers.right |
| 31 |
* } |
| 32 |
*/ |
| 33 |
positionModifiers?: { |
| 34 |
top?: string; |
| 35 |
right?: string; |
| 36 |
bottom?: string; |
| 37 |
left?: string; |
| 38 |
topStart?: string; |
| 39 |
topEnd?: string; |
| 40 |
bottomStart?: string; |
| 41 |
bottomEnd?: string; |
| 42 |
leftStart?: string; |
| 43 |
leftEnd?: string; |
| 44 |
rightStart?: string; |
| 45 |
rightEnd?: string; |
| 46 |
}; |
| 47 |
/** Distance of the popper to the trigger */ |
| 48 |
distance?: number; |
| 49 |
/** Override for the popper's offset */ |
| 50 |
offset?: OffsetOptions['offset']; |
| 51 |
/** Callback function when mouse enters trigger */ |
| 52 |
onMouseEnter?: (event?: MouseEvent) => void; |
| 53 |
/** Callback function when mouse leaves trigger */ |
| 54 |
onMouseLeave?: (event?: MouseEvent) => void; |
| 55 |
/** Callback function when trigger is focused */ |
| 56 |
onFocus?: (event?: FocusEvent) => void; |
| 57 |
/** Callback function when trigger is blurred (focus leaves) */ |
| 58 |
onBlur?: (event?: FocusEvent) => void; |
| 59 |
/** Callback function when trigger is clicked */ |
| 60 |
onTriggerClick?: (event?: MouseEvent) => void; |
| 61 |
/** Callback function when Enter key is used on trigger */ |
| 62 |
onTriggerEnter?: (event?: KeyboardEvent) => void; |
| 63 |
/** Callback function when popper is clicked */ |
| 64 |
onPopperClick?: (event?: MouseEvent) => void; |
| 65 |
/** Callback function when mouse enters popper content */ |
| 66 |
onPopperMouseEnter?: (event?: MouseEvent) => void; |
| 67 |
/** Callback function when mouse leaves popper content */ |
| 68 |
onPopperMouseLeave?: (event?: MouseEvent) => void; |
| 69 |
/** Callback function when document is clicked */ |
| 70 |
onDocumentClick?: (event?: MouseEvent, triggerElement?: HTMLElement, popperElement?: HTMLElement) => void; |
| 71 |
/** Callback function when keydown event occurs on document */ |
| 72 |
onDocumentKeyDown?: (event?: KeyboardEvent) => void; |
| 73 |
/** Enable to flip the popper when it reaches the boundary */ |
| 74 |
enableFlip?: boolean; |
| 75 |
/** The behavior of how the popper flips when it reaches the boundary */ |
| 76 |
flipBehavior?: 'flip' | ('top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end')[]; |
| 77 |
/** The duration of the CSS fade transition animation. */ |
| 78 |
animationDuration?: number; |
| 79 |
/** Delay in ms before the popper appears */ |
| 80 |
entryDelay?: number; |
| 81 |
/** Delay in ms before the popper disappears */ |
| 82 |
exitDelay?: number; |
| 83 |
/** Callback when popper's hide transition has finished executing */ |
| 84 |
onHidden?: () => void; |
| 85 |
/** |
| 86 |
* Lifecycle function invoked when the popper begins to transition out. |
| 87 |
*/ |
| 88 |
onHide?: () => void; |
| 89 |
/** |
| 90 |
* Lifecycle function invoked when the popper has been mounted to the DOM. |
| 91 |
*/ |
| 92 |
onMount?: () => void; |
| 93 |
/** |
| 94 |
* Lifecycle function invoked when the popper begins to transition in. |
| 95 |
*/ |
| 96 |
onShow?: () => void; |
| 97 |
/** |
| 98 |
* Lifecycle function invoked when the popper has fully transitioned in. |
| 99 |
*/ |
| 100 |
onShown?: () => void; |
| 101 |
/** Flag to prevent the popper from overflowing its container and becoming partially obscured. */ |
| 102 |
preventOverflow?: boolean; |
| 103 |
} |
| 104 |
/** Extends PopperOptions */ |
| 105 |
export interface PopperProps extends PopperOptions { |
| 106 |
/** |
| 107 |
* Trigger reference element to which the popper is relatively placed to. |
| 108 |
*/ |
| 109 |
trigger?: React.ReactNode; |
| 110 |
/** |
| 111 |
* A reference to the trigger reference element that can be passed instead of or along |
| 112 |
* with the trigger prop. When passed along with the trigger prop, the div element that |
| 113 |
* wraps the trigger will be removed. |
| 114 |
*/ |
| 115 |
triggerRef?: HTMLElement | (() => HTMLElement) | React.RefObject<any>; |
| 116 |
/** The popper (menu/tooltip/popover) element */ |
| 117 |
popper: React.ReactElement<any>; |
| 118 |
/** |
| 119 |
* Reference to the popper (menu/tooltip/popover) element. |
| 120 |
* Passing this prop will remove the wrapper div element from the popper. |
| 121 |
*/ |
| 122 |
popperRef?: HTMLElement | (() => HTMLElement) | React.RefObject<any>; |
| 123 |
/** True to make the popper visible */ |
| 124 |
isVisible?: boolean; |
| 125 |
} |
| 126 |
export declare const Popper: React.FunctionComponent<PopperProps>; |
| 127 |
//# sourceMappingURL=Popper.d.ts.map |