@gechiui/components
Version:
UI components for GeChiUI.
70 lines • 4.61 kB
TypeScript
/**
* Utility used to compute the popover position over the xAxis
*
* @param {Object} anchorRect Anchor Rect.
* @param {Object} contentSize Content Size.
* @param {string} xAxis Desired xAxis.
* @param {string} corner Desired corner.
* @param {boolean} stickyBoundaryElement The boundary element to use when
* switching between sticky and normal
* position.
* @param {string} chosenYAxis yAxis to be used.
* @param {Element} boundaryElement Boundary element.
* @param {boolean} forcePosition Don't adjust position based on anchor.
* @param {boolean} forceXAlignment Don't adjust alignment based on YAxis
*
* @return {Object} Popover xAxis position and constraints.
*/
export function computePopoverXAxisPosition(anchorRect: Object, contentSize: Object, xAxis: string, corner: string, stickyBoundaryElement: boolean, chosenYAxis: string, boundaryElement: Element, forcePosition: boolean, forceXAlignment: boolean): Object;
/**
* Utility used to compute the popover position over the yAxis
*
* @param {Object} anchorRect Anchor Rect.
* @param {Object} contentSize Content Size.
* @param {string} yAxis Desired yAxis.
* @param {string} corner Desired corner.
* @param {boolean} stickyBoundaryElement The boundary element to use when switching between sticky
* and normal position.
* @param {Element} anchorRef The anchor element.
* @param {Element} relativeOffsetTop If applicable, top offset of the relative positioned
* parent container.
* @param {boolean} forcePosition Don't adjust position based on anchor.
* @param {Element|null} editorWrapper Element that wraps the editor content. Used to access
* scroll position to determine sticky behavior.
* @return {Object} Popover xAxis position and constraints.
*/
export function computePopoverYAxisPosition(anchorRect: Object, contentSize: Object, yAxis: string, corner: string, stickyBoundaryElement: boolean, anchorRef: Element, relativeOffsetTop: Element, forcePosition: boolean, editorWrapper: Element | null): Object;
/**
* Utility used to compute the popover position and the content max width/height for a popover given
* its anchor rect and its content size.
*
* @param {Object} anchorRect Anchor Rect.
* @param {Object} contentSize Content Size.
* @param {string} position Position.
* @param {boolean} stickyBoundaryElement The boundary element to use when switching between
* sticky and normal position.
* @param {Element} anchorRef The anchor element.
* @param {number} relativeOffsetTop If applicable, top offset of the relative positioned
* parent container.
* @param {Element} boundaryElement Boundary element.
* @param {boolean} forcePosition Don't adjust position based on anchor.
* @param {boolean} forceXAlignment Don't adjust alignment based on YAxis
* @param {Element|null} editorWrapper Element that wraps the editor content. Used to access
* scroll position to determine sticky behavior.
* @return {Object} Popover position and constraints.
*/
export function computePopoverPosition(anchorRect: Object, contentSize: Object, position: string | undefined, stickyBoundaryElement: boolean, anchorRef: Element, relativeOffsetTop: number, boundaryElement: Element, forcePosition: boolean, forceXAlignment: boolean, editorWrapper: Element | null): Object;
/**
* Offsets the given rect by the position of the iframe that contains the
* element. If the owner document is not in an iframe then it returns with the
* original rect. If the popover container document and the anchor document are
* the same, the original rect will also be returned.
*
* @param {DOMRect} rect bounds of the element
* @param {Document} ownerDocument document of the element
* @param {Element} container The popover container to position.
*
* @return {DOMRect} offsetted bounds
*/
export function offsetIframe(rect: DOMRect, ownerDocument: Document, container: Element): DOMRect;
//# sourceMappingURL=utils.d.ts.map