@y14e/disclosure 2.0.13 → 2.0.14
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 +122 -94
- package/dist/index.bundle.js +122 -94
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -13,11 +13,11 @@ npm i @y14e/disclosure
|
|
|
13
13
|
import { Disclosure } from "@y14e/disclosure";
|
|
14
14
|
|
|
15
15
|
// CDNs
|
|
16
|
-
import { Disclosure } from "https://esm.sh/@y14e/disclosure@2.0.
|
|
16
|
+
import { Disclosure } from "https://esm.sh/@y14e/disclosure@2.0.14";
|
|
17
17
|
// or
|
|
18
|
-
import { Disclosure } from "https://cdn.jsdelivr.net/npm/@y14e/disclosure@2.0.
|
|
18
|
+
import { Disclosure } from "https://cdn.jsdelivr.net/npm/@y14e/disclosure@2.0.14/+esm";
|
|
19
19
|
// or
|
|
20
|
-
import { Disclosure } from "https://esm.unpkg.com/@y14e/disclosure@2.0.
|
|
20
|
+
import { Disclosure } from "https://esm.unpkg.com/@y14e/disclosure@2.0.14";
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Usage
|
package/dist/index.bundle.cjs
CHANGED
|
@@ -53,8 +53,10 @@ function isValid(element, name, token) {
|
|
|
53
53
|
console.warn("Invalid element");
|
|
54
54
|
return false;
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
try {
|
|
57
|
+
document.createElement("div").setAttribute(name, "");
|
|
58
|
+
} catch {
|
|
59
|
+
console.warn(`Invalid attribute name: '${name}'`);
|
|
58
60
|
return false;
|
|
59
61
|
}
|
|
60
62
|
if (typeof token !== "string" || !token.trim()) {
|
|
@@ -99,37 +101,13 @@ function getFocusables(container = document.body, options = {}) {
|
|
|
99
101
|
console.warn("Invalid container element. Fallback: <body> element.");
|
|
100
102
|
container = document.body;
|
|
101
103
|
}
|
|
102
|
-
|
|
103
|
-
composed
|
|
104
|
+
const {
|
|
105
|
+
composed,
|
|
104
106
|
filter,
|
|
105
107
|
include,
|
|
106
|
-
skipNegativeTabIndexCheck
|
|
107
|
-
skipVisibilityCheck
|
|
108
|
-
} = options;
|
|
109
|
-
if (typeof composed !== "boolean") {
|
|
110
|
-
console.warn("Invalid composed option. Fallback: false.");
|
|
111
|
-
composed = false;
|
|
112
|
-
}
|
|
113
|
-
if (typeof filter !== "undefined" && typeof filter !== "function") {
|
|
114
|
-
console.warn(
|
|
115
|
-
"Invalid filter function. Fallback: no filter function (undefined)."
|
|
116
|
-
);
|
|
117
|
-
filter = void 0;
|
|
118
|
-
}
|
|
119
|
-
if (typeof include !== "undefined" && typeof include !== "function") {
|
|
120
|
-
console.warn(
|
|
121
|
-
"Invalid include function. Fallback: no include function (undefined)."
|
|
122
|
-
);
|
|
123
|
-
include = void 0;
|
|
124
|
-
}
|
|
125
|
-
if (typeof skipNegativeTabIndexCheck !== "boolean") {
|
|
126
|
-
console.warn("Invalid skipNegativeTabIndexCheck option. Fallback: false.");
|
|
127
|
-
skipNegativeTabIndexCheck = false;
|
|
128
|
-
}
|
|
129
|
-
if (typeof skipVisibilityCheck !== "boolean") {
|
|
130
|
-
console.warn("Invalid skipVisibilityCheck option. Fallback: false.");
|
|
131
|
-
skipVisibilityCheck = false;
|
|
132
|
-
}
|
|
108
|
+
skipNegativeTabIndexCheck,
|
|
109
|
+
skipVisibilityCheck
|
|
110
|
+
} = resolveOptions2(options);
|
|
133
111
|
const candidates = [];
|
|
134
112
|
if (composed || include) {
|
|
135
113
|
let traverse2 = function(node) {
|
|
@@ -173,15 +151,7 @@ function isFocusable(element, options = {}) {
|
|
|
173
151
|
console.warn("Invalid element");
|
|
174
152
|
return false;
|
|
175
153
|
}
|
|
176
|
-
|
|
177
|
-
if (typeof skipNegativeTabIndexCheck !== "boolean") {
|
|
178
|
-
console.warn("Invalid skipNegativeTabIndexCheck option. Fallback: false.");
|
|
179
|
-
skipNegativeTabIndexCheck = false;
|
|
180
|
-
}
|
|
181
|
-
if (typeof skipVisibilityCheck !== "boolean") {
|
|
182
|
-
console.warn("Invalid skipVisibilityCheck option. Fallback: false.");
|
|
183
|
-
skipVisibilityCheck = false;
|
|
184
|
-
}
|
|
154
|
+
const { skipNegativeTabIndexCheck, skipVisibilityCheck } = resolveOptions2(options);
|
|
185
155
|
if (element.hasAttribute("hidden") || isInert(element)) {
|
|
186
156
|
return false;
|
|
187
157
|
}
|
|
@@ -356,6 +326,61 @@ function isInert(element) {
|
|
|
356
326
|
function isUngroupedRadio(element) {
|
|
357
327
|
return element.type === "radio" && !!element.name;
|
|
358
328
|
}
|
|
329
|
+
function resolveOptions2(options) {
|
|
330
|
+
let {
|
|
331
|
+
anchor = getActiveElement(),
|
|
332
|
+
composed = false,
|
|
333
|
+
filter,
|
|
334
|
+
include,
|
|
335
|
+
skipNegativeTabIndexCheck = false,
|
|
336
|
+
skipVisibilityCheck = false,
|
|
337
|
+
wrap = false
|
|
338
|
+
} = options;
|
|
339
|
+
if (!(anchor instanceof Element)) {
|
|
340
|
+
const active = getActiveElement();
|
|
341
|
+
if (active instanceof Element) {
|
|
342
|
+
console.warn("Invalid anchor element. Fallback: active element.");
|
|
343
|
+
anchor = active;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
if (typeof composed !== "boolean") {
|
|
347
|
+
console.warn("Invalid composed option. Fallback: false.");
|
|
348
|
+
composed = false;
|
|
349
|
+
}
|
|
350
|
+
if (filter !== void 0 && typeof filter !== "function") {
|
|
351
|
+
console.warn(
|
|
352
|
+
"Invalid filter function. Fallback: no filter function (undefined)."
|
|
353
|
+
);
|
|
354
|
+
filter = void 0;
|
|
355
|
+
}
|
|
356
|
+
if (include !== void 0 && typeof include !== "function") {
|
|
357
|
+
console.warn(
|
|
358
|
+
"Invalid include function. Fallback: no include function (undefined)."
|
|
359
|
+
);
|
|
360
|
+
include = void 0;
|
|
361
|
+
}
|
|
362
|
+
if (typeof skipNegativeTabIndexCheck !== "boolean") {
|
|
363
|
+
console.warn("Invalid skipNegativeTabIndexCheck option. Fallback: false.");
|
|
364
|
+
skipNegativeTabIndexCheck = false;
|
|
365
|
+
}
|
|
366
|
+
if (typeof skipVisibilityCheck !== "boolean") {
|
|
367
|
+
console.warn("Invalid skipVisibilityCheck option. Fallback: false.");
|
|
368
|
+
skipVisibilityCheck = false;
|
|
369
|
+
}
|
|
370
|
+
if (typeof wrap !== "boolean") {
|
|
371
|
+
console.warn("Invalid wrap option. Fallback: false.");
|
|
372
|
+
wrap = false;
|
|
373
|
+
}
|
|
374
|
+
return {
|
|
375
|
+
anchor,
|
|
376
|
+
composed,
|
|
377
|
+
filter,
|
|
378
|
+
include,
|
|
379
|
+
skipNegativeTabIndexCheck,
|
|
380
|
+
skipVisibilityCheck,
|
|
381
|
+
wrap
|
|
382
|
+
};
|
|
383
|
+
}
|
|
359
384
|
|
|
360
385
|
// node_modules/@y14e/roving-tabindex/dist/index.js
|
|
361
386
|
function createRovingTabIndex(container, options = {}) {
|
|
@@ -378,56 +403,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
378
403
|
#isDestroyed = false;
|
|
379
404
|
constructor(container, options = {}) {
|
|
380
405
|
this.#container = container;
|
|
381
|
-
|
|
382
|
-
direction = "both",
|
|
383
|
-
navigationOnly = false,
|
|
384
|
-
noMemory = false,
|
|
385
|
-
noStart = false,
|
|
386
|
-
selector = "",
|
|
387
|
-
typeahead = false,
|
|
388
|
-
wrap = false
|
|
389
|
-
} = options;
|
|
390
|
-
if (!["both", "horizontal", "vertical"].includes(direction)) {
|
|
391
|
-
console.warn("Invalid direction option. Fallback: 'both'.");
|
|
392
|
-
direction = "both";
|
|
393
|
-
}
|
|
394
|
-
if (typeof navigationOnly !== "boolean") {
|
|
395
|
-
console.warn("Invalid navigationOnly option. Fallback: false.");
|
|
396
|
-
navigationOnly = false;
|
|
397
|
-
}
|
|
398
|
-
if (typeof noMemory !== "boolean") {
|
|
399
|
-
console.warn("Invalid noMemory option. Fallback: false.");
|
|
400
|
-
noMemory = false;
|
|
401
|
-
}
|
|
402
|
-
if (typeof noStart !== "boolean") {
|
|
403
|
-
console.warn("Invalid noStart option. Fallback: false.");
|
|
404
|
-
noStart = false;
|
|
405
|
-
}
|
|
406
|
-
if (selector !== "") {
|
|
407
|
-
try {
|
|
408
|
-
document.querySelector(selector);
|
|
409
|
-
} catch {
|
|
410
|
-
console.warn("Invalid selector. Fallback: no selector string.");
|
|
411
|
-
selector = "";
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
if (typeof typeahead !== "boolean") {
|
|
415
|
-
console.warn("Invalid typeahead option. Fallback: false.");
|
|
416
|
-
typeahead = false;
|
|
417
|
-
}
|
|
418
|
-
if (typeof wrap !== "boolean") {
|
|
419
|
-
console.warn("Invalid wrap option. Fallback: false.");
|
|
420
|
-
wrap = false;
|
|
421
|
-
}
|
|
422
|
-
this.#settings = {
|
|
423
|
-
direction,
|
|
424
|
-
navigationOnly,
|
|
425
|
-
noMemory,
|
|
426
|
-
noStart,
|
|
427
|
-
selector,
|
|
428
|
-
typeahead,
|
|
429
|
-
wrap
|
|
430
|
-
};
|
|
406
|
+
this.#settings = this.#resolveOptions(options);
|
|
431
407
|
this.#selectorFilter = this.#createSelectorFilter();
|
|
432
408
|
this.#initialize();
|
|
433
409
|
}
|
|
@@ -615,6 +591,58 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
615
591
|
skipVisibilityCheck: true
|
|
616
592
|
});
|
|
617
593
|
}
|
|
594
|
+
#resolveOptions(options) {
|
|
595
|
+
let {
|
|
596
|
+
direction = "both",
|
|
597
|
+
navigationOnly = false,
|
|
598
|
+
noMemory = false,
|
|
599
|
+
noStart = false,
|
|
600
|
+
selector = "",
|
|
601
|
+
typeahead = false,
|
|
602
|
+
wrap = false
|
|
603
|
+
} = options;
|
|
604
|
+
if (!["both", "horizontal", "vertical"].includes(direction)) {
|
|
605
|
+
console.warn("Invalid direction option. Fallback: 'both'.");
|
|
606
|
+
direction = "both";
|
|
607
|
+
}
|
|
608
|
+
if (typeof navigationOnly !== "boolean") {
|
|
609
|
+
console.warn("Invalid navigationOnly option. Fallback: false.");
|
|
610
|
+
navigationOnly = false;
|
|
611
|
+
}
|
|
612
|
+
if (typeof noMemory !== "boolean") {
|
|
613
|
+
console.warn("Invalid noMemory option. Fallback: false.");
|
|
614
|
+
noMemory = false;
|
|
615
|
+
}
|
|
616
|
+
if (typeof noStart !== "boolean") {
|
|
617
|
+
console.warn("Invalid noStart option. Fallback: false.");
|
|
618
|
+
noStart = false;
|
|
619
|
+
}
|
|
620
|
+
if (selector !== "") {
|
|
621
|
+
try {
|
|
622
|
+
document.querySelector(selector);
|
|
623
|
+
} catch {
|
|
624
|
+
console.warn("Invalid selector. Fallback: no selector string.");
|
|
625
|
+
selector = "";
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
if (typeof typeahead !== "boolean") {
|
|
629
|
+
console.warn("Invalid typeahead option. Fallback: false.");
|
|
630
|
+
typeahead = false;
|
|
631
|
+
}
|
|
632
|
+
if (typeof wrap !== "boolean") {
|
|
633
|
+
console.warn("Invalid wrap option. Fallback: false.");
|
|
634
|
+
wrap = false;
|
|
635
|
+
}
|
|
636
|
+
return {
|
|
637
|
+
direction,
|
|
638
|
+
navigationOnly,
|
|
639
|
+
noMemory,
|
|
640
|
+
noStart,
|
|
641
|
+
selector,
|
|
642
|
+
typeahead,
|
|
643
|
+
wrap
|
|
644
|
+
};
|
|
645
|
+
}
|
|
618
646
|
};
|
|
619
647
|
|
|
620
648
|
// src/index.ts
|
|
@@ -921,7 +949,7 @@ function waitAnimationFinish(animation) {
|
|
|
921
949
|
* WAI-ARIA compliant disclosure pattern implementation in TypeScript.
|
|
922
950
|
* Using the <details> and <summary> element.
|
|
923
951
|
*
|
|
924
|
-
* @version 2.0.
|
|
952
|
+
* @version 2.0.14
|
|
925
953
|
* @author Yusuke Kamiyamane
|
|
926
954
|
* @license MIT
|
|
927
955
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -933,7 +961,7 @@ function waitAnimationFinish(animation) {
|
|
|
933
961
|
(**
|
|
934
962
|
* Attribute Utils
|
|
935
963
|
*
|
|
936
|
-
* @version 2.0.
|
|
964
|
+
* @version 2.0.8
|
|
937
965
|
* @author Yusuke Kamiyamane
|
|
938
966
|
* @license MIT
|
|
939
967
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -946,7 +974,7 @@ power-focusable/dist/index.js:
|
|
|
946
974
|
* High-precision focus management utility with full composed tree support.
|
|
947
975
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
948
976
|
*
|
|
949
|
-
* @version 4.3.
|
|
977
|
+
* @version 4.3.29
|
|
950
978
|
* @author Yusuke Kamiyamane
|
|
951
979
|
* @license MIT
|
|
952
980
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -959,7 +987,7 @@ power-focusable/dist/index.js:
|
|
|
959
987
|
* Lightweight roving tabindex utility with fully focus management.
|
|
960
988
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
961
989
|
*
|
|
962
|
-
* @version 3.1.
|
|
990
|
+
* @version 3.1.27
|
|
963
991
|
* @author Yusuke Kamiyamane
|
|
964
992
|
* @license MIT
|
|
965
993
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.bundle.js
CHANGED
|
@@ -51,8 +51,10 @@ function isValid(element, name, token) {
|
|
|
51
51
|
console.warn("Invalid element");
|
|
52
52
|
return false;
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
try {
|
|
55
|
+
document.createElement("div").setAttribute(name, "");
|
|
56
|
+
} catch {
|
|
57
|
+
console.warn(`Invalid attribute name: '${name}'`);
|
|
56
58
|
return false;
|
|
57
59
|
}
|
|
58
60
|
if (typeof token !== "string" || !token.trim()) {
|
|
@@ -97,37 +99,13 @@ function getFocusables(container = document.body, options = {}) {
|
|
|
97
99
|
console.warn("Invalid container element. Fallback: <body> element.");
|
|
98
100
|
container = document.body;
|
|
99
101
|
}
|
|
100
|
-
|
|
101
|
-
composed
|
|
102
|
+
const {
|
|
103
|
+
composed,
|
|
102
104
|
filter,
|
|
103
105
|
include,
|
|
104
|
-
skipNegativeTabIndexCheck
|
|
105
|
-
skipVisibilityCheck
|
|
106
|
-
} = options;
|
|
107
|
-
if (typeof composed !== "boolean") {
|
|
108
|
-
console.warn("Invalid composed option. Fallback: false.");
|
|
109
|
-
composed = false;
|
|
110
|
-
}
|
|
111
|
-
if (typeof filter !== "undefined" && typeof filter !== "function") {
|
|
112
|
-
console.warn(
|
|
113
|
-
"Invalid filter function. Fallback: no filter function (undefined)."
|
|
114
|
-
);
|
|
115
|
-
filter = void 0;
|
|
116
|
-
}
|
|
117
|
-
if (typeof include !== "undefined" && typeof include !== "function") {
|
|
118
|
-
console.warn(
|
|
119
|
-
"Invalid include function. Fallback: no include function (undefined)."
|
|
120
|
-
);
|
|
121
|
-
include = void 0;
|
|
122
|
-
}
|
|
123
|
-
if (typeof skipNegativeTabIndexCheck !== "boolean") {
|
|
124
|
-
console.warn("Invalid skipNegativeTabIndexCheck option. Fallback: false.");
|
|
125
|
-
skipNegativeTabIndexCheck = false;
|
|
126
|
-
}
|
|
127
|
-
if (typeof skipVisibilityCheck !== "boolean") {
|
|
128
|
-
console.warn("Invalid skipVisibilityCheck option. Fallback: false.");
|
|
129
|
-
skipVisibilityCheck = false;
|
|
130
|
-
}
|
|
106
|
+
skipNegativeTabIndexCheck,
|
|
107
|
+
skipVisibilityCheck
|
|
108
|
+
} = resolveOptions2(options);
|
|
131
109
|
const candidates = [];
|
|
132
110
|
if (composed || include) {
|
|
133
111
|
let traverse2 = function(node) {
|
|
@@ -171,15 +149,7 @@ function isFocusable(element, options = {}) {
|
|
|
171
149
|
console.warn("Invalid element");
|
|
172
150
|
return false;
|
|
173
151
|
}
|
|
174
|
-
|
|
175
|
-
if (typeof skipNegativeTabIndexCheck !== "boolean") {
|
|
176
|
-
console.warn("Invalid skipNegativeTabIndexCheck option. Fallback: false.");
|
|
177
|
-
skipNegativeTabIndexCheck = false;
|
|
178
|
-
}
|
|
179
|
-
if (typeof skipVisibilityCheck !== "boolean") {
|
|
180
|
-
console.warn("Invalid skipVisibilityCheck option. Fallback: false.");
|
|
181
|
-
skipVisibilityCheck = false;
|
|
182
|
-
}
|
|
152
|
+
const { skipNegativeTabIndexCheck, skipVisibilityCheck } = resolveOptions2(options);
|
|
183
153
|
if (element.hasAttribute("hidden") || isInert(element)) {
|
|
184
154
|
return false;
|
|
185
155
|
}
|
|
@@ -354,6 +324,61 @@ function isInert(element) {
|
|
|
354
324
|
function isUngroupedRadio(element) {
|
|
355
325
|
return element.type === "radio" && !!element.name;
|
|
356
326
|
}
|
|
327
|
+
function resolveOptions2(options) {
|
|
328
|
+
let {
|
|
329
|
+
anchor = getActiveElement(),
|
|
330
|
+
composed = false,
|
|
331
|
+
filter,
|
|
332
|
+
include,
|
|
333
|
+
skipNegativeTabIndexCheck = false,
|
|
334
|
+
skipVisibilityCheck = false,
|
|
335
|
+
wrap = false
|
|
336
|
+
} = options;
|
|
337
|
+
if (!(anchor instanceof Element)) {
|
|
338
|
+
const active = getActiveElement();
|
|
339
|
+
if (active instanceof Element) {
|
|
340
|
+
console.warn("Invalid anchor element. Fallback: active element.");
|
|
341
|
+
anchor = active;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
if (typeof composed !== "boolean") {
|
|
345
|
+
console.warn("Invalid composed option. Fallback: false.");
|
|
346
|
+
composed = false;
|
|
347
|
+
}
|
|
348
|
+
if (filter !== void 0 && typeof filter !== "function") {
|
|
349
|
+
console.warn(
|
|
350
|
+
"Invalid filter function. Fallback: no filter function (undefined)."
|
|
351
|
+
);
|
|
352
|
+
filter = void 0;
|
|
353
|
+
}
|
|
354
|
+
if (include !== void 0 && typeof include !== "function") {
|
|
355
|
+
console.warn(
|
|
356
|
+
"Invalid include function. Fallback: no include function (undefined)."
|
|
357
|
+
);
|
|
358
|
+
include = void 0;
|
|
359
|
+
}
|
|
360
|
+
if (typeof skipNegativeTabIndexCheck !== "boolean") {
|
|
361
|
+
console.warn("Invalid skipNegativeTabIndexCheck option. Fallback: false.");
|
|
362
|
+
skipNegativeTabIndexCheck = false;
|
|
363
|
+
}
|
|
364
|
+
if (typeof skipVisibilityCheck !== "boolean") {
|
|
365
|
+
console.warn("Invalid skipVisibilityCheck option. Fallback: false.");
|
|
366
|
+
skipVisibilityCheck = false;
|
|
367
|
+
}
|
|
368
|
+
if (typeof wrap !== "boolean") {
|
|
369
|
+
console.warn("Invalid wrap option. Fallback: false.");
|
|
370
|
+
wrap = false;
|
|
371
|
+
}
|
|
372
|
+
return {
|
|
373
|
+
anchor,
|
|
374
|
+
composed,
|
|
375
|
+
filter,
|
|
376
|
+
include,
|
|
377
|
+
skipNegativeTabIndexCheck,
|
|
378
|
+
skipVisibilityCheck,
|
|
379
|
+
wrap
|
|
380
|
+
};
|
|
381
|
+
}
|
|
357
382
|
|
|
358
383
|
// node_modules/@y14e/roving-tabindex/dist/index.js
|
|
359
384
|
function createRovingTabIndex(container, options = {}) {
|
|
@@ -376,56 +401,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
376
401
|
#isDestroyed = false;
|
|
377
402
|
constructor(container, options = {}) {
|
|
378
403
|
this.#container = container;
|
|
379
|
-
|
|
380
|
-
direction = "both",
|
|
381
|
-
navigationOnly = false,
|
|
382
|
-
noMemory = false,
|
|
383
|
-
noStart = false,
|
|
384
|
-
selector = "",
|
|
385
|
-
typeahead = false,
|
|
386
|
-
wrap = false
|
|
387
|
-
} = options;
|
|
388
|
-
if (!["both", "horizontal", "vertical"].includes(direction)) {
|
|
389
|
-
console.warn("Invalid direction option. Fallback: 'both'.");
|
|
390
|
-
direction = "both";
|
|
391
|
-
}
|
|
392
|
-
if (typeof navigationOnly !== "boolean") {
|
|
393
|
-
console.warn("Invalid navigationOnly option. Fallback: false.");
|
|
394
|
-
navigationOnly = false;
|
|
395
|
-
}
|
|
396
|
-
if (typeof noMemory !== "boolean") {
|
|
397
|
-
console.warn("Invalid noMemory option. Fallback: false.");
|
|
398
|
-
noMemory = false;
|
|
399
|
-
}
|
|
400
|
-
if (typeof noStart !== "boolean") {
|
|
401
|
-
console.warn("Invalid noStart option. Fallback: false.");
|
|
402
|
-
noStart = false;
|
|
403
|
-
}
|
|
404
|
-
if (selector !== "") {
|
|
405
|
-
try {
|
|
406
|
-
document.querySelector(selector);
|
|
407
|
-
} catch {
|
|
408
|
-
console.warn("Invalid selector. Fallback: no selector string.");
|
|
409
|
-
selector = "";
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
if (typeof typeahead !== "boolean") {
|
|
413
|
-
console.warn("Invalid typeahead option. Fallback: false.");
|
|
414
|
-
typeahead = false;
|
|
415
|
-
}
|
|
416
|
-
if (typeof wrap !== "boolean") {
|
|
417
|
-
console.warn("Invalid wrap option. Fallback: false.");
|
|
418
|
-
wrap = false;
|
|
419
|
-
}
|
|
420
|
-
this.#settings = {
|
|
421
|
-
direction,
|
|
422
|
-
navigationOnly,
|
|
423
|
-
noMemory,
|
|
424
|
-
noStart,
|
|
425
|
-
selector,
|
|
426
|
-
typeahead,
|
|
427
|
-
wrap
|
|
428
|
-
};
|
|
404
|
+
this.#settings = this.#resolveOptions(options);
|
|
429
405
|
this.#selectorFilter = this.#createSelectorFilter();
|
|
430
406
|
this.#initialize();
|
|
431
407
|
}
|
|
@@ -613,6 +589,58 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
613
589
|
skipVisibilityCheck: true
|
|
614
590
|
});
|
|
615
591
|
}
|
|
592
|
+
#resolveOptions(options) {
|
|
593
|
+
let {
|
|
594
|
+
direction = "both",
|
|
595
|
+
navigationOnly = false,
|
|
596
|
+
noMemory = false,
|
|
597
|
+
noStart = false,
|
|
598
|
+
selector = "",
|
|
599
|
+
typeahead = false,
|
|
600
|
+
wrap = false
|
|
601
|
+
} = options;
|
|
602
|
+
if (!["both", "horizontal", "vertical"].includes(direction)) {
|
|
603
|
+
console.warn("Invalid direction option. Fallback: 'both'.");
|
|
604
|
+
direction = "both";
|
|
605
|
+
}
|
|
606
|
+
if (typeof navigationOnly !== "boolean") {
|
|
607
|
+
console.warn("Invalid navigationOnly option. Fallback: false.");
|
|
608
|
+
navigationOnly = false;
|
|
609
|
+
}
|
|
610
|
+
if (typeof noMemory !== "boolean") {
|
|
611
|
+
console.warn("Invalid noMemory option. Fallback: false.");
|
|
612
|
+
noMemory = false;
|
|
613
|
+
}
|
|
614
|
+
if (typeof noStart !== "boolean") {
|
|
615
|
+
console.warn("Invalid noStart option. Fallback: false.");
|
|
616
|
+
noStart = false;
|
|
617
|
+
}
|
|
618
|
+
if (selector !== "") {
|
|
619
|
+
try {
|
|
620
|
+
document.querySelector(selector);
|
|
621
|
+
} catch {
|
|
622
|
+
console.warn("Invalid selector. Fallback: no selector string.");
|
|
623
|
+
selector = "";
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
if (typeof typeahead !== "boolean") {
|
|
627
|
+
console.warn("Invalid typeahead option. Fallback: false.");
|
|
628
|
+
typeahead = false;
|
|
629
|
+
}
|
|
630
|
+
if (typeof wrap !== "boolean") {
|
|
631
|
+
console.warn("Invalid wrap option. Fallback: false.");
|
|
632
|
+
wrap = false;
|
|
633
|
+
}
|
|
634
|
+
return {
|
|
635
|
+
direction,
|
|
636
|
+
navigationOnly,
|
|
637
|
+
noMemory,
|
|
638
|
+
noStart,
|
|
639
|
+
selector,
|
|
640
|
+
typeahead,
|
|
641
|
+
wrap
|
|
642
|
+
};
|
|
643
|
+
}
|
|
616
644
|
};
|
|
617
645
|
|
|
618
646
|
// src/index.ts
|
|
@@ -919,7 +947,7 @@ function waitAnimationFinish(animation) {
|
|
|
919
947
|
* WAI-ARIA compliant disclosure pattern implementation in TypeScript.
|
|
920
948
|
* Using the <details> and <summary> element.
|
|
921
949
|
*
|
|
922
|
-
* @version 2.0.
|
|
950
|
+
* @version 2.0.14
|
|
923
951
|
* @author Yusuke Kamiyamane
|
|
924
952
|
* @license MIT
|
|
925
953
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -931,7 +959,7 @@ function waitAnimationFinish(animation) {
|
|
|
931
959
|
(**
|
|
932
960
|
* Attribute Utils
|
|
933
961
|
*
|
|
934
|
-
* @version 2.0.
|
|
962
|
+
* @version 2.0.8
|
|
935
963
|
* @author Yusuke Kamiyamane
|
|
936
964
|
* @license MIT
|
|
937
965
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -944,7 +972,7 @@ power-focusable/dist/index.js:
|
|
|
944
972
|
* High-precision focus management utility with full composed tree support.
|
|
945
973
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
946
974
|
*
|
|
947
|
-
* @version 4.3.
|
|
975
|
+
* @version 4.3.29
|
|
948
976
|
* @author Yusuke Kamiyamane
|
|
949
977
|
* @license MIT
|
|
950
978
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -957,7 +985,7 @@ power-focusable/dist/index.js:
|
|
|
957
985
|
* Lightweight roving tabindex utility with fully focus management.
|
|
958
986
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
959
987
|
*
|
|
960
|
-
* @version 3.1.
|
|
988
|
+
* @version 3.1.27
|
|
961
989
|
* @author Yusuke Kamiyamane
|
|
962
990
|
* @license MIT
|
|
963
991
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.cjs
CHANGED
|
@@ -327,7 +327,7 @@ function waitAnimationFinish(animation) {
|
|
|
327
327
|
* WAI-ARIA compliant disclosure pattern implementation in TypeScript.
|
|
328
328
|
* Using the <details> and <summary> element.
|
|
329
329
|
*
|
|
330
|
-
* @version 2.0.
|
|
330
|
+
* @version 2.0.14
|
|
331
331
|
* @author Yusuke Kamiyamane
|
|
332
332
|
* @license MIT
|
|
333
333
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -305,7 +305,7 @@ function waitAnimationFinish(animation) {
|
|
|
305
305
|
* WAI-ARIA compliant disclosure pattern implementation in TypeScript.
|
|
306
306
|
* Using the <details> and <summary> element.
|
|
307
307
|
*
|
|
308
|
-
* @version 2.0.
|
|
308
|
+
* @version 2.0.14
|
|
309
309
|
* @author Yusuke Kamiyamane
|
|
310
310
|
* @license MIT
|
|
311
311
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@y14e/disclosure",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.14",
|
|
4
4
|
"description": "WAI-ARIA compliant disclosure pattern implementation in TypeScript",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"esbuild": true
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@y14e/attribute-utils": "^2.0.
|
|
58
|
-
"@y14e/roving-tabindex": "^3.1.
|
|
57
|
+
"@y14e/attribute-utils": "^2.0.8",
|
|
58
|
+
"@y14e/roving-tabindex": "^3.1.27"
|
|
59
59
|
}
|
|
60
60
|
}
|