@y14e/roving-tabindex 3.1.22 → 3.1.24
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 +11 -11
- package/dist/index.bundle.cjs +7 -7
- package/dist/index.bundle.js +7 -7
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -7
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -13,11 +13,11 @@ npm i @y14e/roving-tabindex
|
|
|
13
13
|
import { createRovingTabIndex } from '@y14e/roving-tabindex';
|
|
14
14
|
|
|
15
15
|
// CDNs
|
|
16
|
-
import { createRovingTabIndex } from 'https://esm.sh/@y14e/roving-tabindex@3.1.
|
|
16
|
+
import { createRovingTabIndex } from 'https://esm.sh/@y14e/roving-tabindex@3.1.24';
|
|
17
17
|
// or
|
|
18
|
-
import { createRovingTabIndex } from 'https://cdn.jsdelivr.net/npm/@y14e/roving-tabindex@3.1.
|
|
18
|
+
import { createRovingTabIndex } from 'https://cdn.jsdelivr.net/npm/@y14e/roving-tabindex@3.1.24/+esm';
|
|
19
19
|
// or
|
|
20
|
-
import { createRovingTabIndex } from 'https://esm.unpkg.com/@y14e/roving-tabindex@3.1.
|
|
20
|
+
import { createRovingTabIndex } from 'https://esm.unpkg.com/@y14e/roving-tabindex@3.1.24';
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## 📦 APIs
|
|
@@ -38,16 +38,16 @@ const cleanup = createRovingTabIndex(container, options);
|
|
|
38
38
|
|
|
39
39
|
```ts
|
|
40
40
|
interface RovingTabIndexOptions {
|
|
41
|
-
direction:
|
|
42
|
-
navigationOnly: boolean;
|
|
43
|
-
noMemory: boolean;
|
|
44
|
-
noStart: boolean;
|
|
45
|
-
selector: string;
|
|
46
|
-
typeahead: boolean;
|
|
47
|
-
wrap: boolean;
|
|
41
|
+
direction: Direction; // default: 'both'
|
|
42
|
+
navigationOnly: boolean; // default: false
|
|
43
|
+
noMemory: boolean; // default: false
|
|
44
|
+
noStart: boolean; // default: false
|
|
45
|
+
selector: string; // default: ''
|
|
46
|
+
typeahead: boolean; // default: false
|
|
47
|
+
wrap: boolean; // default: false
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
type
|
|
50
|
+
type Direction = 'both' | 'horizontal' | 'vertical';
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
### `navigationOnly`
|
package/dist/index.bundle.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
// node_modules/@y14e/attribute-
|
|
3
|
+
// node_modules/@y14e/attribute-utils/dist/index.js
|
|
4
4
|
var DEFAULT_PARSER = (value) => value.split(/\s+/);
|
|
5
5
|
var DEFAULT_SERIALIZER = (tokens) => tokens.join(" ");
|
|
6
6
|
function addAttributeToken(element, name, token, options = {}) {
|
|
@@ -591,7 +591,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
591
591
|
* Lightweight roving tabindex utility with fully focus management.
|
|
592
592
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
593
593
|
*
|
|
594
|
-
* @version 3.1.
|
|
594
|
+
* @version 3.1.24
|
|
595
595
|
* @author Yusuke Kamiyamane
|
|
596
596
|
* @license MIT
|
|
597
597
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -599,15 +599,15 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
599
599
|
*/
|
|
600
600
|
/*! Bundled license information:
|
|
601
601
|
|
|
602
|
-
@y14e/attribute-
|
|
602
|
+
@y14e/attribute-utils/dist/index.js:
|
|
603
603
|
(**
|
|
604
|
-
* Attribute
|
|
604
|
+
* Attribute Utils
|
|
605
605
|
*
|
|
606
|
-
* @version 2.0.
|
|
606
|
+
* @version 2.0.5
|
|
607
607
|
* @author Yusuke Kamiyamane
|
|
608
608
|
* @license MIT
|
|
609
609
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
610
|
-
* @see {@link https://github.com/y14e/attribute-
|
|
610
|
+
* @see {@link https://github.com/y14e/attribute-utils}
|
|
611
611
|
*)
|
|
612
612
|
|
|
613
613
|
power-focusable/dist/index.js:
|
|
@@ -616,7 +616,7 @@ power-focusable/dist/index.js:
|
|
|
616
616
|
* High-precision focus management utility with full composed tree support.
|
|
617
617
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
618
618
|
*
|
|
619
|
-
* @version 4.3.
|
|
619
|
+
* @version 4.3.26
|
|
620
620
|
* @author Yusuke Kamiyamane
|
|
621
621
|
* @license MIT
|
|
622
622
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// node_modules/@y14e/attribute-
|
|
1
|
+
// node_modules/@y14e/attribute-utils/dist/index.js
|
|
2
2
|
var DEFAULT_PARSER = (value) => value.split(/\s+/);
|
|
3
3
|
var DEFAULT_SERIALIZER = (tokens) => tokens.join(" ");
|
|
4
4
|
function addAttributeToken(element, name, token, options = {}) {
|
|
@@ -589,7 +589,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
589
589
|
* Lightweight roving tabindex utility with fully focus management.
|
|
590
590
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
591
591
|
*
|
|
592
|
-
* @version 3.1.
|
|
592
|
+
* @version 3.1.24
|
|
593
593
|
* @author Yusuke Kamiyamane
|
|
594
594
|
* @license MIT
|
|
595
595
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -597,15 +597,15 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
597
597
|
*/
|
|
598
598
|
/*! Bundled license information:
|
|
599
599
|
|
|
600
|
-
@y14e/attribute-
|
|
600
|
+
@y14e/attribute-utils/dist/index.js:
|
|
601
601
|
(**
|
|
602
|
-
* Attribute
|
|
602
|
+
* Attribute Utils
|
|
603
603
|
*
|
|
604
|
-
* @version 2.0.
|
|
604
|
+
* @version 2.0.5
|
|
605
605
|
* @author Yusuke Kamiyamane
|
|
606
606
|
* @license MIT
|
|
607
607
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
608
|
-
* @see {@link https://github.com/y14e/attribute-
|
|
608
|
+
* @see {@link https://github.com/y14e/attribute-utils}
|
|
609
609
|
*)
|
|
610
610
|
|
|
611
611
|
power-focusable/dist/index.js:
|
|
@@ -614,7 +614,7 @@ power-focusable/dist/index.js:
|
|
|
614
614
|
* High-precision focus management utility with full composed tree support.
|
|
615
615
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
616
616
|
*
|
|
617
|
-
* @version 4.3.
|
|
617
|
+
* @version 4.3.26
|
|
618
618
|
* @author Yusuke Kamiyamane
|
|
619
619
|
* @license MIT
|
|
620
620
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var utils = require('@y14e/attribute-utils');
|
|
4
4
|
var pf = require('power-focusable');
|
|
5
5
|
|
|
6
6
|
function _interopNamespace(e) {
|
|
@@ -21,7 +21,7 @@ function _interopNamespace(e) {
|
|
|
21
21
|
return Object.freeze(n);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var utils__namespace = /*#__PURE__*/_interopNamespace(utils);
|
|
25
25
|
var pf__namespace = /*#__PURE__*/_interopNamespace(pf);
|
|
26
26
|
|
|
27
27
|
// src/index.ts
|
|
@@ -115,7 +115,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
115
115
|
this.#controller = null;
|
|
116
116
|
this.#focusables.forEach((focusable) => {
|
|
117
117
|
_RovingTabIndex.#initialized.delete(focusable);
|
|
118
|
-
|
|
118
|
+
utils__namespace.restoreAttributes(focusable);
|
|
119
119
|
});
|
|
120
120
|
this.#focusables.clear();
|
|
121
121
|
this.#focusablesByFirstChar.clear();
|
|
@@ -220,7 +220,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
220
220
|
for (const focusable of this.#focusables) {
|
|
221
221
|
if (!current.has(focusable)) {
|
|
222
222
|
_RovingTabIndex.#initialized.delete(focusable);
|
|
223
|
-
|
|
223
|
+
utils__namespace.restoreAttributes(focusable);
|
|
224
224
|
this.#focusables.delete(focusable);
|
|
225
225
|
for (const [key, focusables] of this.#focusablesByFirstChar) {
|
|
226
226
|
const index = focusables.indexOf(focusable);
|
|
@@ -242,7 +242,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
242
242
|
this.#focusables.add(focusable);
|
|
243
243
|
_RovingTabIndex.#initialized.add(focusable);
|
|
244
244
|
if (!navigationOnly) {
|
|
245
|
-
|
|
245
|
+
utils__namespace.saveAttributes(focusable, "tabindex");
|
|
246
246
|
focusable.setAttribute("tabindex", "-1");
|
|
247
247
|
}
|
|
248
248
|
if (!typeahead) {
|
|
@@ -255,8 +255,8 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
255
255
|
);
|
|
256
256
|
if (char) {
|
|
257
257
|
keys.add(char);
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
utils__namespace.saveAttributes(focusable, "aria-keyshortcuts");
|
|
259
|
+
utils__namespace.addAttributeToken(focusable, "aria-keyshortcuts", char, {
|
|
260
260
|
caseInsensitive: true
|
|
261
261
|
});
|
|
262
262
|
}
|
|
@@ -296,7 +296,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
296
296
|
* Lightweight roving tabindex utility with fully focus management.
|
|
297
297
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
298
298
|
*
|
|
299
|
-
* @version 3.1.
|
|
299
|
+
* @version 3.1.24
|
|
300
300
|
* @author Yusuke Kamiyamane
|
|
301
301
|
* @license MIT
|
|
302
302
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
* Lightweight roving tabindex utility with fully focus management.
|
|
4
4
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
5
5
|
*
|
|
6
|
-
* @version 3.1.
|
|
6
|
+
* @version 3.1.24
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
10
10
|
* @see {@link https://github.com/y14e/roving-tabindex}
|
|
11
11
|
*/
|
|
12
12
|
interface RovingTabIndexOptions {
|
|
13
|
-
direction:
|
|
13
|
+
direction: Direction;
|
|
14
14
|
navigationOnly: boolean;
|
|
15
15
|
noMemory: boolean;
|
|
16
16
|
noStart: boolean;
|
|
@@ -18,7 +18,7 @@ interface RovingTabIndexOptions {
|
|
|
18
18
|
typeahead: boolean;
|
|
19
19
|
wrap: boolean;
|
|
20
20
|
}
|
|
21
|
-
type
|
|
21
|
+
type Direction = 'both' | 'horizontal' | 'vertical';
|
|
22
22
|
declare function createRovingTabIndex(container: Element, options?: Partial<RovingTabIndexOptions>): () => void;
|
|
23
23
|
|
|
24
24
|
export { type RovingTabIndexOptions, createRovingTabIndex };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
* Lightweight roving tabindex utility with fully focus management.
|
|
4
4
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
5
5
|
*
|
|
6
|
-
* @version 3.1.
|
|
6
|
+
* @version 3.1.24
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
10
10
|
* @see {@link https://github.com/y14e/roving-tabindex}
|
|
11
11
|
*/
|
|
12
12
|
interface RovingTabIndexOptions {
|
|
13
|
-
direction:
|
|
13
|
+
direction: Direction;
|
|
14
14
|
navigationOnly: boolean;
|
|
15
15
|
noMemory: boolean;
|
|
16
16
|
noStart: boolean;
|
|
@@ -18,7 +18,7 @@ interface RovingTabIndexOptions {
|
|
|
18
18
|
typeahead: boolean;
|
|
19
19
|
wrap: boolean;
|
|
20
20
|
}
|
|
21
|
-
type
|
|
21
|
+
type Direction = 'both' | 'horizontal' | 'vertical';
|
|
22
22
|
declare function createRovingTabIndex(container: Element, options?: Partial<RovingTabIndexOptions>): () => void;
|
|
23
23
|
|
|
24
24
|
export { type RovingTabIndexOptions, createRovingTabIndex };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as utils from '@y14e/attribute-utils';
|
|
2
2
|
import * as pf from 'power-focusable';
|
|
3
3
|
|
|
4
4
|
// src/index.ts
|
|
@@ -92,7 +92,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
92
92
|
this.#controller = null;
|
|
93
93
|
this.#focusables.forEach((focusable) => {
|
|
94
94
|
_RovingTabIndex.#initialized.delete(focusable);
|
|
95
|
-
|
|
95
|
+
utils.restoreAttributes(focusable);
|
|
96
96
|
});
|
|
97
97
|
this.#focusables.clear();
|
|
98
98
|
this.#focusablesByFirstChar.clear();
|
|
@@ -197,7 +197,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
197
197
|
for (const focusable of this.#focusables) {
|
|
198
198
|
if (!current.has(focusable)) {
|
|
199
199
|
_RovingTabIndex.#initialized.delete(focusable);
|
|
200
|
-
|
|
200
|
+
utils.restoreAttributes(focusable);
|
|
201
201
|
this.#focusables.delete(focusable);
|
|
202
202
|
for (const [key, focusables] of this.#focusablesByFirstChar) {
|
|
203
203
|
const index = focusables.indexOf(focusable);
|
|
@@ -219,7 +219,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
219
219
|
this.#focusables.add(focusable);
|
|
220
220
|
_RovingTabIndex.#initialized.add(focusable);
|
|
221
221
|
if (!navigationOnly) {
|
|
222
|
-
|
|
222
|
+
utils.saveAttributes(focusable, "tabindex");
|
|
223
223
|
focusable.setAttribute("tabindex", "-1");
|
|
224
224
|
}
|
|
225
225
|
if (!typeahead) {
|
|
@@ -232,8 +232,8 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
232
232
|
);
|
|
233
233
|
if (char) {
|
|
234
234
|
keys.add(char);
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
utils.saveAttributes(focusable, "aria-keyshortcuts");
|
|
236
|
+
utils.addAttributeToken(focusable, "aria-keyshortcuts", char, {
|
|
237
237
|
caseInsensitive: true
|
|
238
238
|
});
|
|
239
239
|
}
|
|
@@ -273,7 +273,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
273
273
|
* Lightweight roving tabindex utility with fully focus management.
|
|
274
274
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
275
275
|
*
|
|
276
|
-
* @version 3.1.
|
|
276
|
+
* @version 3.1.24
|
|
277
277
|
* @author Yusuke Kamiyamane
|
|
278
278
|
* @license MIT
|
|
279
279
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@y14e/roving-tabindex",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.24",
|
|
4
4
|
"description": "Lightweight roving tabindex utility with fully focus management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -55,8 +55,11 @@
|
|
|
55
55
|
"engines": {
|
|
56
56
|
"node": ">=18"
|
|
57
57
|
},
|
|
58
|
+
"allowScripts": {
|
|
59
|
+
"esbuild": true
|
|
60
|
+
},
|
|
58
61
|
"dependencies": {
|
|
59
|
-
"@y14e/attribute-
|
|
60
|
-
"power-focusable": "^4.3.
|
|
62
|
+
"@y14e/attribute-utils": "^2.0.5",
|
|
63
|
+
"power-focusable": "^4.3.26"
|
|
61
64
|
}
|
|
62
65
|
}
|