PHP 8.2.30
Preview: getClippingRect.js Size: 3.32 KB
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/@popperjs/core/lib/dom-utils/getClippingRect.js

import { viewport } from "../enums.js";
import getViewportRect from "./getViewportRect.js";
import getDocumentRect from "./getDocumentRect.js";
import listScrollParents from "./listScrollParents.js";
import getOffsetParent from "./getOffsetParent.js";
import getDocumentElement from "./getDocumentElement.js";
import getComputedStyle from "./getComputedStyle.js";
import { isElement, isHTMLElement } from "./instanceOf.js";
import getBoundingClientRect from "./getBoundingClientRect.js";
import getParentNode from "./getParentNode.js";
import contains from "./contains.js";
import getNodeName from "./getNodeName.js";
import rectToClientRect from "../utils/rectToClientRect.js";
import { max, min } from "../utils/math.js";

function getInnerBoundingClientRect(element, strategy) {
  var rect = getBoundingClientRect(element, false, strategy === 'fixed');
  rect.top = rect.top + element.clientTop;
  rect.left = rect.left + element.clientLeft;
  rect.bottom = rect.top + element.clientHeight;
  rect.right = rect.left + element.clientWidth;
  rect.width = element.clientWidth;
  rect.height = element.clientHeight;
  rect.x = rect.left;
  rect.y = rect.top;
  return rect;
}

function getClientRectFromMixedType(element, clippingParent, strategy) {
  return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
} // A "clipping parent" is an overflowable container with the characteristic of
// clipping (or hiding) overflowing elements with a position different from
// `initial`


function getClippingParents(element) {
  var clippingParents = listScrollParents(getParentNode(element));
  var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
  var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;

  if (!isElement(clipperElement)) {
    return [];
  } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414


  return clippingParents.filter(function (clippingParent) {
    return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';
  });
} // Gets the maximum area that the element is visible in due to any number of
// clipping parents


export default function getClippingRect(element, boundary, rootBoundary, strategy) {
  var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
  var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
  var firstClippingParent = clippingParents[0];
  var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
    var rect = getClientRectFromMixedType(element, clippingParent, strategy);
    accRect.top = max(rect.top, accRect.top);
    accRect.right = min(rect.right, accRect.right);
    accRect.bottom = min(rect.bottom, accRect.bottom);
    accRect.left = max(rect.left, accRect.left);
    return accRect;
  }, getClientRectFromMixedType(element, firstClippingParent, strategy));
  clippingRect.width = clippingRect.right - clippingRect.left;
  clippingRect.height = clippingRect.bottom - clippingRect.top;
  clippingRect.x = clippingRect.left;
  clippingRect.y = clippingRect.top;
  return clippingRect;
}

Directory Contents

Dirs: 0 × Files: 69

