power-focusable 4.0.0 → 4.0.1
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.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -39,7 +39,7 @@ function createFocusTrap(container) {
|
|
|
39
39
|
controller = null;
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function getFocusables(container
|
|
42
|
+
function getFocusables(container, options = {}) {
|
|
43
43
|
if (!(container instanceof Element)) {
|
|
44
44
|
console.warn("Invalid container element. Fallback: <body> element.");
|
|
45
45
|
container = document.body;
|
|
@@ -77,21 +77,21 @@ function getFocusables(container = document.body, options = {}) {
|
|
|
77
77
|
}
|
|
78
78
|
return normalizeRadioGroup(sortByTabIndex(elements)).filter(filter);
|
|
79
79
|
}
|
|
80
|
-
function getNextFocusable(container
|
|
80
|
+
function getNextFocusable(container, options = {}) {
|
|
81
81
|
if (!(container instanceof Element)) {
|
|
82
82
|
console.warn("Invalid container element. Fallback: <body> element.");
|
|
83
83
|
container = document.body;
|
|
84
84
|
}
|
|
85
85
|
return getRelativeFocusable(container, 1, options);
|
|
86
86
|
}
|
|
87
|
-
function getPreviousFocusable(container
|
|
87
|
+
function getPreviousFocusable(container, options = {}) {
|
|
88
88
|
if (!(container instanceof Element)) {
|
|
89
89
|
console.warn("Invalid container element. Fallback: <body> element.");
|
|
90
90
|
container = document.body;
|
|
91
91
|
}
|
|
92
92
|
return getRelativeFocusable(container, -1, options);
|
|
93
93
|
}
|
|
94
|
-
function hasFocusable(container
|
|
94
|
+
function hasFocusable(container, options = {}) {
|
|
95
95
|
if (!(container instanceof Element)) {
|
|
96
96
|
console.warn("Invalid container element. Fallback: <body> element.");
|
|
97
97
|
container = document.body;
|
|
@@ -398,7 +398,7 @@ function isUngroupedRadio(element) {
|
|
|
398
398
|
* Handles complex focus rules including tabindex ordering, radio groups, inert,
|
|
399
399
|
* and shadow DOM.
|
|
400
400
|
*
|
|
401
|
-
* @version 4.0.
|
|
401
|
+
* @version 4.0.1
|
|
402
402
|
* @author Yusuke Kamiyamane
|
|
403
403
|
* @license MIT
|
|
404
404
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -37,7 +37,7 @@ function createFocusTrap(container) {
|
|
|
37
37
|
controller = null;
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
function getFocusables(container
|
|
40
|
+
function getFocusables(container, options = {}) {
|
|
41
41
|
if (!(container instanceof Element)) {
|
|
42
42
|
console.warn("Invalid container element. Fallback: <body> element.");
|
|
43
43
|
container = document.body;
|
|
@@ -75,21 +75,21 @@ function getFocusables(container = document.body, options = {}) {
|
|
|
75
75
|
}
|
|
76
76
|
return normalizeRadioGroup(sortByTabIndex(elements)).filter(filter);
|
|
77
77
|
}
|
|
78
|
-
function getNextFocusable(container
|
|
78
|
+
function getNextFocusable(container, options = {}) {
|
|
79
79
|
if (!(container instanceof Element)) {
|
|
80
80
|
console.warn("Invalid container element. Fallback: <body> element.");
|
|
81
81
|
container = document.body;
|
|
82
82
|
}
|
|
83
83
|
return getRelativeFocusable(container, 1, options);
|
|
84
84
|
}
|
|
85
|
-
function getPreviousFocusable(container
|
|
85
|
+
function getPreviousFocusable(container, options = {}) {
|
|
86
86
|
if (!(container instanceof Element)) {
|
|
87
87
|
console.warn("Invalid container element. Fallback: <body> element.");
|
|
88
88
|
container = document.body;
|
|
89
89
|
}
|
|
90
90
|
return getRelativeFocusable(container, -1, options);
|
|
91
91
|
}
|
|
92
|
-
function hasFocusable(container
|
|
92
|
+
function hasFocusable(container, options = {}) {
|
|
93
93
|
if (!(container instanceof Element)) {
|
|
94
94
|
console.warn("Invalid container element. Fallback: <body> element.");
|
|
95
95
|
container = document.body;
|
|
@@ -396,7 +396,7 @@ function isUngroupedRadio(element) {
|
|
|
396
396
|
* Handles complex focus rules including tabindex ordering, radio groups, inert,
|
|
397
397
|
* and shadow DOM.
|
|
398
398
|
*
|
|
399
|
-
* @version 4.0.
|
|
399
|
+
* @version 4.0.1
|
|
400
400
|
* @author Yusuke Kamiyamane
|
|
401
401
|
* @license MIT
|
|
402
402
|
* @copyright Copyright (c) Yusuke Kamiyamane
|