@y14e/roving-tabindex 3.1.19 → 3.1.20

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
@@ -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.19';
16
+ import { createRovingTabIndex } from 'https://esm.sh/@y14e/roving-tabindex@3.1.20';
17
17
  // or
18
- import { createRovingTabIndex } from 'https://cdn.jsdelivr.net/npm/@y14e/roving-tabindex@3.1.19/+esm';
18
+ import { createRovingTabIndex } from 'https://cdn.jsdelivr.net/npm/@y14e/roving-tabindex@3.1.20/+esm';
19
19
  // or
20
- import { createRovingTabIndex } from 'https://esm.unpkg.com/@y14e/roving-tabindex@3.1.19';
20
+ import { createRovingTabIndex } from 'https://esm.unpkg.com/@y14e/roving-tabindex@3.1.20';
21
21
  ```
22
22
 
23
23
  ## 📦 APIs
@@ -366,17 +366,20 @@ var RovingTabIndex = class _RovingTabIndex {
366
366
  noStart = false;
367
367
  }
368
368
  if (selector !== "") {
369
+ let hasError = false;
369
370
  if (typeof selector !== "string" || !selector.trim()) {
370
- console.warn("Invalid selector. Fallback: no selector string.");
371
- selector = "";
371
+ hasError = true;
372
372
  } else {
373
373
  try {
374
- container.querySelector(selector);
374
+ this.#container.querySelector(selector);
375
375
  } catch {
376
- console.warn("Invalid selector. Fallback: no selector string.");
377
- selector = "";
376
+ hasError = true;
378
377
  }
379
378
  }
379
+ if (hasError) {
380
+ console.warn("Invalid selector. Fallback: no selector string.");
381
+ selector = "";
382
+ }
380
383
  }
381
384
  if (typeof typeahead !== "boolean") {
382
385
  console.warn("Invalid typeahead option. Fallback: false.");
@@ -588,7 +591,7 @@ var RovingTabIndex = class _RovingTabIndex {
588
591
  * Lightweight roving tabindex utility with fully focus management.
589
592
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
590
593
  *
591
- * @version 3.1.19
594
+ * @version 3.1.20
592
595
  * @author Yusuke Kamiyamane
593
596
  * @license MIT
594
597
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -364,17 +364,20 @@ var RovingTabIndex = class _RovingTabIndex {
364
364
  noStart = false;
365
365
  }
366
366
  if (selector !== "") {
367
+ let hasError = false;
367
368
  if (typeof selector !== "string" || !selector.trim()) {
368
- console.warn("Invalid selector. Fallback: no selector string.");
369
- selector = "";
369
+ hasError = true;
370
370
  } else {
371
371
  try {
372
- container.querySelector(selector);
372
+ this.#container.querySelector(selector);
373
373
  } catch {
374
- console.warn("Invalid selector. Fallback: no selector string.");
375
- selector = "";
374
+ hasError = true;
376
375
  }
377
376
  }
377
+ if (hasError) {
378
+ console.warn("Invalid selector. Fallback: no selector string.");
379
+ selector = "";
380
+ }
378
381
  }
379
382
  if (typeof typeahead !== "boolean") {
380
383
  console.warn("Invalid typeahead option. Fallback: false.");
@@ -586,7 +589,7 @@ var RovingTabIndex = class _RovingTabIndex {
586
589
  * Lightweight roving tabindex utility with fully focus management.
587
590
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
588
591
  *
589
- * @version 3.1.19
592
+ * @version 3.1.20
590
593
  * @author Yusuke Kamiyamane
591
594
  * @license MIT
592
595
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.cjs CHANGED
@@ -50,17 +50,20 @@ var RovingTabIndex = class _RovingTabIndex {
50
50
  noStart = false;
51
51
  }
52
52
  if (selector !== "") {
53
+ let hasError = false;
53
54
  if (typeof selector !== "string" || !selector.trim()) {
54
- console.warn("Invalid selector. Fallback: no selector string.");
55
- selector = "";
55
+ hasError = true;
56
56
  } else {
57
57
  try {
58
- container.querySelector(selector);
58
+ this.#container.querySelector(selector);
59
59
  } catch {
60
- console.warn("Invalid selector. Fallback: no selector string.");
61
- selector = "";
60
+ hasError = true;
62
61
  }
63
62
  }
63
+ if (hasError) {
64
+ console.warn("Invalid selector. Fallback: no selector string.");
65
+ selector = "";
66
+ }
64
67
  }
65
68
  if (typeof typeahead !== "boolean") {
66
69
  console.warn("Invalid typeahead option. Fallback: false.");
@@ -272,7 +275,7 @@ var RovingTabIndex = class _RovingTabIndex {
272
275
  * Lightweight roving tabindex utility with fully focus management.
273
276
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
274
277
  *
275
- * @version 3.1.19
278
+ * @version 3.1.20
276
279
  * @author Yusuke Kamiyamane
277
280
  * @license MIT
278
281
  * @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.19
6
+ * @version 3.1.20
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.19
6
+ * @version 3.1.20
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.js CHANGED
@@ -48,17 +48,20 @@ var RovingTabIndex = class _RovingTabIndex {
48
48
  noStart = false;
49
49
  }
50
50
  if (selector !== "") {
51
+ let hasError = false;
51
52
  if (typeof selector !== "string" || !selector.trim()) {
52
- console.warn("Invalid selector. Fallback: no selector string.");
53
- selector = "";
53
+ hasError = true;
54
54
  } else {
55
55
  try {
56
- container.querySelector(selector);
56
+ this.#container.querySelector(selector);
57
57
  } catch {
58
- console.warn("Invalid selector. Fallback: no selector string.");
59
- selector = "";
58
+ hasError = true;
60
59
  }
61
60
  }
61
+ if (hasError) {
62
+ console.warn("Invalid selector. Fallback: no selector string.");
63
+ selector = "";
64
+ }
62
65
  }
63
66
  if (typeof typeahead !== "boolean") {
64
67
  console.warn("Invalid typeahead option. Fallback: false.");
@@ -270,7 +273,7 @@ var RovingTabIndex = class _RovingTabIndex {
270
273
  * Lightweight roving tabindex utility with fully focus management.
271
274
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
272
275
  *
273
- * @version 3.1.19
276
+ * @version 3.1.20
274
277
  * @author Yusuke Kamiyamane
275
278
  * @license MIT
276
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.19",
3
+ "version": "3.1.20",
4
4
  "description": "Lightweight roving tabindex utility with fully focus management",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",