power-focusable 4.3.18 → 4.3.20
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 +3 -3
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,11 +24,11 @@ import {
|
|
|
24
24
|
} from 'power-focusable';
|
|
25
25
|
|
|
26
26
|
// CDNs
|
|
27
|
-
import { ... } 'https://esm.sh/power-focusable@4.3.
|
|
27
|
+
import { ... } 'https://esm.sh/power-focusable@4.3.20';
|
|
28
28
|
// or
|
|
29
|
-
import { ... } 'https://cdn.jsdelivr.net/npm/power-focusable@4.3.
|
|
29
|
+
import { ... } 'https://cdn.jsdelivr.net/npm/power-focusable@4.3.20/+esm';
|
|
30
30
|
// or
|
|
31
|
-
import { ... } 'https://esm.unpkg.com/power-focusable@4.3.
|
|
31
|
+
import { ... } 'https://esm.unpkg.com/power-focusable@4.3.20';
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
## 🪄 Options
|
package/dist/index.cjs
CHANGED
|
@@ -265,20 +265,20 @@ function getRelativeFocusable(container, offset, options) {
|
|
|
265
265
|
skipNegativeTabIndexCheck,
|
|
266
266
|
skipVisibilityCheck
|
|
267
267
|
};
|
|
268
|
-
const
|
|
269
|
-
const { length } =
|
|
268
|
+
const focusables = getFocusables(container, settings);
|
|
269
|
+
const { length } = focusables;
|
|
270
270
|
if (!length) {
|
|
271
271
|
return null;
|
|
272
272
|
}
|
|
273
|
-
const
|
|
274
|
-
if (
|
|
273
|
+
const currentIndex = focusables.indexOf(anchor);
|
|
274
|
+
if (currentIndex === -1) {
|
|
275
275
|
return null;
|
|
276
276
|
}
|
|
277
|
-
const offsetIndex =
|
|
277
|
+
const offsetIndex = currentIndex + offset;
|
|
278
278
|
if ((offsetIndex < 0 || offsetIndex >= length) && !wrap) {
|
|
279
279
|
return null;
|
|
280
280
|
}
|
|
281
|
-
return
|
|
281
|
+
return focusables[(offsetIndex + length) % length] ?? null;
|
|
282
282
|
}
|
|
283
283
|
function isDisabledDeep(element) {
|
|
284
284
|
let current = element;
|
|
@@ -493,7 +493,7 @@ function isUngroupedRadio(element) {
|
|
|
493
493
|
* High-precision focus management utility with full composed tree support.
|
|
494
494
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
495
495
|
*
|
|
496
|
-
* @version 4.3.
|
|
496
|
+
* @version 4.3.20
|
|
497
497
|
* @author Yusuke Kamiyamane
|
|
498
498
|
* @license MIT
|
|
499
499
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* High-precision focus management utility with full composed tree support.
|
|
4
4
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
5
5
|
*
|
|
6
|
-
* @version 4.3.
|
|
6
|
+
* @version 4.3.20
|
|
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 full composed tree support.
|
|
4
4
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
5
5
|
*
|
|
6
|
-
* @version 4.3.
|
|
6
|
+
* @version 4.3.20
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.js
CHANGED
|
@@ -263,20 +263,20 @@ function getRelativeFocusable(container, offset, options) {
|
|
|
263
263
|
skipNegativeTabIndexCheck,
|
|
264
264
|
skipVisibilityCheck
|
|
265
265
|
};
|
|
266
|
-
const
|
|
267
|
-
const { length } =
|
|
266
|
+
const focusables = getFocusables(container, settings);
|
|
267
|
+
const { length } = focusables;
|
|
268
268
|
if (!length) {
|
|
269
269
|
return null;
|
|
270
270
|
}
|
|
271
|
-
const
|
|
272
|
-
if (
|
|
271
|
+
const currentIndex = focusables.indexOf(anchor);
|
|
272
|
+
if (currentIndex === -1) {
|
|
273
273
|
return null;
|
|
274
274
|
}
|
|
275
|
-
const offsetIndex =
|
|
275
|
+
const offsetIndex = currentIndex + offset;
|
|
276
276
|
if ((offsetIndex < 0 || offsetIndex >= length) && !wrap) {
|
|
277
277
|
return null;
|
|
278
278
|
}
|
|
279
|
-
return
|
|
279
|
+
return focusables[(offsetIndex + length) % length] ?? null;
|
|
280
280
|
}
|
|
281
281
|
function isDisabledDeep(element) {
|
|
282
282
|
let current = element;
|
|
@@ -491,7 +491,7 @@ function isUngroupedRadio(element) {
|
|
|
491
491
|
* High-precision focus management utility with full composed tree support.
|
|
492
492
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
493
493
|
*
|
|
494
|
-
* @version 4.3.
|
|
494
|
+
* @version 4.3.20
|
|
495
495
|
* @author Yusuke Kamiyamane
|
|
496
496
|
* @license MIT
|
|
497
497
|
* @copyright Copyright (c) Yusuke Kamiyamane
|