power-focusable 2.0.0 → 2.0.2
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/README.md +4 -1
- package/dist/index.cjs +6 -8
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# Power Focusable
|
|
2
2
|
|
|
3
|
-
High-precision focus management utility with shadow DOM support. Handles complex focus rules.
|
|
3
|
+
High-precision focus management utility with shadow DOM support. Handles complex focus rules including tabindex ordering, radio groups, etc.
|
|
4
|
+
|
|
5
|
+
> [!NOTE]
|
|
6
|
+
> Supports shadow DOM traversal via the composed tree. Only open shadow roots are included; closed shadow roots are not accessible.
|
|
4
7
|
|
|
5
8
|
## Install
|
|
6
9
|
|
package/dist/index.cjs
CHANGED
|
@@ -74,13 +74,11 @@ function getFocusables(container = document.body, options = {}) {
|
|
|
74
74
|
return elements2;
|
|
75
75
|
}
|
|
76
76
|
const placeholder = /* @__PURE__ */ new Set();
|
|
77
|
-
for (const
|
|
78
|
-
if (
|
|
79
|
-
const enabled =
|
|
77
|
+
for (const radios of map.values()) {
|
|
78
|
+
if (radios.length > 0) {
|
|
79
|
+
const enabled = radios.filter((radio) => isFocusable(radio));
|
|
80
80
|
if (enabled.length > 0) {
|
|
81
|
-
placeholder.add(
|
|
82
|
-
enabled.find((radio) => radio.checked) ?? enabled[0]
|
|
83
|
-
);
|
|
81
|
+
placeholder.add(enabled.find((radio) => radio.checked) ?? enabled[0]);
|
|
84
82
|
}
|
|
85
83
|
}
|
|
86
84
|
}
|
|
@@ -190,9 +188,9 @@ function getRelativeFocusable(container, offset = 0, options) {
|
|
|
190
188
|
/**
|
|
191
189
|
* Power Focusable
|
|
192
190
|
* High-precision focus management utility with shadow DOM support.
|
|
193
|
-
* Handles complex focus rules.
|
|
191
|
+
* Handles complex focus rules including tabindex ordering, radio groups, etc.
|
|
194
192
|
*
|
|
195
|
-
* @version 2.0.
|
|
193
|
+
* @version 2.0.2
|
|
196
194
|
* @author Yusuke Kamiyamane
|
|
197
195
|
* @license MIT
|
|
198
196
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Power Focusable
|
|
3
3
|
* High-precision focus management utility with shadow DOM support.
|
|
4
|
-
* Handles complex focus rules.
|
|
4
|
+
* Handles complex focus rules including tabindex ordering, radio groups, etc.
|
|
5
5
|
*
|
|
6
|
-
* @version 2.0.
|
|
6
|
+
* @version 2.0.2
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Power Focusable
|
|
3
3
|
* High-precision focus management utility with shadow DOM support.
|
|
4
|
-
* Handles complex focus rules.
|
|
4
|
+
* Handles complex focus rules including tabindex ordering, radio groups, etc.
|
|
5
5
|
*
|
|
6
|
-
* @version 2.0.
|
|
6
|
+
* @version 2.0.2
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.js
CHANGED
|
@@ -72,13 +72,11 @@ function getFocusables(container = document.body, options = {}) {
|
|
|
72
72
|
return elements2;
|
|
73
73
|
}
|
|
74
74
|
const placeholder = /* @__PURE__ */ new Set();
|
|
75
|
-
for (const
|
|
76
|
-
if (
|
|
77
|
-
const enabled =
|
|
75
|
+
for (const radios of map.values()) {
|
|
76
|
+
if (radios.length > 0) {
|
|
77
|
+
const enabled = radios.filter((radio) => isFocusable(radio));
|
|
78
78
|
if (enabled.length > 0) {
|
|
79
|
-
placeholder.add(
|
|
80
|
-
enabled.find((radio) => radio.checked) ?? enabled[0]
|
|
81
|
-
);
|
|
79
|
+
placeholder.add(enabled.find((radio) => radio.checked) ?? enabled[0]);
|
|
82
80
|
}
|
|
83
81
|
}
|
|
84
82
|
}
|
|
@@ -188,9 +186,9 @@ function getRelativeFocusable(container, offset = 0, options) {
|
|
|
188
186
|
/**
|
|
189
187
|
* Power Focusable
|
|
190
188
|
* High-precision focus management utility with shadow DOM support.
|
|
191
|
-
* Handles complex focus rules.
|
|
189
|
+
* Handles complex focus rules including tabindex ordering, radio groups, etc.
|
|
192
190
|
*
|
|
193
|
-
* @version 2.0.
|
|
191
|
+
* @version 2.0.2
|
|
194
192
|
* @author Yusuke Kamiyamane
|
|
195
193
|
* @license MIT
|
|
196
194
|
* @copyright Copyright (c) Yusuke Kamiyamane
|