@zag-js/dom-utils
Advanced tools
Comparing version 0.0.0-dev-20220603082742 to 0.0.0-dev-20220603135505
@@ -6,3 +6,3 @@ export declare const focusableSelector: string; | ||
*/ | ||
export declare const getFocusables: (el: HTMLElement | Document | null, includeContainer?: boolean) => HTMLElement[]; | ||
export declare const getFocusables: (el: HTMLElement | Document | null, includeContainer?: boolean | "if-empty") => HTMLElement[]; | ||
/** | ||
@@ -15,3 +15,3 @@ * Whether this element is focusable | ||
*/ | ||
export declare const getTabbables: (el: HTMLElement | Document, includeContainer?: boolean) => HTMLElement[]; | ||
export declare const getTabbables: (el: HTMLElement | Document | null, includeContainer?: boolean | "if-empty") => HTMLElement[]; | ||
/** | ||
@@ -18,0 +18,0 @@ * Whether this element is tabbable |
@@ -743,3 +743,4 @@ var __create = Object.create; | ||
let els = Array.from(el.querySelectorAll(focusableSelector)); | ||
if (includeContainer && isHTMLElement(el)) { | ||
const shouldAddContainer = includeContainer == true || includeContainer == "if-empty" && els.length === 0; | ||
if (shouldAddContainer && isHTMLElement(el)) { | ||
els.unshift(el); | ||
@@ -755,2 +756,4 @@ } | ||
var getTabbables = (el, includeContainer = false) => { | ||
if (!el) | ||
return []; | ||
return getFocusables(el, includeContainer).filter(isTabbable); | ||
@@ -757,0 +760,0 @@ }; |
{ | ||
"name": "@zag-js/dom-utils", | ||
"version": "0.0.0-dev-20220603082742", | ||
"version": "0.0.0-dev-20220603135505", | ||
"description": "", | ||
@@ -29,3 +29,3 @@ "keywords": [ | ||
"@types/react": "^18.0.0", | ||
"@zag-js/utils": "0.0.0-dev-20220603082742", | ||
"@zag-js/utils": "0.0.0-dev-20220603135505", | ||
"scroll-into-view-if-needed": "^2.2.29" | ||
@@ -32,0 +32,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
269338
2757
+ Added@zag-js/utils@0.0.0-dev-20220603135505(transitive)
- Removed@zag-js/utils@0.0.0-dev-20220603082742(transitive)