@y14e/disclosure-css 2.0.9 → 2.0.10
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-css
|
|
|
13
13
|
import { Disclosure } from "@y14e/disclosure-css";
|
|
14
14
|
|
|
15
15
|
// CDNs
|
|
16
|
-
import { Disclosure } from "https://esm.sh/@y14e/disclosure-css@2.0.
|
|
16
|
+
import { Disclosure } from "https://esm.sh/@y14e/disclosure-css@2.0.10";
|
|
17
17
|
// or
|
|
18
|
-
import { Disclosure } from "https://cdn.jsdelivr.net/npm/@y14e/disclosure-css@2.0.
|
|
18
|
+
import { Disclosure } from "https://cdn.jsdelivr.net/npm/@y14e/disclosure-css@2.0.10/+esm";
|
|
19
19
|
// or
|
|
20
|
-
import { Disclosure } from "https://esm.unpkg.com/@y14e/disclosure-css@2.0.
|
|
20
|
+
import { Disclosure } from "https://esm.unpkg.com/@y14e/disclosure-css@2.0.10";
|
|
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
|
|
@@ -784,7 +812,7 @@ var Disclosure = class _Disclosure {
|
|
|
784
812
|
* WAI-ARIA compliant disclosure pattern implementation in TypeScript.
|
|
785
813
|
* Using the <details> and <summary> element.
|
|
786
814
|
*
|
|
787
|
-
* @version 2.0.
|
|
815
|
+
* @version 2.0.10
|
|
788
816
|
* @author Yusuke Kamiyamane
|
|
789
817
|
* @license MIT
|
|
790
818
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -796,7 +824,7 @@ var Disclosure = class _Disclosure {
|
|
|
796
824
|
(**
|
|
797
825
|
* Attribute Utils
|
|
798
826
|
*
|
|
799
|
-
* @version 2.0.
|
|
827
|
+
* @version 2.0.8
|
|
800
828
|
* @author Yusuke Kamiyamane
|
|
801
829
|
* @license MIT
|
|
802
830
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -809,7 +837,7 @@ power-focusable/dist/index.js:
|
|
|
809
837
|
* High-precision focus management utility with full composed tree support.
|
|
810
838
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
811
839
|
*
|
|
812
|
-
* @version 4.3.
|
|
840
|
+
* @version 4.3.29
|
|
813
841
|
* @author Yusuke Kamiyamane
|
|
814
842
|
* @license MIT
|
|
815
843
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -822,7 +850,7 @@ power-focusable/dist/index.js:
|
|
|
822
850
|
* Lightweight roving tabindex utility with fully focus management.
|
|
823
851
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
824
852
|
*
|
|
825
|
-
* @version 3.1.
|
|
853
|
+
* @version 3.1.27
|
|
826
854
|
* @author Yusuke Kamiyamane
|
|
827
855
|
* @license MIT
|
|
828
856
|
* @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
|
|
@@ -782,7 +810,7 @@ var Disclosure = class _Disclosure {
|
|
|
782
810
|
* WAI-ARIA compliant disclosure pattern implementation in TypeScript.
|
|
783
811
|
* Using the <details> and <summary> element.
|
|
784
812
|
*
|
|
785
|
-
* @version 2.0.
|
|
813
|
+
* @version 2.0.10
|
|
786
814
|
* @author Yusuke Kamiyamane
|
|
787
815
|
* @license MIT
|
|
788
816
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -794,7 +822,7 @@ var Disclosure = class _Disclosure {
|
|
|
794
822
|
(**
|
|
795
823
|
* Attribute Utils
|
|
796
824
|
*
|
|
797
|
-
* @version 2.0.
|
|
825
|
+
* @version 2.0.8
|
|
798
826
|
* @author Yusuke Kamiyamane
|
|
799
827
|
* @license MIT
|
|
800
828
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -807,7 +835,7 @@ power-focusable/dist/index.js:
|
|
|
807
835
|
* High-precision focus management utility with full composed tree support.
|
|
808
836
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
809
837
|
*
|
|
810
|
-
* @version 4.3.
|
|
838
|
+
* @version 4.3.29
|
|
811
839
|
* @author Yusuke Kamiyamane
|
|
812
840
|
* @license MIT
|
|
813
841
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -820,7 +848,7 @@ power-focusable/dist/index.js:
|
|
|
820
848
|
* Lightweight roving tabindex utility with fully focus management.
|
|
821
849
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
822
850
|
*
|
|
823
|
-
* @version 3.1.
|
|
851
|
+
* @version 3.1.27
|
|
824
852
|
* @author Yusuke Kamiyamane
|
|
825
853
|
* @license MIT
|
|
826
854
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.cjs
CHANGED
|
@@ -190,7 +190,7 @@ var Disclosure = class _Disclosure {
|
|
|
190
190
|
* WAI-ARIA compliant disclosure pattern implementation in TypeScript.
|
|
191
191
|
* Using the <details> and <summary> element.
|
|
192
192
|
*
|
|
193
|
-
* @version 2.0.
|
|
193
|
+
* @version 2.0.10
|
|
194
194
|
* @author Yusuke Kamiyamane
|
|
195
195
|
* @license MIT
|
|
196
196
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -168,7 +168,7 @@ var Disclosure = class _Disclosure {
|
|
|
168
168
|
* WAI-ARIA compliant disclosure pattern implementation in TypeScript.
|
|
169
169
|
* Using the <details> and <summary> element.
|
|
170
170
|
*
|
|
171
|
-
* @version 2.0.
|
|
171
|
+
* @version 2.0.10
|
|
172
172
|
* @author Yusuke Kamiyamane
|
|
173
173
|
* @license MIT
|
|
174
174
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@y14e/disclosure-css",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.10",
|
|
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
|
}
|