@activecollab/components 1.0.40 → 1.0.41

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", "onClick", "disableFocusLock", "disableScrollLock", "preventDefaultClickEvent"];
1728
+ var _excluded$L = ["children", "onClose", "className", "style", "onKeyDown", "disableFocusLock", "disableScrollLock"];
1729
1729
  var returnFocus = {
1730
1730
  preventScroll: true
1731
1731
  };
@@ -1735,13 +1735,10 @@
1735
1735
  className = _ref.className,
1736
1736
  style = _ref.style,
1737
1737
  onKeyDown = _ref.onKeyDown,
1738
- onClick = _ref.onClick,
1739
1738
  _ref$disableFocusLock = _ref.disableFocusLock,
1740
1739
  disableFocusLock = _ref$disableFocusLock === void 0 ? false : _ref$disableFocusLock,
1741
1740
  _ref$disableScrollLoc = _ref.disableScrollLock,
1742
1741
  disableScrollLock = _ref$disableScrollLoc === void 0 ? false : _ref$disableScrollLoc,
1743
- _ref$preventDefaultCl = _ref.preventDefaultClickEvent,
1744
- preventDefaultClickEvent = _ref$preventDefaultCl === void 0 ? false : _ref$preventDefaultCl,
1745
1742
  rest = _objectWithoutProperties(_ref, _excluded$L);
1746
1743
 
1747
1744
  var innerRef = React.useRef(null);
@@ -1764,10 +1761,6 @@
1764
1761
  onKeyDown(event);
1765
1762
  }
1766
1763
  }, [onClose, onKeyDown]);
1767
- var handleClick = React.useCallback(function (event) {
1768
- preventDefaultClickEvent && event.preventDefault();
1769
- typeof onClick === "function" && onClick(event);
1770
- }, [onClick, preventDefaultClickEvent]);
1771
1764
  React.useEffect(function () {
1772
1765
  return function () {
1773
1766
  typeof onClose === "function" && onClose();
@@ -1787,7 +1780,6 @@
1787
1780
  zIndex: zIndex
1788
1781
  }, style),
1789
1782
  onKeyDown: handleKeyDown,
1790
- onClick: handleClick,
1791
1783
  tabIndex: 0,
1792
1784
  className: classnames__default["default"]("c-window", className)
1793
1785
  }), children))));
@@ -1940,8 +1932,7 @@
1940
1932
  disableFocusLock: disableFocusLock,
1941
1933
  style: {
1942
1934
  position: windowAbsolutelyPositioned ? "absolute" : "fixed"
1943
- },
1944
- preventDefaultClickEvent: true
1935
+ }
1945
1936
  }, /*#__PURE__*/React__default["default"].createElement(Overlay, {
1946
1937
  className: backgroundElementClass,
1947
1938
  onClick: handleClose,
@@ -7607,8 +7598,9 @@
7607
7598
  typeof onClose === "function" && onClose();
7608
7599
  }
7609
7600
  }, [hasTransition, onClose]);
7610
- var handleBackgroundClick = React.useCallback(function () {
7601
+ var handleBackgroundClick = React.useCallback(function (event) {
7611
7602
  if (!disableBackgroundClick) {
7603
+ event.preventDefault();
7612
7604
  handleClose();
7613
7605
  }
7614
7606
  }, [disableBackgroundClick, handleClose]);
@@ -7641,8 +7633,7 @@
7641
7633
  ref: handleRef,
7642
7634
  onClose: handleClose,
7643
7635
  disableFocusLock: disableFocusLock,
7644
- disableScrollLock: disableScrollLock,
7645
- preventDefaultClickEvent: true
7636
+ disableScrollLock: disableScrollLock
7646
7637
  }), open ? /*#__PURE__*/React__default["default"].createElement(Overlay, {
7647
7638
  onClick: handleBackgroundClick,
7648
7639
  disableBackgroundColor: disableBackgroundColor
@@ -7770,8 +7761,9 @@
7770
7761
  var handleClose = React.useCallback(function () {
7771
7762
  setOpen(false);
7772
7763
  }, []);
7773
- var handleBackgroundClick = React.useCallback(function () {
7764
+ var handleBackgroundClick = React.useCallback(function (event) {
7774
7765
  if (!disableBackgroundClick) {
7766
+ event.preventDefault();
7775
7767
  handleClose();
7776
7768
  }
7777
7769
  }, [disableBackgroundClick, handleClose]);
@@ -7784,8 +7776,7 @@
7784
7776
  ref: handleRef,
7785
7777
  onClose: handleClose,
7786
7778
  disableFocusLock: disableFocusLock,
7787
- disableScrollLock: disableScrollLock,
7788
- preventDefaultClickEvent: true
7779
+ disableScrollLock: disableScrollLock
7789
7780
  }), open ? /*#__PURE__*/React__default["default"].createElement(Overlay, {
7790
7781
  onClick: handleBackgroundClick,
7791
7782
  disableBackgroundColor: disableBackgroundColor