power-focusable 4.3.25 → 4.3.27
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/LICENSE +1 -1
- package/README.md +6 -6
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/package.json +30 -27
package/LICENSE
CHANGED
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.27';
|
|
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.27/+esm';
|
|
30
30
|
// or
|
|
31
|
-
import { ... } 'https://esm.unpkg.com/power-focusable@4.3.
|
|
31
|
+
import { ... } 'https://esm.unpkg.com/power-focusable@4.3.27';
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
## 🪄 Options
|
|
@@ -37,14 +37,14 @@ import { ... } 'https://esm.unpkg.com/power-focusable@4.3.25';
|
|
|
37
37
|
interface PowerFocusableOptions {
|
|
38
38
|
anchor: Element | null; // default: DocumentOrShadowRoot.activeElement
|
|
39
39
|
composed: boolean; // default: false
|
|
40
|
-
filter:
|
|
41
|
-
include:
|
|
40
|
+
filter: Predicate<Element>; // default: undefined
|
|
41
|
+
include: Predicate<Element>; // default: undefined
|
|
42
42
|
skipNegativeTabIndexCheck: boolean; // default: false
|
|
43
43
|
skipVisibilityCheck: boolean; // default: false
|
|
44
44
|
wrap: boolean; // default: false
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
type
|
|
47
|
+
type Predicate<T> = (element: T) => boolean;
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
### `anchor`
|
package/dist/index.cjs
CHANGED
|
@@ -261,11 +261,11 @@ function getRelativeFocusable(container, offset, options) {
|
|
|
261
261
|
}
|
|
262
262
|
const settings = {
|
|
263
263
|
composed,
|
|
264
|
-
filter,
|
|
265
|
-
include,
|
|
266
264
|
skipNegativeTabIndexCheck,
|
|
267
265
|
skipVisibilityCheck
|
|
268
266
|
};
|
|
267
|
+
filter && Object.assign(settings, { filter });
|
|
268
|
+
include && Object.assign(settings, { include });
|
|
269
269
|
const focusables = getFocusables(container, settings);
|
|
270
270
|
const { length } = focusables;
|
|
271
271
|
if (!length) {
|
|
@@ -494,7 +494,7 @@ function isUngroupedRadio(element) {
|
|
|
494
494
|
* High-precision focus management utility with full composed tree support.
|
|
495
495
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
496
496
|
*
|
|
497
|
-
* @version 4.3.
|
|
497
|
+
* @version 4.3.27
|
|
498
498
|
* @author Yusuke Kamiyamane
|
|
499
499
|
* @license MIT
|
|
500
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.27
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
interface PowerFocusableOptions {
|
|
13
13
|
anchor: Element | null;
|
|
14
14
|
composed: boolean;
|
|
15
|
-
filter:
|
|
16
|
-
include:
|
|
15
|
+
filter: Predicate<Element>;
|
|
16
|
+
include: Predicate<Element>;
|
|
17
17
|
skipNegativeTabIndexCheck: boolean;
|
|
18
18
|
skipVisibilityCheck: boolean;
|
|
19
19
|
wrap: boolean;
|
|
20
20
|
}
|
|
21
|
-
type
|
|
21
|
+
type Predicate<T> = (element: T) => boolean;
|
|
22
22
|
declare function createFocusTrap(container?: Element): () => void;
|
|
23
23
|
declare function getFocusables(container?: Element, options?: Partial<Omit<PowerFocusableOptions, 'anchor' | 'wrap'>>): Element[];
|
|
24
24
|
declare function getNextFocusable(container?: Element, options?: Partial<PowerFocusableOptions>): Element | null;
|
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.27
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
interface PowerFocusableOptions {
|
|
13
13
|
anchor: Element | null;
|
|
14
14
|
composed: boolean;
|
|
15
|
-
filter:
|
|
16
|
-
include:
|
|
15
|
+
filter: Predicate<Element>;
|
|
16
|
+
include: Predicate<Element>;
|
|
17
17
|
skipNegativeTabIndexCheck: boolean;
|
|
18
18
|
skipVisibilityCheck: boolean;
|
|
19
19
|
wrap: boolean;
|
|
20
20
|
}
|
|
21
|
-
type
|
|
21
|
+
type Predicate<T> = (element: T) => boolean;
|
|
22
22
|
declare function createFocusTrap(container?: Element): () => void;
|
|
23
23
|
declare function getFocusables(container?: Element, options?: Partial<Omit<PowerFocusableOptions, 'anchor' | 'wrap'>>): Element[];
|
|
24
24
|
declare function getNextFocusable(container?: Element, options?: Partial<PowerFocusableOptions>): Element | null;
|
package/dist/index.js
CHANGED
|
@@ -259,11 +259,11 @@ function getRelativeFocusable(container, offset, options) {
|
|
|
259
259
|
}
|
|
260
260
|
const settings = {
|
|
261
261
|
composed,
|
|
262
|
-
filter,
|
|
263
|
-
include,
|
|
264
262
|
skipNegativeTabIndexCheck,
|
|
265
263
|
skipVisibilityCheck
|
|
266
264
|
};
|
|
265
|
+
filter && Object.assign(settings, { filter });
|
|
266
|
+
include && Object.assign(settings, { include });
|
|
267
267
|
const focusables = getFocusables(container, settings);
|
|
268
268
|
const { length } = focusables;
|
|
269
269
|
if (!length) {
|
|
@@ -492,7 +492,7 @@ function isUngroupedRadio(element) {
|
|
|
492
492
|
* High-precision focus management utility with full composed tree support.
|
|
493
493
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
494
494
|
*
|
|
495
|
-
* @version 4.3.
|
|
495
|
+
* @version 4.3.27
|
|
496
496
|
* @author Yusuke Kamiyamane
|
|
497
497
|
* @license MIT
|
|
498
498
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/package.json
CHANGED
|
@@ -1,28 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "power-focusable",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.27",
|
|
4
4
|
"description": "High-precision focus management utility with full composed tree support",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/index.cjs",
|
|
7
|
-
"module": "./dist/index.js",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"import": "./dist/index.js",
|
|
13
|
-
"require": "./dist/index.cjs"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"files": [
|
|
17
|
-
"dist",
|
|
18
|
-
"LICENSE",
|
|
19
|
-
"README.md"
|
|
20
|
-
],
|
|
21
|
-
"scripts": {
|
|
22
|
-
"build": "tsup",
|
|
23
|
-
"prepublishOnly": "npm run build",
|
|
24
|
-
"lint": "tsc --noEmit"
|
|
25
|
-
},
|
|
26
5
|
"keywords": [
|
|
27
6
|
"a11y",
|
|
28
7
|
"accessibility",
|
|
@@ -34,16 +13,37 @@
|
|
|
34
13
|
"typescript",
|
|
35
14
|
"utility"
|
|
36
15
|
],
|
|
37
|
-
"
|
|
38
|
-
"
|
|
16
|
+
"homepage": "https://github.com/y14e/power-focusable#readme",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/y14e/power-focusable/issues"
|
|
19
|
+
},
|
|
39
20
|
"repository": {
|
|
40
21
|
"type": "git",
|
|
41
22
|
"url": "git+https://github.com/y14e/power-focusable.git"
|
|
42
23
|
},
|
|
43
|
-
"
|
|
44
|
-
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"author": "Yusuke Kamiyamane",
|
|
26
|
+
"type": "module",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/index.js",
|
|
31
|
+
"require": "./dist/index.cjs"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"main": "./dist/index.cjs",
|
|
35
|
+
"module": "./dist/index.js",
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"files": [
|
|
38
|
+
"dist",
|
|
39
|
+
"LICENSE",
|
|
40
|
+
"README.md"
|
|
41
|
+
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsup",
|
|
44
|
+
"lint": "tsc --noEmit",
|
|
45
|
+
"prepublishOnly": "npm run build"
|
|
45
46
|
},
|
|
46
|
-
"homepage": "https://github.com/y14e/power-focusable#readme",
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"bun-types": "latest",
|
|
49
49
|
"happy-dom": "^20.9.0",
|
|
@@ -53,5 +53,8 @@
|
|
|
53
53
|
},
|
|
54
54
|
"engines": {
|
|
55
55
|
"node": ">=18"
|
|
56
|
+
},
|
|
57
|
+
"allowScripts": {
|
|
58
|
+
"esbuild": true
|
|
56
59
|
}
|
|
57
60
|
}
|