Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-cool-onclickoutside

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-cool-onclickoutside - npm Package Compare versions

Comparing version 1.3.4 to 1.3.5

2

dist/index.esm.js

@@ -1,1 +0,1 @@

import{useRef as n,useEffect as e}from"react";var t=function(n){return document.documentElement.clientWidth<=n.clientX||document.documentElement.clientHeight<=n.clientY},r=function(n){return!(!n.includes("touch")||!function(){if("undefined"==typeof window||"function"!=typeof window.addEventListener)return!1;var n=!1,e=Object.defineProperty({},"passive",{get:function(){n=!0}}),t=function(){return null};return window.addEventListener("test",t,e),window.removeEventListener("test",t,e),n}())&&{passive:!0}};export default function(i,o){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=u.disabled,d=void 0!==c&&c,f=u.eventTypes,a=void 0===f?["mousedown","touchstart"]:f,v=u.excludeScrollbar,s=void 0!==v&&v,l=n(null);e((function(){l.current=o}),[o]),e((function(){if(i&&l.current){var n=function(n){var e=Array.isArray(i)?i:[i],r=[];e.forEach((function(n){var e=n.current;e&&r.push(e)})),r.length&&(s&&t(n)||r.every((function(e){return!e.contains(n.target)}))&&l.current(n))},e=function(){a.forEach((function(e){document.removeEventListener(e,n,r(e))}))};if(!d)return a.forEach((function(e){document.addEventListener(e,n,r(e))})),function(){e()};e()}}),[i,s,d,a])}
import{useRef as n,useEffect as e}from"react";var t=function(n){return document.documentElement.clientWidth<=n.clientX||document.documentElement.clientHeight<=n.clientY},r=function(n){return!(!n.includes("touch")||!function(){if("undefined"==typeof window||"function"!=typeof window.addEventListener)return!1;var n=!1,e=Object.defineProperty({},"passive",{get:function(){n=!0}}),t=function(){return null};return window.addEventListener("test",t,e),window.removeEventListener("test",t,e),n}())&&{passive:!0}};export default function(i,o){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=u.disabled,d=void 0!==c&&c,f=u.eventTypes,a=void 0===f?["mousedown","touchstart"]:f,v=u.excludeScrollbar,s=void 0!==v&&v,l=n(o);e((function(){l.current=o}),[o]),e((function(){if(i){var n=function(n){var e=Array.isArray(i)?i:[i],r=[];e.forEach((function(n){var e=n.current;e&&r.push(e)})),r.length&&(s&&t(n)||r.every((function(e){return!e.contains(n.target)}))&&l.current(n))},e=function(){a.forEach((function(e){document.removeEventListener(e,n,r(e))}))};if(!d)return a.forEach((function(e){document.addEventListener(e,n,r(e))})),function(){e()};e()}}),[i,s,d,a])}

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=function(e){return document.documentElement.clientWidth<=e.clientX||document.documentElement.clientHeight<=e.clientY},t=function(e){return!(!e.includes("touch")||!function(){if("undefined"==typeof window||"function"!=typeof window.addEventListener)return!1;var e=!1,n=Object.defineProperty({},"passive",{get:function(){e=!0}}),t=function(){return null};return window.addEventListener("test",t,n),window.removeEventListener("test",t,n),e}())&&{passive:!0}};exports.default=function(r,u){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i.disabled,c=void 0!==o&&o,f=i.eventTypes,d=void 0===f?["mousedown","touchstart"]:f,s=i.excludeScrollbar,a=void 0!==s&&s,v=e.useRef(null);e.useEffect((function(){v.current=u}),[u]),e.useEffect((function(){if(r&&v.current){var e=function(e){var t=Array.isArray(r)?r:[r],u=[];t.forEach((function(e){var n=e.current;n&&u.push(n)})),u.length&&(a&&n(e)||u.every((function(n){return!n.contains(e.target)}))&&v.current(e))},u=function(){d.forEach((function(n){document.removeEventListener(n,e,t(n))}))};if(!c)return d.forEach((function(n){document.addEventListener(n,e,t(n))})),function(){u()};u()}}),[r,a,c,d])};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),n=function(e){return document.documentElement.clientWidth<=e.clientX||document.documentElement.clientHeight<=e.clientY},t=function(e){return!(!e.includes("touch")||!function(){if("undefined"==typeof window||"function"!=typeof window.addEventListener)return!1;var e=!1,n=Object.defineProperty({},"passive",{get:function(){e=!0}}),t=function(){return null};return window.addEventListener("test",t,n),window.removeEventListener("test",t,n),e}())&&{passive:!0}};exports.default=function(r,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=o.disabled,c=void 0!==u&&u,f=o.eventTypes,d=void 0===f?["mousedown","touchstart"]:f,s=o.excludeScrollbar,a=void 0!==s&&s,v=e.useRef(i);e.useEffect((function(){v.current=i}),[i]),e.useEffect((function(){if(r){var e=function(e){var t=Array.isArray(r)?r:[r],i=[];t.forEach((function(e){var n=e.current;n&&i.push(n)})),i.length&&(a&&n(e)||i.every((function(n){return!n.contains(e.target)}))&&v.current(e))},i=function(){d.forEach((function(n){document.removeEventListener(n,e,t(n))}))};if(!c)return d.forEach((function(n){document.addEventListener(n,e,t(n))})),function(){i()};i()}}),[r,a,c,d])};
{
"name": "react-cool-onclickoutside",
"version": "1.3.4",
"version": "1.3.5",
"description": "React hook to listen for clicks outside of the component(s).",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc