@zag-js/interact-outside
Advanced tools
Comparing version 0.0.0-dev-20220703123907 to 0.0.0-dev-20220703125047
@@ -28,15 +28,2 @@ "use strict"; | ||
// ../dom/dist/index.mjs | ||
var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); | ||
var runIfFn = (v, ...a) => { | ||
const res = typeof v === "function" ? v(...a) : v; | ||
return res != null ? res : void 0; | ||
}; | ||
var isRef = (v) => hasProp(v, "current"); | ||
function addDomEvent(target, eventName, handler, options) { | ||
const node = isRef(target) ? target.current : runIfFn(target); | ||
node == null ? void 0 : node.addEventListener(eventName, handler, options); | ||
return () => { | ||
node == null ? void 0 : node.removeEventListener(eventName, handler, options); | ||
}; | ||
} | ||
function isWindow(value) { | ||
@@ -84,2 +71,15 @@ return (value == null ? void 0 : value.toString()) === "[object Window]"; | ||
} | ||
var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); | ||
var runIfFn = (v, ...a) => { | ||
const res = typeof v === "function" ? v(...a) : v; | ||
return res != null ? res : void 0; | ||
}; | ||
var isRef = (v) => hasProp(v, "current"); | ||
function addDomEvent(target, eventName, handler, options) { | ||
const node = isRef(target) ? target.current : runIfFn(target); | ||
node == null ? void 0 : node.addEventListener(eventName, handler, options); | ||
return () => { | ||
node == null ? void 0 : node.removeEventListener(eventName, handler, options); | ||
}; | ||
} | ||
@@ -86,0 +86,0 @@ // ../core/dist/index.mjs |
{ | ||
"name": "@zag-js/interact-outside", | ||
"version": "0.0.0-dev-20220703123907", | ||
"version": "0.0.0-dev-20220703125047", | ||
"description": "Track interations or focus outside an element", | ||
@@ -31,3 +31,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/dom-utils": "0.0.0-dev-20220703123907" | ||
"@zag-js/dom-utils": "0.0.0-dev-20220703125047" | ||
}, | ||
@@ -34,0 +34,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
+ Added@zag-js/dom-utils@0.0.0-dev-20220703125047(transitive)
+ Added@zag-js/types@0.0.0-dev-20220703125047(transitive)
- Removed@zag-js/dom-utils@0.0.0-dev-20220703123907(transitive)
- Removed@zag-js/types@0.0.0-dev-20220703123907(transitive)