Name Size Perms Modified Actions
76 B lrw-r--r-- 2026-02-28 00:29:44
Edit Download
677 B lrw-r--r-- 2026-02-28 00:29:44
Edit Download
697 B lrw-r--r-- 2026-02-28 00:29:46
Edit Download
217 B lrw-r--r-- 2026-02-28 00:29:48
Edit Download
1.34 KB lrw-r--r-- 2026-02-28 00:29:48
Edit Download
1.45 KB lrw-r--r-- 2026-02-28 00:29:48
Edit Download
283 B lrw-r--r-- 2026-02-28 00:29:50
Edit Download
3.32 KB lrw-r--r-- 2026-02-28 00:29:50
Edit Download
3.69 KB lrw-r--r-- 2026-02-28 00:29:52
Edit Download
212 B lrw-r--r-- 2026-02-28 00:29:52
Edit Download
2.02 KB lrw-r--r-- 2026-02-28 00:29:54
Edit Download
2.14 KB lrw-r--r-- 2026-02-28 00:29:54
Edit Download
81 B lrw-r--r-- 2026-02-28 00:29:56
Edit Download
148 B lrw-r--r-- 2026-02-28 00:29:56
Edit Download
190 B lrw-r--r-- 2026-02-28 00:29:58
Edit Download
124 B lrw-r--r-- 2026-02-28 00:29:58
Edit Download
311 B lrw-r--r-- 2026-02-28 00:29:58
Edit Download
420 B lrw-r--r-- 2026-02-28 00:29:58
Edit Download
107 B lrw-r--r-- 2026-02-28 00:29:58
Edit Download
1.20 KB lrw-r--r-- 2026-02-28 00:29:58
Edit Download
1.17 KB lrw-r--r-- 2026-02-28 00:29:58
Edit Download
120 B lrw-r--r-- 2026-02-28 00:29:58
Edit Download
142 B lrw-r--r-- 2026-02-28 00:29:58
Edit Download
167 B lrw-r--r-- 2026-02-28 00:30:00
Edit Download
105 B lrw-r--r-- 2026-02-28 00:30:00
Edit Download
767 B lrw-r--r-- 2026-02-28 00:30:02
Edit Download
821 B lrw-r--r-- 2026-02-28 00:30:02
Edit Download
149 B lrw-r--r-- 2026-02-28 00:30:02
Edit Download
114 B lrw-r--r-- 2026-02-28 00:30:04
Edit Download
190 B lrw-r--r-- 2026-02-28 00:30:04
Edit Download
146 B lrw-r--r-- 2026-02-28 00:30:06
Edit Download
396 B lrw-r--r-- 2026-02-28 00:30:06
Edit Download
450 B lrw-r--r-- 2026-02-28 00:30:06
Edit Download
64 B lrw-r--r-- 2026-02-28 00:30:06
Edit Download
2.55 KB lrw-r--r-- 2026-02-28 00:30:06
Edit Download
2.70 KB lrw-r--r-- 2026-02-28 00:30:06
Edit Download
73 B lrw-r--r-- 2026-02-28 00:30:06
Edit Download
759 B lrw-r--r-- 2026-02-28 00:30:08
Edit Download
789 B lrw-r--r-- 2026-02-28 00:30:08
Edit Download
66 B lrw-r--r-- 2026-02-28 00:30:08
Edit Download
546 B lrw-r--r-- 2026-02-28 00:30:08
Edit Download
564 B lrw-r--r-- 2026-02-28 00:30:08
Edit Download
217 B lrw-r--r-- 2026-02-28 00:30:08
Edit Download
881 B lrw-r--r-- 2026-02-28 00:30:10
Edit Download
964 B lrw-r--r-- 2026-02-28 00:30:10
Edit Download
51 B lrw-r--r-- 2026-02-28 00:30:10
Edit Download
273 B lrw-r--r-- 2026-02-28 00:30:10
Edit Download
383 B lrw-r--r-- 2026-02-28 00:30:12
Edit Download
148 B lrw-r--r-- 2026-02-28 00:30:12
Edit Download
258 B lrw-r--r-- 2026-02-28 00:30:12
Edit Download
306 B lrw-r--r-- 2026-02-28 00:30:12
Edit Download
71 B lrw-r--r-- 2026-02-28 00:30:12
Edit Download
721 B lrw-r--r-- 2026-02-28 00:30:14
Edit Download
754 B lrw-r--r-- 2026-02-28 00:30:14
Edit Download
214 B lrw-r--r-- 2026-02-28 00:30:14
Edit Download
621 B lrw-r--r-- 2026-02-28 00:30:14
Edit Download
902 B lrw-r--r-- 2026-02-28 00:30:14
Edit Download
53 B lrw-r--r-- 2026-02-28 00:30:16
Edit Download
159 B lrw-r--r-- 2026-02-28 00:30:16
Edit Download
167 B lrw-r--r-- 2026-02-28 00:30:16
Edit Download
71 B lrw-r--r-- 2026-02-28 00:30:16
Edit Download
440 B lrw-r--r-- 2026-02-28 00:30:18
Edit Download
349 B lrw-r--r-- 2026-02-28 00:30:18
Edit Download
67 B lrw-r--r-- 2026-02-28 00:30:20
Edit Download
162 B lrw-r--r-- 2026-02-28 00:30:20
Edit Download
188 B lrw-r--r-- 2026-02-28 00:30:22
Edit Download
188 B lrw-r--r-- 2026-02-28 00:30:22
Edit Download
1.15 KB lrw-r--r-- 2026-02-28 00:30:22
Edit Download
1.20 KB lrw-r--r-- 2026-02-28 00:30:24
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).