power-focusable 4.3.0 → 4.3.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/dist/index.cjs CHANGED
@@ -245,13 +245,14 @@ function getRelativeFocusable(container, offset, options) {
245
245
  console.warn("Invalid wrap option. Fallback: false.");
246
246
  wrap = false;
247
247
  }
248
- const focusables = getFocusables(container, {
249
- composed,
250
- filter,
251
- include,
252
- skipNegativeTabIndexCheck,
253
- skipVisibilityCheck
254
- });
248
+ const settings = { composed, skipNegativeTabIndexCheck, skipVisibilityCheck };
249
+ if (filter !== void 0) {
250
+ Object.assign(settings, { filter });
251
+ }
252
+ if (include !== void 0) {
253
+ Object.assign(settings, { include });
254
+ }
255
+ const focusables = getFocusables(container, settings);
255
256
  const { length } = focusables;
256
257
  if (!length) {
257
258
  return null;
@@ -482,7 +483,7 @@ function isUngroupedRadio(element) {
482
483
  * High-precision focus management utility with full composed tree support.
483
484
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
484
485
  *
485
- * @version 4.3.0
486
+ * @version 4.3.1
486
487
  * @author Yusuke Kamiyamane
487
488
  * @license MIT
488
489
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.cts CHANGED
@@ -3,7 +3,7 @@
3
3
  * High-precision focus management utility with full composed tree support.
4
4
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
5
5
  *
6
- * @version 4.3.0
6
+ * @version 4.3.1
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -12,8 +12,8 @@
12
12
  interface PowerFocusableOptions {
13
13
  readonly anchor?: Element | null;
14
14
  readonly composed?: boolean;
15
- readonly filter?: ((element: Element) => boolean) | undefined;
16
- readonly include?: ((element: Element) => boolean) | undefined;
15
+ readonly filter?: (element: Element) => boolean;
16
+ readonly include?: (element: Element) => boolean;
17
17
  readonly skipNegativeTabIndexCheck?: boolean;
18
18
  readonly skipVisibilityCheck?: boolean;
19
19
  readonly wrap?: boolean;
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * High-precision focus management utility with full composed tree support.
4
4
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
5
5
  *
6
- * @version 4.3.0
6
+ * @version 4.3.1
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -12,8 +12,8 @@
12
12
  interface PowerFocusableOptions {
13
13
  readonly anchor?: Element | null;
14
14
  readonly composed?: boolean;
15
- readonly filter?: ((element: Element) => boolean) | undefined;
16
- readonly include?: ((element: Element) => boolean) | undefined;
15
+ readonly filter?: (element: Element) => boolean;
16
+ readonly include?: (element: Element) => boolean;
17
17
  readonly skipNegativeTabIndexCheck?: boolean;
18
18
  readonly skipVisibilityCheck?: boolean;
19
19
  readonly wrap?: boolean;
package/dist/index.js CHANGED
@@ -243,13 +243,14 @@ function getRelativeFocusable(container, offset, options) {
243
243
  console.warn("Invalid wrap option. Fallback: false.");
244
244
  wrap = false;
245
245
  }
246
- const focusables = getFocusables(container, {
247
- composed,
248
- filter,
249
- include,
250
- skipNegativeTabIndexCheck,
251
- skipVisibilityCheck
252
- });
246
+ const settings = { composed, skipNegativeTabIndexCheck, skipVisibilityCheck };
247
+ if (filter !== void 0) {
248
+ Object.assign(settings, { filter });
249
+ }
250
+ if (include !== void 0) {
251
+ Object.assign(settings, { include });
252
+ }
253
+ const focusables = getFocusables(container, settings);
253
254
  const { length } = focusables;
254
255
  if (!length) {
255
256
  return null;
@@ -480,7 +481,7 @@ function isUngroupedRadio(element) {
480
481
  * High-precision focus management utility with full composed tree support.
481
482
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
482
483
  *
483
- * @version 4.3.0
484
+ * @version 4.3.1
484
485
  * @author Yusuke Kamiyamane
485
486
  * @license MIT
486
487
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "power-focusable",
3
- "version": "4.3.0",
3
+ "version": "4.3.1",
4
4
  "description": "High-precision focus management utility with full composed tree support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",