@y14e/roving-tabindex 2.0.6 → 2.0.7

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 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@2.0.6';
13
+ import { createRovingTabIndex } from '@y14e/roving-tabindex@2.0.7';
14
14
 
15
15
  // CDNs
16
- import { createRovingTabIndex } from 'https://esm.sh/@y14e/roving-tabindex@2.0.6';
16
+ import { createRovingTabIndex } from 'https://esm.sh/@y14e/roving-tabindex@2.0.7';
17
17
  // or
18
- import { createRovingTabIndex } from 'https://cdn.jsdelivr.net/npm/@y14e/roving-tabindex@2.0.6/+esm';
18
+ import { createRovingTabIndex } from 'https://cdn.jsdelivr.net/npm/@y14e/roving-tabindex@2.0.7/+esm';
19
19
  // or
20
- import { createRovingTabIndex } from 'https://esm.unpkg.com/@y14e/roving-tabindex@2.0.6';
20
+ import { createRovingTabIndex } from 'https://esm.unpkg.com/@y14e/roving-tabindex@2.0.7';
21
21
  ```
22
22
 
23
23
  ## 📦 APIs
package/dist/index.cjs CHANGED
@@ -327,12 +327,8 @@ function createRovingTabIndex(container, options = {}) {
327
327
  wrap = false;
328
328
  }
329
329
  const settings = { navigationOnly, typeahead, wrap };
330
- if (direction) {
331
- Object.assign(settings, { direction });
332
- }
333
- if (selector) {
334
- Object.assign(settings, { selector });
335
- }
330
+ direction && Object.assign(settings, { direction });
331
+ selector && Object.assign(settings, { selector });
336
332
  const roving = new RovingTabIndex(container, settings);
337
333
  return () => roving.destroy();
338
334
  }
@@ -444,10 +440,7 @@ var RovingTabIndex = class {
444
440
  }
445
441
  }
446
442
  const focusable = target.at(newIndex);
447
- if (!focusable) {
448
- return;
449
- }
450
- focusElement(focusable);
443
+ focusable && focusElement(focusable);
451
444
  };
452
445
  #update(active) {
453
446
  const current = new Set(this.#getFocusables());
@@ -534,7 +527,7 @@ function getActiveElement() {
534
527
  * Lightweight roving tabindex utility with fully focus management.
535
528
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
536
529
  *
537
- * @version 2.0.6
530
+ * @version 2.0.7
538
531
  * @author Yusuke Kamiyamane
539
532
  * @license MIT
540
533
  * @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 2.0.6
6
+ * @version 2.0.7
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 2.0.6
6
+ * @version 2.0.7
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.js CHANGED
@@ -325,12 +325,8 @@ function createRovingTabIndex(container, options = {}) {
325
325
  wrap = false;
326
326
  }
327
327
  const settings = { navigationOnly, typeahead, wrap };
328
- if (direction) {
329
- Object.assign(settings, { direction });
330
- }
331
- if (selector) {
332
- Object.assign(settings, { selector });
333
- }
328
+ direction && Object.assign(settings, { direction });
329
+ selector && Object.assign(settings, { selector });
334
330
  const roving = new RovingTabIndex(container, settings);
335
331
  return () => roving.destroy();
336
332
  }
@@ -442,10 +438,7 @@ var RovingTabIndex = class {
442
438
  }
443
439
  }
444
440
  const focusable = target.at(newIndex);
445
- if (!focusable) {
446
- return;
447
- }
448
- focusElement(focusable);
441
+ focusable && focusElement(focusable);
449
442
  };
450
443
  #update(active) {
451
444
  const current = new Set(this.#getFocusables());
@@ -532,7 +525,7 @@ function getActiveElement() {
532
525
  * Lightweight roving tabindex utility with fully focus management.
533
526
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
534
527
  *
535
- * @version 2.0.6
528
+ * @version 2.0.7
536
529
  * @author Yusuke Kamiyamane
537
530
  * @license MIT
538
531
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/roving-tabindex",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "Lightweight roving tabindex utility with fully focus management",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",