@y14e/roving-tabindex 1.3.1 → 1.3.2
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 +5 -0
- package/dist/index.cjs +14 -4
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +14 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -44,6 +44,7 @@ interface RovingTabIndexOptions {
|
|
|
44
44
|
direction?: 'horizontal' | 'vertical' | undefined; // default: both (undefined)
|
|
45
45
|
navigationOnly?: boolean; // default: false
|
|
46
46
|
selector?: string | undefined;
|
|
47
|
+
skipVisibilityCheck?: boolean; // default: false
|
|
47
48
|
typeahead?: boolean; // default: false
|
|
48
49
|
wrap?: boolean; // default: false
|
|
49
50
|
}
|
|
@@ -53,6 +54,10 @@ interface RovingTabIndexOptions {
|
|
|
53
54
|
|
|
54
55
|
If `true`, enables keyboard navigation without modifying `tabindex`. Useful for widgets like accordions where all items should remain tabbable while still supporting arrow key navigation.
|
|
55
56
|
|
|
57
|
+
### `skipVisibilityCheck`
|
|
58
|
+
|
|
59
|
+
If `true`, skips `checkVisibility()` when determining focusability. Useful for initializing.
|
|
60
|
+
|
|
56
61
|
### `typeahead`
|
|
57
62
|
|
|
58
63
|
If `true`, enables character-based focus navigation. Typing a character moves focus to the next matching element.
|
package/dist/index.cjs
CHANGED
|
@@ -79,6 +79,10 @@ function getFocusables(container = document.body, options = {}) {
|
|
|
79
79
|
);
|
|
80
80
|
include = void 0;
|
|
81
81
|
}
|
|
82
|
+
if (typeof skipVisibilityCheck !== "boolean") {
|
|
83
|
+
console.warn("Invalid skipVisibilityCheck option. Fallback: false.");
|
|
84
|
+
skipVisibilityCheck = false;
|
|
85
|
+
}
|
|
82
86
|
const elements = [];
|
|
83
87
|
if (composed || include) {
|
|
84
88
|
let traverse2 = function(node) {
|
|
@@ -280,6 +284,7 @@ function createRovingTabIndex(container, options = {}) {
|
|
|
280
284
|
direction,
|
|
281
285
|
navigationOnly = false,
|
|
282
286
|
selector,
|
|
287
|
+
skipVisibilityCheck = false,
|
|
283
288
|
typeahead = false,
|
|
284
289
|
wrap = false
|
|
285
290
|
} = options;
|
|
@@ -297,6 +302,10 @@ function createRovingTabIndex(container, options = {}) {
|
|
|
297
302
|
);
|
|
298
303
|
selector = void 0;
|
|
299
304
|
}
|
|
305
|
+
if (typeof skipVisibilityCheck !== "boolean") {
|
|
306
|
+
console.warn("Invalid skipVisibilityCheck option. Fallback: false.");
|
|
307
|
+
skipVisibilityCheck = false;
|
|
308
|
+
}
|
|
300
309
|
if (typeof typeahead !== "boolean") {
|
|
301
310
|
console.warn("Invalid typeahead option. Fallback: false.");
|
|
302
311
|
typeahead = false;
|
|
@@ -309,6 +318,7 @@ function createRovingTabIndex(container, options = {}) {
|
|
|
309
318
|
direction,
|
|
310
319
|
navigationOnly,
|
|
311
320
|
selector,
|
|
321
|
+
skipVisibilityCheck,
|
|
312
322
|
typeahead,
|
|
313
323
|
wrap
|
|
314
324
|
});
|
|
@@ -422,7 +432,7 @@ var RovingTabIndex = class {
|
|
|
422
432
|
...getFocusables(this.#container, {
|
|
423
433
|
composed: true,
|
|
424
434
|
filter: this.#selectorFilter,
|
|
425
|
-
skipVisibilityCheck:
|
|
435
|
+
skipVisibilityCheck: !!this.#options.skipVisibilityCheck
|
|
426
436
|
})
|
|
427
437
|
]);
|
|
428
438
|
for (const focusable of this.#focusables) {
|
|
@@ -489,7 +499,7 @@ var RovingTabIndex = class {
|
|
|
489
499
|
composed: true,
|
|
490
500
|
filter: this.#selectorFilter,
|
|
491
501
|
include: (element) => this.#focusables.has(element),
|
|
492
|
-
skipVisibilityCheck:
|
|
502
|
+
skipVisibilityCheck: !!this.#options.skipVisibilityCheck
|
|
493
503
|
});
|
|
494
504
|
}
|
|
495
505
|
};
|
|
@@ -508,7 +518,7 @@ function getActiveElement() {
|
|
|
508
518
|
* Lightweight roving tabindex utility with fully focus management.
|
|
509
519
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
510
520
|
*
|
|
511
|
-
* @version 1.3.
|
|
521
|
+
* @version 1.3.2
|
|
512
522
|
* @author Yusuke Kamiyamane
|
|
513
523
|
* @license MIT
|
|
514
524
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -533,7 +543,7 @@ power-focusable/dist/index.js:
|
|
|
533
543
|
* High-precision focus management utility with full composed tree support.
|
|
534
544
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
535
545
|
*
|
|
536
|
-
* @version 4.2.
|
|
546
|
+
* @version 4.2.1
|
|
537
547
|
* @author Yusuke Kamiyamane
|
|
538
548
|
* @license MIT
|
|
539
549
|
* @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 1.3.
|
|
6
|
+
* @version 1.3.2
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -13,6 +13,7 @@ interface RovingTabIndexOptions {
|
|
|
13
13
|
readonly direction?: 'horizontal' | 'vertical' | undefined;
|
|
14
14
|
readonly navigationOnly?: boolean;
|
|
15
15
|
readonly selector?: string | undefined;
|
|
16
|
+
readonly skipVisibilityCheck?: boolean;
|
|
16
17
|
readonly typeahead?: boolean;
|
|
17
18
|
readonly wrap?: boolean;
|
|
18
19
|
}
|
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 1.3.
|
|
6
|
+
* @version 1.3.2
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -13,6 +13,7 @@ interface RovingTabIndexOptions {
|
|
|
13
13
|
readonly direction?: 'horizontal' | 'vertical' | undefined;
|
|
14
14
|
readonly navigationOnly?: boolean;
|
|
15
15
|
readonly selector?: string | undefined;
|
|
16
|
+
readonly skipVisibilityCheck?: boolean;
|
|
16
17
|
readonly typeahead?: boolean;
|
|
17
18
|
readonly wrap?: boolean;
|
|
18
19
|
}
|
package/dist/index.js
CHANGED
|
@@ -77,6 +77,10 @@ function getFocusables(container = document.body, options = {}) {
|
|
|
77
77
|
);
|
|
78
78
|
include = void 0;
|
|
79
79
|
}
|
|
80
|
+
if (typeof skipVisibilityCheck !== "boolean") {
|
|
81
|
+
console.warn("Invalid skipVisibilityCheck option. Fallback: false.");
|
|
82
|
+
skipVisibilityCheck = false;
|
|
83
|
+
}
|
|
80
84
|
const elements = [];
|
|
81
85
|
if (composed || include) {
|
|
82
86
|
let traverse2 = function(node) {
|
|
@@ -278,6 +282,7 @@ function createRovingTabIndex(container, options = {}) {
|
|
|
278
282
|
direction,
|
|
279
283
|
navigationOnly = false,
|
|
280
284
|
selector,
|
|
285
|
+
skipVisibilityCheck = false,
|
|
281
286
|
typeahead = false,
|
|
282
287
|
wrap = false
|
|
283
288
|
} = options;
|
|
@@ -295,6 +300,10 @@ function createRovingTabIndex(container, options = {}) {
|
|
|
295
300
|
);
|
|
296
301
|
selector = void 0;
|
|
297
302
|
}
|
|
303
|
+
if (typeof skipVisibilityCheck !== "boolean") {
|
|
304
|
+
console.warn("Invalid skipVisibilityCheck option. Fallback: false.");
|
|
305
|
+
skipVisibilityCheck = false;
|
|
306
|
+
}
|
|
298
307
|
if (typeof typeahead !== "boolean") {
|
|
299
308
|
console.warn("Invalid typeahead option. Fallback: false.");
|
|
300
309
|
typeahead = false;
|
|
@@ -307,6 +316,7 @@ function createRovingTabIndex(container, options = {}) {
|
|
|
307
316
|
direction,
|
|
308
317
|
navigationOnly,
|
|
309
318
|
selector,
|
|
319
|
+
skipVisibilityCheck,
|
|
310
320
|
typeahead,
|
|
311
321
|
wrap
|
|
312
322
|
});
|
|
@@ -420,7 +430,7 @@ var RovingTabIndex = class {
|
|
|
420
430
|
...getFocusables(this.#container, {
|
|
421
431
|
composed: true,
|
|
422
432
|
filter: this.#selectorFilter,
|
|
423
|
-
skipVisibilityCheck:
|
|
433
|
+
skipVisibilityCheck: !!this.#options.skipVisibilityCheck
|
|
424
434
|
})
|
|
425
435
|
]);
|
|
426
436
|
for (const focusable of this.#focusables) {
|
|
@@ -487,7 +497,7 @@ var RovingTabIndex = class {
|
|
|
487
497
|
composed: true,
|
|
488
498
|
filter: this.#selectorFilter,
|
|
489
499
|
include: (element) => this.#focusables.has(element),
|
|
490
|
-
skipVisibilityCheck:
|
|
500
|
+
skipVisibilityCheck: !!this.#options.skipVisibilityCheck
|
|
491
501
|
});
|
|
492
502
|
}
|
|
493
503
|
};
|
|
@@ -506,7 +516,7 @@ function getActiveElement() {
|
|
|
506
516
|
* Lightweight roving tabindex utility with fully focus management.
|
|
507
517
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
508
518
|
*
|
|
509
|
-
* @version 1.3.
|
|
519
|
+
* @version 1.3.2
|
|
510
520
|
* @author Yusuke Kamiyamane
|
|
511
521
|
* @license MIT
|
|
512
522
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -531,7 +541,7 @@ power-focusable/dist/index.js:
|
|
|
531
541
|
* High-precision focus management utility with full composed tree support.
|
|
532
542
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
533
543
|
*
|
|
534
|
-
* @version 4.2.
|
|
544
|
+
* @version 4.2.1
|
|
535
545
|
* @author Yusuke Kamiyamane
|
|
536
546
|
* @license MIT
|
|
537
547
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@y14e/roving-tabindex",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
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.0.5",
|
|
52
52
|
"bun-types": "latest",
|
|
53
|
-
"power-focusable": "^4.2.
|
|
53
|
+
"power-focusable": "^4.2.1",
|
|
54
54
|
"tsup": "^8.0.0",
|
|
55
55
|
"typescript": "^5.6.0"
|
|
56
56
|
},
|