power-focusable 4.3.22 → 4.3.23
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 -4
- package/dist/index.cjs +3 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -4
- 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.23';
|
|
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.23/+esm';
|
|
30
30
|
// or
|
|
31
|
-
import { ... } 'https://esm.unpkg.com/power-focusable@4.3.
|
|
31
|
+
import { ... } 'https://esm.unpkg.com/power-focusable@4.3.23';
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
## 🪄 Options
|
|
@@ -103,7 +103,7 @@ Creates a keyboard focus trap within the container. Automatically focuses the co
|
|
|
103
103
|
const cleanup = createFocusTrap(container);
|
|
104
104
|
// => () => void
|
|
105
105
|
//
|
|
106
|
-
// container: Element
|
|
106
|
+
// container (optional): Element (default: <body>)
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
### `getFocusables`
|
package/dist/index.cjs
CHANGED
|
@@ -8,9 +8,8 @@ var FOCUSABLE_SELECTOR_WITH_NEGATIVE_TABINDEX = FOCUSABLE_SELECTOR.replace(
|
|
|
8
8
|
);
|
|
9
9
|
function createFocusTrap(container = document.body) {
|
|
10
10
|
if (!(container instanceof Element)) {
|
|
11
|
-
console.warn("Invalid container element");
|
|
12
|
-
|
|
13
|
-
};
|
|
11
|
+
console.warn("Invalid container element. Fallback: <body> element.");
|
|
12
|
+
container = document.body;
|
|
14
13
|
}
|
|
15
14
|
const trap = new FocusTrap(container);
|
|
16
15
|
return () => trap.destroy();
|
|
@@ -495,7 +494,7 @@ function isUngroupedRadio(element) {
|
|
|
495
494
|
* High-precision focus management utility with full composed tree support.
|
|
496
495
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
497
496
|
*
|
|
498
|
-
* @version 4.3.
|
|
497
|
+
* @version 4.3.23
|
|
499
498
|
* @author Yusuke Kamiyamane
|
|
500
499
|
* @license MIT
|
|
501
500
|
* @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.23
|
|
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.23
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.js
CHANGED
|
@@ -6,9 +6,8 @@ var FOCUSABLE_SELECTOR_WITH_NEGATIVE_TABINDEX = FOCUSABLE_SELECTOR.replace(
|
|
|
6
6
|
);
|
|
7
7
|
function createFocusTrap(container = document.body) {
|
|
8
8
|
if (!(container instanceof Element)) {
|
|
9
|
-
console.warn("Invalid container element");
|
|
10
|
-
|
|
11
|
-
};
|
|
9
|
+
console.warn("Invalid container element. Fallback: <body> element.");
|
|
10
|
+
container = document.body;
|
|
12
11
|
}
|
|
13
12
|
const trap = new FocusTrap(container);
|
|
14
13
|
return () => trap.destroy();
|
|
@@ -493,7 +492,7 @@ function isUngroupedRadio(element) {
|
|
|
493
492
|
* High-precision focus management utility with full composed tree support.
|
|
494
493
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
495
494
|
*
|
|
496
|
-
* @version 4.3.
|
|
495
|
+
* @version 4.3.23
|
|
497
496
|
* @author Yusuke Kamiyamane
|
|
498
497
|
* @license MIT
|
|
499
498
|
* @copyright Copyright (c) Yusuke Kamiyamane
|