sirius-common-utils 1.0.13 → 1.0.15

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.
@@ -984,38 +984,22 @@ function closetByClassName(elem, classNameList) {
984
984
  return null;
985
985
  }
986
986
  }
987
- function offset(node) {
987
+ function offset(domNode) {
988
988
  var offest = {
989
989
  top: 0,
990
990
  left: 0
991
991
  };
992
- if (!node.getClientRects().length) {
992
+ if (!domNode.getClientRects().length) {
993
993
  return offest;
994
994
  }
995
- if (window.getComputedStyle(node)["display"] === "none") {
995
+ if (window.getComputedStyle(domNode)["display"] === "none") {
996
996
  return offest;
997
997
  }
998
- offest = node.getBoundingClientRect();
999
- var docElement = node.ownerDocument.documentElement;
998
+ offest = domNode.getBoundingClientRect();
999
+ var docElement = domNode.ownerDocument.documentElement;
1000
1000
  return {
1001
- top: offest.top + window.pageYOffset - docElement.clientTop,
1002
- left: offest.left + window.pageXOffset - docElement.clientLeft
1003
- };
1004
- }
1005
- function getDomElemMouseRelativePosition(domElem, event, withWindowScrollFlag = false) {
1006
- let rect = domElem.getBoundingClientRect();
1007
- let style = getComputedStyle(domElem);
1008
- let marginLeft = parseInt(style.marginLeft);
1009
- let marginTop = parseInt(style.marginTop);
1010
- let scrollX = 0;
1011
- let scrollY = 0;
1012
- if (withWindowScrollFlag) {
1013
- scrollX = window.scrollX || window.pageXOffset;
1014
- scrollY = window.scrollY || window.pageYOffset;
1015
- }
1016
- return {
1017
- x: event.clientX - rect.left - marginLeft + scrollX,
1018
- y: event.clientY - rect.top - marginTop + scrollY
1001
+ top: offest.top + (window.scrollY || window.pageYOffset) - docElement.clientTop,
1002
+ left: offest.left + (window.scrollX || window.pageXOffset) - docElement.clientLeft
1019
1003
  };
1020
1004
  }
1021
1005
  const DomUtils = {
@@ -1023,7 +1007,6 @@ const DomUtils = {
1023
1007
  forbidBodyScroll,
1024
1008
  syncDomAnimation,
1025
1009
  closetByClassName,
1026
- getDomElemMouseRelativePosition,
1027
1010
  offset
1028
1011
  };
1029
1012
  function isIOS() {
@@ -985,38 +985,22 @@
985
985
  return null;
986
986
  }
987
987
  }
988
- function offset(node) {
988
+ function offset(domNode) {
989
989
  var offest = {
990
990
  top: 0,
991
991
  left: 0
992
992
  };
993
- if (!node.getClientRects().length) {
993
+ if (!domNode.getClientRects().length) {
994
994
  return offest;
995
995
  }
996
- if (window.getComputedStyle(node)["display"] === "none") {
996
+ if (window.getComputedStyle(domNode)["display"] === "none") {
997
997
  return offest;
998
998
  }
999
- offest = node.getBoundingClientRect();
1000
- var docElement = node.ownerDocument.documentElement;
999
+ offest = domNode.getBoundingClientRect();
1000
+ var docElement = domNode.ownerDocument.documentElement;
1001
1001
  return {
1002
- top: offest.top + window.pageYOffset - docElement.clientTop,
1003
- left: offest.left + window.pageXOffset - docElement.clientLeft
1004
- };
1005
- }
1006
- function getDomElemMouseRelativePosition(domElem, event, withWindowScrollFlag = false) {
1007
- let rect = domElem.getBoundingClientRect();
1008
- let style = getComputedStyle(domElem);
1009
- let marginLeft = parseInt(style.marginLeft);
1010
- let marginTop = parseInt(style.marginTop);
1011
- let scrollX = 0;
1012
- let scrollY = 0;
1013
- if (withWindowScrollFlag) {
1014
- scrollX = window.scrollX || window.pageXOffset;
1015
- scrollY = window.scrollY || window.pageYOffset;
1016
- }
1017
- return {
1018
- x: event.clientX - rect.left - marginLeft + scrollX,
1019
- y: event.clientY - rect.top - marginTop + scrollY
1002
+ top: offest.top + (window.scrollY || window.pageYOffset) - docElement.clientTop,
1003
+ left: offest.left + (window.scrollX || window.pageXOffset) - docElement.clientLeft
1020
1004
  };
1021
1005
  }
1022
1006
  const DomUtils = {
@@ -1024,7 +1008,6 @@
1024
1008
  forbidBodyScroll,
1025
1009
  syncDomAnimation,
1026
1010
  closetByClassName,
1027
- getDomElemMouseRelativePosition,
1028
1011
  offset
1029
1012
  };
1030
1013
  function isIOS() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sirius-common-utils",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "",
5
5
  "main": "./dist/sirius-common-utils.umd.cjs",
6
6
  "module": "./dist/sirius-common-utils.js",