@zag-js/auto-resize
Advanced tools
Comparing version 0.0.0-dev-20221229205502 to 0.0.0-dev-20230201181615
@@ -32,6 +32,5 @@ "use strict"; | ||
function isWindow(value) { | ||
return (value == null ? void 0 : value.toString()) === "[object Window]"; | ||
return value?.toString() === "[object Window]"; | ||
} | ||
function getDocument(el) { | ||
var _a; | ||
if (isWindow(el)) | ||
@@ -41,7 +40,6 @@ return el.document; | ||
return el; | ||
return (_a = el == null ? void 0 : el.ownerDocument) != null ? _a : document; | ||
return el?.ownerDocument ?? document; | ||
} | ||
function getWindow(el) { | ||
var _a; | ||
return (_a = el == null ? void 0 : el.ownerDocument.defaultView) != null ? _a : window; | ||
return el?.ownerDocument.defaultView ?? window; | ||
} | ||
@@ -76,12 +74,12 @@ | ||
const rect = win.getComputedStyle(ghost); | ||
input == null ? void 0 : input.style.setProperty("width", rect.width); | ||
input?.style.setProperty("width", rect.width); | ||
}); | ||
} | ||
resize(); | ||
input == null ? void 0 : input.addEventListener("input", resize); | ||
input == null ? void 0 : input.addEventListener("change", resize); | ||
input?.addEventListener("input", resize); | ||
input?.addEventListener("change", resize); | ||
return () => { | ||
doc.body.removeChild(ghost); | ||
input == null ? void 0 : input.removeEventListener("input", resize); | ||
input == null ? void 0 : input.removeEventListener("change", resize); | ||
input?.removeEventListener("input", resize); | ||
input?.removeEventListener("change", resize); | ||
}; | ||
@@ -88,0 +86,0 @@ } |
{ | ||
"name": "@zag-js/auto-resize", | ||
"version": "0.0.0-dev-20221229205502", | ||
"version": "0.0.0-dev-20230201181615", | ||
"description": "Autoresize utilities for the web", | ||
@@ -26,3 +26,3 @@ "keywords": [ | ||
"clean-package": "2.2.0", | ||
"@zag-js/dom-utils": "0.0.0-dev-20221229205502" | ||
"@zag-js/dom-utils": "0.0.0-dev-20230201181615" | ||
}, | ||
@@ -29,0 +29,0 @@ "clean-package": "../../../clean-package.config.json", |
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
8795
149