@activecollab/components 1.0.37 → 1.0.38

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.
package/dist/index.js CHANGED
@@ -1725,7 +1725,7 @@
1725
1725
  })(["", " ", " position:fixed;top:0;right:0;bottom:0;left:0;"], FontStyle, BoxSizingStyle);
1726
1726
  StyledWindow.displayName = "StyledWindow";
1727
1727
 
1728
- var _excluded$L = ["children", "onClose", "className", "style", "onKeyDown", "disableFocusLock", "disableScrollLock"];
1728
+ var _excluded$L = ["children", "onClose", "className", "style", "onKeyDown", "onClick", "disableFocusLock", "disableScrollLock", "preventDefaultClickEvent"];
1729
1729
  var returnFocus = {
1730
1730
  preventScroll: true
1731
1731
  };
@@ -1735,10 +1735,13 @@
1735
1735
  className = _ref.className,
1736
1736
  style = _ref.style,
1737
1737
  onKeyDown = _ref.onKeyDown,
1738
+ onClick = _ref.onClick,
1738
1739
  _ref$disableFocusLock = _ref.disableFocusLock,
1739
1740
  disableFocusLock = _ref$disableFocusLock === void 0 ? false : _ref$disableFocusLock,
1740
1741
  _ref$disableScrollLoc = _ref.disableScrollLock,
1741
1742
  disableScrollLock = _ref$disableScrollLoc === void 0 ? false : _ref$disableScrollLoc,
1743
+ _ref$preventDefaultCl = _ref.preventDefaultClickEvent,
1744
+ preventDefaultClickEvent = _ref$preventDefaultCl === void 0 ? false : _ref$preventDefaultCl,
1742
1745
  rest = _objectWithoutProperties(_ref, _excluded$L);
1743
1746
 
1744
1747
  var innerRef = React.useRef(null);
@@ -1761,6 +1764,10 @@
1761
1764
  onKeyDown(event);
1762
1765
  }
1763
1766
  }, [onClose, onKeyDown]);
1767
+ var handleClick = React.useCallback(function (event) {
1768
+ preventDefaultClickEvent && event.preventDefault();
1769
+ typeof onClick === "function" && onClick(event);
1770
+ }, [onClick, preventDefaultClickEvent]);
1764
1771
  React.useEffect(function () {
1765
1772
  return function () {
1766
1773
  typeof onClose === "function" && onClose();
@@ -1780,6 +1787,7 @@
1780
1787
  zIndex: zIndex
1781
1788
  }, style),
1782
1789
  onKeyDown: handleKeyDown,
1790
+ onClick: handleClick,
1783
1791
  tabIndex: 0,
1784
1792
  className: classnames__default["default"]("c-window", className)
1785
1793
  }), children))));
@@ -1932,7 +1940,8 @@
1932
1940
  disableFocusLock: disableFocusLock,
1933
1941
  style: {
1934
1942
  position: windowAbsolutelyPositioned ? "absolute" : "fixed"
1935
- }
1943
+ },
1944
+ preventDefaultClickEvent: true
1936
1945
  }, /*#__PURE__*/React__default["default"].createElement(Overlay, {
1937
1946
  className: backgroundElementClass,
1938
1947
  onClick: handleClose,
@@ -7582,9 +7591,8 @@
7582
7591
  typeof onClose === "function" && onClose();
7583
7592
  }
7584
7593
  }, [hasTransition, onClose]);
7585
- var handleBackgroundClick = React.useCallback(function (event) {
7594
+ var handleBackgroundClick = React.useCallback(function () {
7586
7595
  if (!disableBackgroundClick) {
7587
- event.preventDefault();
7588
7596
  handleClose();
7589
7597
  }
7590
7598
  }, [disableBackgroundClick, handleClose]);
@@ -7617,7 +7625,8 @@
7617
7625
  ref: handleRef,
7618
7626
  onClose: handleClose,
7619
7627
  disableFocusLock: disableFocusLock,
7620
- disableScrollLock: disableScrollLock
7628
+ disableScrollLock: disableScrollLock,
7629
+ preventDefaultClickEvent: true
7621
7630
  }), open ? /*#__PURE__*/React__default["default"].createElement(Overlay, {
7622
7631
  onClick: handleBackgroundClick,
7623
7632
  disableBackgroundColor: disableBackgroundColor
@@ -7745,9 +7754,8 @@
7745
7754
  var handleClose = React.useCallback(function () {
7746
7755
  setOpen(false);
7747
7756
  }, []);
7748
- var handleBackgroundClick = React.useCallback(function (event) {
7757
+ var handleBackgroundClick = React.useCallback(function () {
7749
7758
  if (!disableBackgroundClick) {
7750
- event.preventDefault();
7751
7759
  handleClose();
7752
7760
  }
7753
7761
  }, [disableBackgroundClick, handleClose]);
@@ -7760,7 +7768,8 @@
7760
7768
  ref: handleRef,
7761
7769
  onClose: handleClose,
7762
7770
  disableFocusLock: disableFocusLock,
7763
- disableScrollLock: disableScrollLock
7771
+ disableScrollLock: disableScrollLock,
7772
+ preventDefaultClickEvent: true
7764
7773
  }), open ? /*#__PURE__*/React__default["default"].createElement(Overlay, {
7765
7774
  onClick: handleBackgroundClick,
7766
7775
  disableBackgroundColor: disableBackgroundColor