power-focusable 2.1.8 → 2.1.9
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 +4 -10
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -10
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -24,20 +24,14 @@ function getFocusables(container = document.body, options = {}) {
|
|
|
24
24
|
const assigneds = node.assignedElements({ flatten: true });
|
|
25
25
|
if (assigneds.length) {
|
|
26
26
|
for (let i = 0, l = assigneds.length; i < l; i++) {
|
|
27
|
-
|
|
28
|
-
if (assigned) {
|
|
29
|
-
traverse2(assigned);
|
|
30
|
-
}
|
|
27
|
+
traverse2(assigneds[i]);
|
|
31
28
|
}
|
|
32
29
|
return;
|
|
33
30
|
}
|
|
34
31
|
}
|
|
35
32
|
const children = node.childNodes;
|
|
36
33
|
for (let i = 0, l = children.length; i < l; i++) {
|
|
37
|
-
|
|
38
|
-
if (child) {
|
|
39
|
-
traverse2(child);
|
|
40
|
-
}
|
|
34
|
+
traverse2(children[i]);
|
|
41
35
|
}
|
|
42
36
|
};
|
|
43
37
|
traverse2(container);
|
|
@@ -45,7 +39,7 @@ function getFocusables(container = document.body, options = {}) {
|
|
|
45
39
|
const candidates = container.querySelectorAll(FOCUSABLE_SELECTOR);
|
|
46
40
|
for (let i = 0, l = candidates.length; i < l; i++) {
|
|
47
41
|
const candidate = candidates[i];
|
|
48
|
-
if (
|
|
42
|
+
if (isFocusable(candidate)) {
|
|
49
43
|
elements[elements.length] = candidate;
|
|
50
44
|
}
|
|
51
45
|
}
|
|
@@ -244,7 +238,7 @@ function sortByTabIndex(elements) {
|
|
|
244
238
|
* High-precision focus management utility with shadow DOM support.
|
|
245
239
|
* Handles complex focus rules including tabindex ordering, radio groups, etc.
|
|
246
240
|
*
|
|
247
|
-
* @version 2.1.
|
|
241
|
+
* @version 2.1.9
|
|
248
242
|
* @author Yusuke Kamiyamane
|
|
249
243
|
* @license MIT
|
|
250
244
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* High-precision focus management utility with shadow DOM support.
|
|
4
4
|
* Handles complex focus rules including tabindex ordering, radio groups, etc.
|
|
5
5
|
*
|
|
6
|
-
* @version 2.1.
|
|
6
|
+
* @version 2.1.9
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* High-precision focus management utility with shadow DOM support.
|
|
4
4
|
* Handles complex focus rules including tabindex ordering, radio groups, etc.
|
|
5
5
|
*
|
|
6
|
-
* @version 2.1.
|
|
6
|
+
* @version 2.1.9
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.js
CHANGED
|
@@ -22,20 +22,14 @@ function getFocusables(container = document.body, options = {}) {
|
|
|
22
22
|
const assigneds = node.assignedElements({ flatten: true });
|
|
23
23
|
if (assigneds.length) {
|
|
24
24
|
for (let i = 0, l = assigneds.length; i < l; i++) {
|
|
25
|
-
|
|
26
|
-
if (assigned) {
|
|
27
|
-
traverse2(assigned);
|
|
28
|
-
}
|
|
25
|
+
traverse2(assigneds[i]);
|
|
29
26
|
}
|
|
30
27
|
return;
|
|
31
28
|
}
|
|
32
29
|
}
|
|
33
30
|
const children = node.childNodes;
|
|
34
31
|
for (let i = 0, l = children.length; i < l; i++) {
|
|
35
|
-
|
|
36
|
-
if (child) {
|
|
37
|
-
traverse2(child);
|
|
38
|
-
}
|
|
32
|
+
traverse2(children[i]);
|
|
39
33
|
}
|
|
40
34
|
};
|
|
41
35
|
traverse2(container);
|
|
@@ -43,7 +37,7 @@ function getFocusables(container = document.body, options = {}) {
|
|
|
43
37
|
const candidates = container.querySelectorAll(FOCUSABLE_SELECTOR);
|
|
44
38
|
for (let i = 0, l = candidates.length; i < l; i++) {
|
|
45
39
|
const candidate = candidates[i];
|
|
46
|
-
if (
|
|
40
|
+
if (isFocusable(candidate)) {
|
|
47
41
|
elements[elements.length] = candidate;
|
|
48
42
|
}
|
|
49
43
|
}
|
|
@@ -242,7 +236,7 @@ function sortByTabIndex(elements) {
|
|
|
242
236
|
* High-precision focus management utility with shadow DOM support.
|
|
243
237
|
* Handles complex focus rules including tabindex ordering, radio groups, etc.
|
|
244
238
|
*
|
|
245
|
-
* @version 2.1.
|
|
239
|
+
* @version 2.1.9
|
|
246
240
|
* @author Yusuke Kamiyamane
|
|
247
241
|
* @license MIT
|
|
248
242
|
* @copyright Copyright (c) Yusuke Kamiyamane
|