power-focusable 4.3.3 → 4.3.5
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 +9 -9
- package/dist/index.cjs +3 -2
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,27 +21,27 @@ import {
|
|
|
21
21
|
hasFocusable,
|
|
22
22
|
inertOutside,
|
|
23
23
|
isFocusable,
|
|
24
|
-
} from 'power-focusable@4.3.
|
|
24
|
+
} from 'power-focusable@4.3.5';
|
|
25
25
|
|
|
26
26
|
// CDNs
|
|
27
|
-
import { ... } 'https://esm.sh/power-focusable@4.3.
|
|
27
|
+
import { ... } 'https://esm.sh/power-focusable@4.3.5';
|
|
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.5/+esm';
|
|
30
30
|
// or
|
|
31
|
-
import { ... } 'https://esm.unpkg.com/power-focusable@4.3.
|
|
31
|
+
import { ... } 'https://esm.unpkg.com/power-focusable@4.3.5';
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
## 🪄 Options
|
|
35
35
|
|
|
36
36
|
```ts
|
|
37
37
|
interface PowerFocusableOptions {
|
|
38
|
-
anchor?: Element | null;
|
|
39
|
-
composed?: boolean;
|
|
38
|
+
anchor?: Element | null; // default: active element
|
|
39
|
+
composed?: boolean; // default: false
|
|
40
40
|
filter?: (element: Element) => boolean;
|
|
41
41
|
include?: (element: Element) => boolean;
|
|
42
|
-
skipNegativeTabIndexCheck?: boolean;
|
|
43
|
-
skipVisibilityCheck?: boolean;
|
|
44
|
-
wrap?: boolean;
|
|
42
|
+
skipNegativeTabIndexCheck?: boolean; // default: false
|
|
43
|
+
skipVisibilityCheck?: boolean; // default: false
|
|
44
|
+
wrap?: boolean; // default: false
|
|
45
45
|
}
|
|
46
46
|
```
|
|
47
47
|
|
package/dist/index.cjs
CHANGED
|
@@ -30,7 +30,6 @@ function createFocusTrap(container = document.body) {
|
|
|
30
30
|
}
|
|
31
31
|
let controller = new AbortController();
|
|
32
32
|
document.addEventListener("keydown", onKeyDown, {
|
|
33
|
-
capture: true,
|
|
34
33
|
signal: controller.signal
|
|
35
34
|
});
|
|
36
35
|
return () => {
|
|
@@ -458,7 +457,7 @@ function isUngroupedRadio(element) {
|
|
|
458
457
|
* High-precision focus management utility with full composed tree support.
|
|
459
458
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
460
459
|
*
|
|
461
|
-
* @version 4.3.
|
|
460
|
+
* @version 4.3.5
|
|
462
461
|
* @author Yusuke Kamiyamane
|
|
463
462
|
* @license MIT
|
|
464
463
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -466,6 +465,8 @@ function isUngroupedRadio(element) {
|
|
|
466
465
|
*/
|
|
467
466
|
|
|
468
467
|
exports.createFocusTrap = createFocusTrap;
|
|
468
|
+
exports.focusElement = focusElement;
|
|
469
|
+
exports.getActiveElement = getActiveElement;
|
|
469
470
|
exports.getFocusables = getFocusables;
|
|
470
471
|
exports.getNextFocusable = getNextFocusable;
|
|
471
472
|
exports.getPreviousFocusable = getPreviousFocusable;
|
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.5
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -28,5 +28,7 @@ declare function isFocusable(element: Element, options?: {
|
|
|
28
28
|
skipNegativeTabIndexCheck?: boolean;
|
|
29
29
|
skipVisibilityCheck?: boolean;
|
|
30
30
|
}): boolean;
|
|
31
|
+
declare function focusElement(element: Element): void;
|
|
32
|
+
declare function getActiveElement(): Element | null;
|
|
31
33
|
|
|
32
|
-
export { type PowerFocusableOptions, createFocusTrap, getFocusables, getNextFocusable, getPreviousFocusable, hasFocusable, inertOutside, isFocusable };
|
|
34
|
+
export { type PowerFocusableOptions, createFocusTrap, focusElement, getActiveElement, getFocusables, getNextFocusable, getPreviousFocusable, hasFocusable, inertOutside, isFocusable };
|
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.5
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -28,5 +28,7 @@ declare function isFocusable(element: Element, options?: {
|
|
|
28
28
|
skipNegativeTabIndexCheck?: boolean;
|
|
29
29
|
skipVisibilityCheck?: boolean;
|
|
30
30
|
}): boolean;
|
|
31
|
+
declare function focusElement(element: Element): void;
|
|
32
|
+
declare function getActiveElement(): Element | null;
|
|
31
33
|
|
|
32
|
-
export { type PowerFocusableOptions, createFocusTrap, getFocusables, getNextFocusable, getPreviousFocusable, hasFocusable, inertOutside, isFocusable };
|
|
34
|
+
export { type PowerFocusableOptions, createFocusTrap, focusElement, getActiveElement, getFocusables, getNextFocusable, getPreviousFocusable, hasFocusable, inertOutside, isFocusable };
|
package/dist/index.js
CHANGED
|
@@ -28,7 +28,6 @@ function createFocusTrap(container = document.body) {
|
|
|
28
28
|
}
|
|
29
29
|
let controller = new AbortController();
|
|
30
30
|
document.addEventListener("keydown", onKeyDown, {
|
|
31
|
-
capture: true,
|
|
32
31
|
signal: controller.signal
|
|
33
32
|
});
|
|
34
33
|
return () => {
|
|
@@ -456,11 +455,11 @@ function isUngroupedRadio(element) {
|
|
|
456
455
|
* High-precision focus management utility with full composed tree support.
|
|
457
456
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
458
457
|
*
|
|
459
|
-
* @version 4.3.
|
|
458
|
+
* @version 4.3.5
|
|
460
459
|
* @author Yusuke Kamiyamane
|
|
461
460
|
* @license MIT
|
|
462
461
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
463
462
|
* @see {@link https://github.com/y14e/power-focusable}
|
|
464
463
|
*/
|
|
465
464
|
|
|
466
|
-
export { createFocusTrap, getFocusables, getNextFocusable, getPreviousFocusable, hasFocusable, inertOutside, isFocusable };
|
|
465
|
+
export { createFocusTrap, focusElement, getActiveElement, getFocusables, getNextFocusable, getPreviousFocusable, hasFocusable, inertOutside, isFocusable };
|