@y14e/roving-tabindex 3.0.6 → 3.0.8
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 +17 -11
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +12 -12
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -10,14 +10,14 @@ npm i @y14e/roving-tabindex
|
|
|
10
10
|
|
|
11
11
|
```ts
|
|
12
12
|
// npm
|
|
13
|
-
import { createRovingTabIndex } from '@y14e/roving-tabindex@3.0.
|
|
13
|
+
import { createRovingTabIndex } from '@y14e/roving-tabindex@3.0.8';
|
|
14
14
|
|
|
15
15
|
// CDNs
|
|
16
|
-
import { createRovingTabIndex } from 'https://esm.sh/@y14e/roving-tabindex@3.0.
|
|
16
|
+
import { createRovingTabIndex } from 'https://esm.sh/@y14e/roving-tabindex@3.0.8';
|
|
17
17
|
// or
|
|
18
|
-
import { createRovingTabIndex } from 'https://cdn.jsdelivr.net/npm/@y14e/roving-tabindex@3.0.
|
|
18
|
+
import { createRovingTabIndex } from 'https://cdn.jsdelivr.net/npm/@y14e/roving-tabindex@3.0.8/+esm';
|
|
19
19
|
// or
|
|
20
|
-
import { createRovingTabIndex } from 'https://esm.unpkg.com/@y14e/roving-tabindex@3.0.
|
|
20
|
+
import { createRovingTabIndex } from 'https://esm.unpkg.com/@y14e/roving-tabindex@3.0.8';
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## 📦 APIs
|
package/dist/index.cjs
CHANGED
|
@@ -253,6 +253,16 @@ function getComposedChildren(node) {
|
|
|
253
253
|
}
|
|
254
254
|
return getChildren(node);
|
|
255
255
|
}
|
|
256
|
+
function focusElement(element) {
|
|
257
|
+
"focus" in element && typeof element.focus === "function" && element.focus();
|
|
258
|
+
}
|
|
259
|
+
function getActiveElement() {
|
|
260
|
+
let current = document.activeElement;
|
|
261
|
+
while (current?.shadowRoot?.activeElement) {
|
|
262
|
+
current = current.shadowRoot.activeElement;
|
|
263
|
+
}
|
|
264
|
+
return current;
|
|
265
|
+
}
|
|
256
266
|
function getChildren(node) {
|
|
257
267
|
const elements = [];
|
|
258
268
|
for (let child = node.firstElementChild; child; child = child.nextElementSibling) {
|
|
@@ -513,22 +523,12 @@ var RovingTabIndex = class {
|
|
|
513
523
|
});
|
|
514
524
|
}
|
|
515
525
|
};
|
|
516
|
-
function focusElement(element) {
|
|
517
|
-
"focus" in element && typeof element.focus === "function" && element.focus();
|
|
518
|
-
}
|
|
519
|
-
function getActiveElement() {
|
|
520
|
-
let current = document.activeElement;
|
|
521
|
-
while (current?.shadowRoot?.activeElement) {
|
|
522
|
-
current = current.shadowRoot.activeElement;
|
|
523
|
-
}
|
|
524
|
-
return current;
|
|
525
|
-
}
|
|
526
526
|
/**
|
|
527
527
|
* Roving Tabindex
|
|
528
528
|
* Lightweight roving tabindex utility with fully focus management.
|
|
529
529
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
530
530
|
*
|
|
531
|
-
* @version 3.0.
|
|
531
|
+
* @version 3.0.8
|
|
532
532
|
* @author Yusuke Kamiyamane
|
|
533
533
|
* @license MIT
|
|
534
534
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -561,4 +561,10 @@ power-focusable/dist/index.js:
|
|
|
561
561
|
*)
|
|
562
562
|
*/
|
|
563
563
|
|
|
564
|
+
exports.addTokenToAttribute = addTokenToAttribute;
|
|
564
565
|
exports.createRovingTabIndex = createRovingTabIndex;
|
|
566
|
+
exports.focusElement = focusElement;
|
|
567
|
+
exports.getActiveElement = getActiveElement;
|
|
568
|
+
exports.getFocusables = getFocusables;
|
|
569
|
+
exports.restoreAttributes = restoreAttributes;
|
|
570
|
+
exports.saveAttributes = saveAttributes;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
+
export { addTokenToAttribute, restoreAttributes, saveAttributes } from '@y14e/attributes-utils';
|
|
2
|
+
export { focusElement, getActiveElement, getFocusables } from 'power-focusable';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Roving Tabindex
|
|
3
6
|
* Lightweight roving tabindex utility with fully focus management.
|
|
4
7
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
5
8
|
*
|
|
6
|
-
* @version 3.0.
|
|
9
|
+
* @version 3.0.8
|
|
7
10
|
* @author Yusuke Kamiyamane
|
|
8
11
|
* @license MIT
|
|
9
12
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
10
13
|
* @see {@link https://github.com/y14e/roving-tabindex}
|
|
11
14
|
*/
|
|
15
|
+
|
|
12
16
|
interface RovingTabIndexOptions {
|
|
13
17
|
readonly direction?: 'horizontal' | 'vertical';
|
|
14
18
|
readonly navigationOnly?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
|
+
export { addTokenToAttribute, restoreAttributes, saveAttributes } from '@y14e/attributes-utils';
|
|
2
|
+
export { focusElement, getActiveElement, getFocusables } from 'power-focusable';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Roving Tabindex
|
|
3
6
|
* Lightweight roving tabindex utility with fully focus management.
|
|
4
7
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
5
8
|
*
|
|
6
|
-
* @version 3.0.
|
|
9
|
+
* @version 3.0.8
|
|
7
10
|
* @author Yusuke Kamiyamane
|
|
8
11
|
* @license MIT
|
|
9
12
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
10
13
|
* @see {@link https://github.com/y14e/roving-tabindex}
|
|
11
14
|
*/
|
|
15
|
+
|
|
12
16
|
interface RovingTabIndexOptions {
|
|
13
17
|
readonly direction?: 'horizontal' | 'vertical';
|
|
14
18
|
readonly navigationOnly?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -251,6 +251,16 @@ function getComposedChildren(node) {
|
|
|
251
251
|
}
|
|
252
252
|
return getChildren(node);
|
|
253
253
|
}
|
|
254
|
+
function focusElement(element) {
|
|
255
|
+
"focus" in element && typeof element.focus === "function" && element.focus();
|
|
256
|
+
}
|
|
257
|
+
function getActiveElement() {
|
|
258
|
+
let current = document.activeElement;
|
|
259
|
+
while (current?.shadowRoot?.activeElement) {
|
|
260
|
+
current = current.shadowRoot.activeElement;
|
|
261
|
+
}
|
|
262
|
+
return current;
|
|
263
|
+
}
|
|
254
264
|
function getChildren(node) {
|
|
255
265
|
const elements = [];
|
|
256
266
|
for (let child = node.firstElementChild; child; child = child.nextElementSibling) {
|
|
@@ -511,22 +521,12 @@ var RovingTabIndex = class {
|
|
|
511
521
|
});
|
|
512
522
|
}
|
|
513
523
|
};
|
|
514
|
-
function focusElement(element) {
|
|
515
|
-
"focus" in element && typeof element.focus === "function" && element.focus();
|
|
516
|
-
}
|
|
517
|
-
function getActiveElement() {
|
|
518
|
-
let current = document.activeElement;
|
|
519
|
-
while (current?.shadowRoot?.activeElement) {
|
|
520
|
-
current = current.shadowRoot.activeElement;
|
|
521
|
-
}
|
|
522
|
-
return current;
|
|
523
|
-
}
|
|
524
524
|
/**
|
|
525
525
|
* Roving Tabindex
|
|
526
526
|
* Lightweight roving tabindex utility with fully focus management.
|
|
527
527
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
528
528
|
*
|
|
529
|
-
* @version 3.0.
|
|
529
|
+
* @version 3.0.8
|
|
530
530
|
* @author Yusuke Kamiyamane
|
|
531
531
|
* @license MIT
|
|
532
532
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -559,4 +559,4 @@ power-focusable/dist/index.js:
|
|
|
559
559
|
*)
|
|
560
560
|
*/
|
|
561
561
|
|
|
562
|
-
export { createRovingTabIndex };
|
|
562
|
+
export { addTokenToAttribute, createRovingTabIndex, focusElement, getActiveElement, getFocusables, restoreAttributes, saveAttributes };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@y14e/roving-tabindex",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.8",
|
|
4
4
|
"description": "Lightweight roving tabindex utility with fully focus management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@y14e/attributes-utils": "^1.1.2",
|
|
52
52
|
"bun-types": "latest",
|
|
53
|
-
"power-focusable": "^4.3.
|
|
53
|
+
"power-focusable": "^4.3.4",
|
|
54
54
|
"tsup": "^8.0.0",
|
|
55
55
|
"typescript": "^5.6.0"
|
|
56
56
|
},
|