@y14e/roving-tabindex 3.0.0 → 3.0.1
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 +8 -7
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -7
- package/package.json +1 -1
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.1';
|
|
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.1';
|
|
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.1/+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.1';
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## 📦 APIs
|
package/dist/index.cjs
CHANGED
|
@@ -430,8 +430,7 @@ var RovingTabIndex = class {
|
|
|
430
430
|
}
|
|
431
431
|
event.preventDefault();
|
|
432
432
|
const currentIndex = current.indexOf(active);
|
|
433
|
-
let
|
|
434
|
-
let newIndex = currentIndex;
|
|
433
|
+
let newIndex;
|
|
435
434
|
let target = current;
|
|
436
435
|
switch (key) {
|
|
437
436
|
case "End":
|
|
@@ -441,15 +440,17 @@ var RovingTabIndex = class {
|
|
|
441
440
|
newIndex = 0;
|
|
442
441
|
break;
|
|
443
442
|
case "ArrowLeft":
|
|
444
|
-
case "ArrowUp":
|
|
445
|
-
rawIndex = currentIndex - 1;
|
|
443
|
+
case "ArrowUp": {
|
|
444
|
+
const rawIndex = currentIndex - 1;
|
|
446
445
|
newIndex = wrap ? rawIndex : Math.max(rawIndex, 0);
|
|
447
446
|
break;
|
|
447
|
+
}
|
|
448
448
|
case "ArrowRight":
|
|
449
|
-
case "ArrowDown":
|
|
450
|
-
rawIndex = currentIndex + 1;
|
|
449
|
+
case "ArrowDown": {
|
|
450
|
+
const rawIndex = currentIndex + 1;
|
|
451
451
|
newIndex = wrap ? rawIndex % current.length : Math.min(rawIndex, current.length - 1);
|
|
452
452
|
break;
|
|
453
|
+
}
|
|
453
454
|
default: {
|
|
454
455
|
target = this.#focusablesByFirstChar.get(key.toUpperCase()) ?? [];
|
|
455
456
|
const foundIndex = target.findIndex(
|
|
@@ -546,7 +547,7 @@ function getActiveElement() {
|
|
|
546
547
|
* Lightweight roving tabindex utility with fully focus management.
|
|
547
548
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
548
549
|
*
|
|
549
|
-
* @version 3.0.
|
|
550
|
+
* @version 3.0.1
|
|
550
551
|
* @author Yusuke Kamiyamane
|
|
551
552
|
* @license MIT
|
|
552
553
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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.0.
|
|
6
|
+
* @version 3.0.1
|
|
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
|
* Lightweight roving tabindex utility with fully focus management.
|
|
4
4
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
5
5
|
*
|
|
6
|
-
* @version 3.0.
|
|
6
|
+
* @version 3.0.1
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.js
CHANGED
|
@@ -428,8 +428,7 @@ var RovingTabIndex = class {
|
|
|
428
428
|
}
|
|
429
429
|
event.preventDefault();
|
|
430
430
|
const currentIndex = current.indexOf(active);
|
|
431
|
-
let
|
|
432
|
-
let newIndex = currentIndex;
|
|
431
|
+
let newIndex;
|
|
433
432
|
let target = current;
|
|
434
433
|
switch (key) {
|
|
435
434
|
case "End":
|
|
@@ -439,15 +438,17 @@ var RovingTabIndex = class {
|
|
|
439
438
|
newIndex = 0;
|
|
440
439
|
break;
|
|
441
440
|
case "ArrowLeft":
|
|
442
|
-
case "ArrowUp":
|
|
443
|
-
rawIndex = currentIndex - 1;
|
|
441
|
+
case "ArrowUp": {
|
|
442
|
+
const rawIndex = currentIndex - 1;
|
|
444
443
|
newIndex = wrap ? rawIndex : Math.max(rawIndex, 0);
|
|
445
444
|
break;
|
|
445
|
+
}
|
|
446
446
|
case "ArrowRight":
|
|
447
|
-
case "ArrowDown":
|
|
448
|
-
rawIndex = currentIndex + 1;
|
|
447
|
+
case "ArrowDown": {
|
|
448
|
+
const rawIndex = currentIndex + 1;
|
|
449
449
|
newIndex = wrap ? rawIndex % current.length : Math.min(rawIndex, current.length - 1);
|
|
450
450
|
break;
|
|
451
|
+
}
|
|
451
452
|
default: {
|
|
452
453
|
target = this.#focusablesByFirstChar.get(key.toUpperCase()) ?? [];
|
|
453
454
|
const foundIndex = target.findIndex(
|
|
@@ -544,7 +545,7 @@ function getActiveElement() {
|
|
|
544
545
|
* Lightweight roving tabindex utility with fully focus management.
|
|
545
546
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
546
547
|
*
|
|
547
|
-
* @version 3.0.
|
|
548
|
+
* @version 3.0.1
|
|
548
549
|
* @author Yusuke Kamiyamane
|
|
549
550
|
* @license MIT
|
|
550
551
|
* @copyright Copyright (c) Yusuke Kamiyamane
|