indicator-ui 0.0.329 → 0.0.331

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
@@ -41815,16 +41815,29 @@ function useInteractiveZone() {
41815
41815
  }
41816
41816
  var ref = args[0],
41817
41817
  _args$ = args[1],
41818
- callbacks = _args$ === void 0 ? {} : _args$;
41818
+ callbacks = _args$ === void 0 ? {} : _args$,
41819
+ _args$2 = args[2],
41820
+ options = _args$2 === void 0 ? {} : _args$2;
41819
41821
  var onMissClick = callbacks.onMissClick,
41820
41822
  onInnerClick = callbacks.onInnerClick;
41823
+ var _options$ignore = options.ignore,
41824
+ ignore = _options$ignore === void 0 ? [] : _options$ignore,
41825
+ _options$addition = options.addition,
41826
+ addition = _options$addition === void 0 ? [] : _options$addition;
41821
41827
  (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
41822
41828
  function handleClick(event) {
41823
41829
  var target = event.target;
41824
41830
  if (!ref.current) return;
41825
- if (ref.current.contains(target)) {
41831
+ var isClickInTarget = ref.current.contains(target);
41832
+ var isClickInAddition = addition.find(function (item) {
41833
+ return !!(item !== null && item !== void 0 && item.contains(target));
41834
+ }) !== undefined;
41835
+ var isClickInIgnored = ignore.find(function (item) {
41836
+ return !!(item !== null && item !== void 0 && item.contains(target));
41837
+ }) !== undefined;
41838
+ if (isClickInTarget || isClickInAddition) {
41826
41839
  onInnerClick === null || onInnerClick === void 0 || onInnerClick();
41827
- } else {
41840
+ } else if (!isClickInIgnored) {
41828
41841
  onMissClick === null || onMissClick === void 0 || onMissClick();
41829
41842
  }
41830
41843
  }
@@ -41832,7 +41845,7 @@ function useInteractiveZone() {
41832
41845
  return function () {
41833
41846
  document.removeEventListener("mousedown", handleClick);
41834
41847
  };
41835
- }, [ref, onMissClick, onInnerClick]);
41848
+ }, [onMissClick, onInnerClick]);
41836
41849
  }
41837
41850
 
41838
41851
  /***/ }),