/var/www/cobraambalaj/node_modules/popper.js/src/utils
NameSizeModeActions
clockwise.js7730644editdlrm
computeAutoPlacement.js17140644editdlrm
debounce.js11210644editdlrm
find.js3970644editdlrm
findCommonOffsetParent.js16810644editdlrm
findIndex.js5340644editdlrm
getBordersSize.js5640644editdlrm
getBoundaries.js30000644editdlrm
getBoundingClientRect.js20280644editdlrm
getClientRect.js3630644editdlrm
getFixedPositionOffsetParent.js7560644editdlrm
getOffsetParent.js12710644editdlrm
getOffsetRect.js8010644editdlrm
getOffsetRectRelativeToArbitraryNode.js23150644editdlrm
getOppositePlacement.js3820644editdlrm
getOppositeVariation.js3820644editdlrm
getOuterSizes.js6520644editdlrm
getParentNode.js3150644editdlrm
getPopperOffsets.js16960644editdlrm
getReferenceNode.js4010644editdlrm
getReferenceOffsets.js10170644editdlrm
getRoot.js3090644editdlrm
getRoundedOffsets.js17540644editdlrm
getScroll.js6680644editdlrm
getScrollParent.js9100644editdlrm
getStyleComputedProperty.js4550644editdlrm
getSupportedPropertyName.js6760644editdlrm
getViewportOffsetRectRelativeToArtbitraryNode.js8980644editdlrm
getWindow.js2610644editdlrm
getWindowSizes.js7850644editdlrm
includeScroll.js8250644editdlrm
index.js29100644editdlrm
isBrowser.js1170644editdlrm
isFixed.js7000644editdlrm
isFunction.js3770644editdlrm
isIE.js5110644editdlrm
isModifierEnabled.js2850644editdlrm
isModifierRequired.js10950644editdlrm
isNumeric.js2330644editdlrm
isOffsetContainer.js2860644editdlrm
removeEventListeners.js6530644editdlrm
runModifiers.js13230644editdlrm
setAttributes.js5590644editdlrm
setStyles.js6950644editdlrm
setupEventListeners.js12180644editdlrm
Edit: /var/www/cobraambalaj/node_modules/popper.js/src/utils/getOffsetRectRelativeToArbitraryNode.js (2315B)
import getStyleComputedProperty from './getStyleComputedProperty'; import includeScroll from './includeScroll'; import getScrollParent from './getScrollParent'; import getBoundingClientRect from './getBoundingClientRect'; import runIsIE from './isIE'; import getClientRect from './getClientRect'; export default function getOffsetRectRelativeToArbitraryNode(children, parent, fixedPosition = false) { const isIE10 = runIsIE(10); const isHTML = parent.nodeName === 'HTML'; const childrenRect = getBoundingClientRect(children); const parentRect = getBoundingClientRect(parent); const scrollParent = getScrollParent(children); const styles = getStyleComputedProperty(parent); const borderTopWidth = parseFloat(styles.borderTopWidth); const borderLeftWidth = parseFloat(styles.borderLeftWidth); // In cases where the parent is fixed, we must ignore negative scroll in offset calc if(fixedPosition && isHTML) { parentRect.top = Math.max(parentRect.top, 0); parentRect.left = Math.max(parentRect.left, 0); } let offsets = getClientRect({ top: childrenRect.top - parentRect.top - borderTopWidth, left: childrenRect.left - parentRect.left - borderLeftWidth, width: childrenRect.width, height: childrenRect.height, }); offsets.marginTop = 0; offsets.marginLeft = 0; // Subtract margins of documentElement in case it's being used as parent // we do this only on HTML because it's the only element that behaves // differently when margins are applied to it. The margins are included in // the box of the documentElement, in the other cases not. if (!isIE10 && isHTML) { const marginTop = parseFloat(styles.marginTop); const marginLeft = parseFloat(styles.marginLeft); offsets.top -= borderTopWidth - marginTop; offsets.bottom -= borderTopWidth - marginTop; offsets.left -= borderLeftWidth - marginLeft; offsets.right -= borderLeftWidth - marginLeft; // Attach marginTop and marginLeft because in some circumstances we may need them offsets.marginTop = marginTop; offsets.marginLeft = marginLeft; } if ( isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY' ) { offsets = includeScroll(offsets, parent); } return offsets; }