@y14e/roving-tabindex 3.1.3 → 3.1.4
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 +3 -3
- package/dist/index.bundle.cjs +7 -12
- package/dist/index.bundle.js +7 -12
- package/dist/index.cjs +6 -11
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -11
- package/package.json +2 -2
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.4';
|
|
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.4/+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.4';
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## 📦 APIs
|
package/dist/index.bundle.cjs
CHANGED
|
@@ -377,22 +377,17 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
377
377
|
}
|
|
378
378
|
this.#controller = new AbortController();
|
|
379
379
|
const { signal } = this.#controller;
|
|
380
|
-
|
|
381
|
-
this.#settings.noMemory &&
|
|
380
|
+
this.#container.addEventListener("focusin", this.#onFocusIn, { signal });
|
|
381
|
+
this.#settings.noMemory && this.#container.addEventListener("focusout", this.#onFocusOut, { signal });
|
|
382
382
|
this.#container.addEventListener("keydown", this.#onKeyDown, { signal });
|
|
383
383
|
}
|
|
384
384
|
#onFocusIn = (event) => {
|
|
385
385
|
const { target } = event;
|
|
386
|
-
|
|
387
|
-
return;
|
|
388
|
-
}
|
|
389
|
-
const isFocusable2 = this.#focusables.has(target);
|
|
390
|
-
this.#settings.noMemory && !isFocusable2 ? this.#update() : isFocusable2 && this.#update(target);
|
|
386
|
+
target instanceof Element && this.#update(target);
|
|
391
387
|
};
|
|
392
388
|
#onFocusOut = (event) => {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
}
|
|
389
|
+
const target = event.relatedTarget;
|
|
390
|
+
(!(target instanceof Element) || !this.#focusables.has(target)) && this.#update();
|
|
396
391
|
};
|
|
397
392
|
#onKeyDown = (event) => {
|
|
398
393
|
const { key, altKey, ctrlKey, metaKey, shiftKey } = event;
|
|
@@ -531,7 +526,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
531
526
|
* Lightweight roving tabindex utility with fully focus management.
|
|
532
527
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
533
528
|
*
|
|
534
|
-
* @version 3.1.
|
|
529
|
+
* @version 3.1.4
|
|
535
530
|
* @author Yusuke Kamiyamane
|
|
536
531
|
* @license MIT
|
|
537
532
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -556,7 +551,7 @@ power-focusable/dist/index.js:
|
|
|
556
551
|
* High-precision focus management utility with full composed tree support.
|
|
557
552
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
558
553
|
*
|
|
559
|
-
* @version 4.3.
|
|
554
|
+
* @version 4.3.6
|
|
560
555
|
* @author Yusuke Kamiyamane
|
|
561
556
|
* @license MIT
|
|
562
557
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.bundle.js
CHANGED
|
@@ -375,22 +375,17 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
375
375
|
}
|
|
376
376
|
this.#controller = new AbortController();
|
|
377
377
|
const { signal } = this.#controller;
|
|
378
|
-
|
|
379
|
-
this.#settings.noMemory &&
|
|
378
|
+
this.#container.addEventListener("focusin", this.#onFocusIn, { signal });
|
|
379
|
+
this.#settings.noMemory && this.#container.addEventListener("focusout", this.#onFocusOut, { signal });
|
|
380
380
|
this.#container.addEventListener("keydown", this.#onKeyDown, { signal });
|
|
381
381
|
}
|
|
382
382
|
#onFocusIn = (event) => {
|
|
383
383
|
const { target } = event;
|
|
384
|
-
|
|
385
|
-
return;
|
|
386
|
-
}
|
|
387
|
-
const isFocusable2 = this.#focusables.has(target);
|
|
388
|
-
this.#settings.noMemory && !isFocusable2 ? this.#update() : isFocusable2 && this.#update(target);
|
|
384
|
+
target instanceof Element && this.#update(target);
|
|
389
385
|
};
|
|
390
386
|
#onFocusOut = (event) => {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
}
|
|
387
|
+
const target = event.relatedTarget;
|
|
388
|
+
(!(target instanceof Element) || !this.#focusables.has(target)) && this.#update();
|
|
394
389
|
};
|
|
395
390
|
#onKeyDown = (event) => {
|
|
396
391
|
const { key, altKey, ctrlKey, metaKey, shiftKey } = event;
|
|
@@ -529,7 +524,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
529
524
|
* Lightweight roving tabindex utility with fully focus management.
|
|
530
525
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
531
526
|
*
|
|
532
|
-
* @version 3.1.
|
|
527
|
+
* @version 3.1.4
|
|
533
528
|
* @author Yusuke Kamiyamane
|
|
534
529
|
* @license MIT
|
|
535
530
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -554,7 +549,7 @@ power-focusable/dist/index.js:
|
|
|
554
549
|
* High-precision focus management utility with full composed tree support.
|
|
555
550
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
556
551
|
*
|
|
557
|
-
* @version 4.3.
|
|
552
|
+
* @version 4.3.6
|
|
558
553
|
* @author Yusuke Kamiyamane
|
|
559
554
|
* @license MIT
|
|
560
555
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.cjs
CHANGED
|
@@ -93,22 +93,17 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
93
93
|
}
|
|
94
94
|
this.#controller = new AbortController();
|
|
95
95
|
const { signal } = this.#controller;
|
|
96
|
-
|
|
97
|
-
this.#settings.noMemory &&
|
|
96
|
+
this.#container.addEventListener("focusin", this.#onFocusIn, { signal });
|
|
97
|
+
this.#settings.noMemory && this.#container.addEventListener("focusout", this.#onFocusOut, { signal });
|
|
98
98
|
this.#container.addEventListener("keydown", this.#onKeyDown, { signal });
|
|
99
99
|
}
|
|
100
100
|
#onFocusIn = (event) => {
|
|
101
101
|
const { target } = event;
|
|
102
|
-
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
const isFocusable = this.#focusables.has(target);
|
|
106
|
-
this.#settings.noMemory && !isFocusable ? this.#update() : isFocusable && this.#update(target);
|
|
102
|
+
target instanceof Element && this.#update(target);
|
|
107
103
|
};
|
|
108
104
|
#onFocusOut = (event) => {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
105
|
+
const target = event.relatedTarget;
|
|
106
|
+
(!(target instanceof Element) || !this.#focusables.has(target)) && this.#update();
|
|
112
107
|
};
|
|
113
108
|
#onKeyDown = (event) => {
|
|
114
109
|
const { key, altKey, ctrlKey, metaKey, shiftKey } = event;
|
|
@@ -247,7 +242,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
247
242
|
* Lightweight roving tabindex utility with fully focus management.
|
|
248
243
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
249
244
|
*
|
|
250
|
-
* @version 3.1.
|
|
245
|
+
* @version 3.1.4
|
|
251
246
|
* @author Yusuke Kamiyamane
|
|
252
247
|
* @license MIT
|
|
253
248
|
* @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.1.
|
|
6
|
+
* @version 3.1.4
|
|
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.1.
|
|
6
|
+
* @version 3.1.4
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.js
CHANGED
|
@@ -91,22 +91,17 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
91
91
|
}
|
|
92
92
|
this.#controller = new AbortController();
|
|
93
93
|
const { signal } = this.#controller;
|
|
94
|
-
|
|
95
|
-
this.#settings.noMemory &&
|
|
94
|
+
this.#container.addEventListener("focusin", this.#onFocusIn, { signal });
|
|
95
|
+
this.#settings.noMemory && this.#container.addEventListener("focusout", this.#onFocusOut, { signal });
|
|
96
96
|
this.#container.addEventListener("keydown", this.#onKeyDown, { signal });
|
|
97
97
|
}
|
|
98
98
|
#onFocusIn = (event) => {
|
|
99
99
|
const { target } = event;
|
|
100
|
-
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
const isFocusable = this.#focusables.has(target);
|
|
104
|
-
this.#settings.noMemory && !isFocusable ? this.#update() : isFocusable && this.#update(target);
|
|
100
|
+
target instanceof Element && this.#update(target);
|
|
105
101
|
};
|
|
106
102
|
#onFocusOut = (event) => {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
103
|
+
const target = event.relatedTarget;
|
|
104
|
+
(!(target instanceof Element) || !this.#focusables.has(target)) && this.#update();
|
|
110
105
|
};
|
|
111
106
|
#onKeyDown = (event) => {
|
|
112
107
|
const { key, altKey, ctrlKey, metaKey, shiftKey } = event;
|
|
@@ -245,7 +240,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
245
240
|
* Lightweight roving tabindex utility with fully focus management.
|
|
246
241
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
247
242
|
*
|
|
248
|
-
* @version 3.1.
|
|
243
|
+
* @version 3.1.4
|
|
249
244
|
* @author Yusuke Kamiyamane
|
|
250
245
|
* @license MIT
|
|
251
246
|
* @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.4",
|
|
4
4
|
"description": "Lightweight roving tabindex utility with fully focus management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -57,6 +57,6 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@y14e/attributes-utils": "^1.1.2",
|
|
60
|
-
"power-focusable": "^4.3.
|
|
60
|
+
"power-focusable": "^4.3.6"
|
|
61
61
|
}
|
|
62
62
|
}
|