@y14e/tabs 2.0.7 → 2.0.8
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 +132 -80
- package/dist/index.bundle.js +132 -80
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -13,11 +13,11 @@ npm i @y14e/tabs
|
|
|
13
13
|
import Tabs from '@y14e/tabs';
|
|
14
14
|
|
|
15
15
|
// CDNs
|
|
16
|
-
import Tabs from 'https://esm.sh/@y14e/tabs@2.0.
|
|
16
|
+
import Tabs from 'https://esm.sh/@y14e/tabs@2.0.8';
|
|
17
17
|
// or
|
|
18
|
-
import Tabs from 'https://cdn.jsdelivr.net/npm/@y14e/tabs@2.0.
|
|
18
|
+
import Tabs from 'https://cdn.jsdelivr.net/npm/@y14e/tabs@2.0.8/+esm';
|
|
19
19
|
// or
|
|
20
|
-
import Tabs from 'https://esm.unpkg.com/@y14e/tabs@2.0.
|
|
20
|
+
import Tabs from 'https://esm.unpkg.com/@y14e/tabs@2.0.8';
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Usage
|
package/dist/index.bundle.cjs
CHANGED
|
@@ -24,8 +24,8 @@ function addTokenToAttribute(element, attribute, token, options = {}) {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
var snapshots = /* @__PURE__ */ new WeakMap();
|
|
27
|
-
function restoreAttributes(
|
|
28
|
-
for (const element of
|
|
27
|
+
function restoreAttributes(element_or_elements) {
|
|
28
|
+
for (const element of Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]) {
|
|
29
29
|
const snapshot = snapshots.get(element);
|
|
30
30
|
if (!snapshot) {
|
|
31
31
|
continue;
|
|
@@ -36,8 +36,9 @@ function restoreAttributes(elements) {
|
|
|
36
36
|
snapshots.delete(element);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
function saveAttributes(
|
|
40
|
-
|
|
39
|
+
function saveAttributes(element_or_elements, attribute_or_attributes) {
|
|
40
|
+
const attributes = Array.isArray(attribute_or_attributes) ? attribute_or_attributes : [attribute_or_attributes];
|
|
41
|
+
(Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]).forEach((element) => {
|
|
41
42
|
let snapshot = snapshots.get(element);
|
|
42
43
|
if (!snapshot) {
|
|
43
44
|
snapshot = /* @__PURE__ */ new Map();
|
|
@@ -51,6 +52,10 @@ function saveAttributes(elements, attributes) {
|
|
|
51
52
|
|
|
52
53
|
// node_modules/power-focusable/dist/index.js
|
|
53
54
|
var FOCUSABLE_SELECTOR = `:is(a[href], area[href], button, embed, iframe, input:not([type="hidden" i]), object, select, details > summary:first-of-type, textarea, [contenteditable]:not([contenteditable="false" i]), [controls], [tabindex]):not(:disabled, [hidden], [inert], [tabindex="-1"])`;
|
|
55
|
+
var FOCUSABLE_SELECTOR_WITH_NEGATIVE_TABINDEX = FOCUSABLE_SELECTOR.replace(
|
|
56
|
+
/(,\s*)?\[tabindex="-1"\]/g,
|
|
57
|
+
""
|
|
58
|
+
);
|
|
54
59
|
function getFocusables(container = document.body, options = {}) {
|
|
55
60
|
if (!(container instanceof Element)) {
|
|
56
61
|
console.warn("Invalid container element. Fallback: <body> element.");
|
|
@@ -87,36 +92,43 @@ function getFocusables(container = document.body, options = {}) {
|
|
|
87
92
|
console.warn("Invalid skipVisibilityCheck option. Fallback: false.");
|
|
88
93
|
skipVisibilityCheck = false;
|
|
89
94
|
}
|
|
90
|
-
const
|
|
95
|
+
const candidates = [];
|
|
91
96
|
if (composed || include) {
|
|
92
97
|
let traverse2 = function(node) {
|
|
93
|
-
if (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
if (isFocusable(node, {
|
|
99
|
+
skipNegativeTabIndexCheck,
|
|
100
|
+
skipVisibilityCheck
|
|
101
|
+
}) || include?.(node)) {
|
|
102
|
+
candidates[candidates.length] = node;
|
|
98
103
|
}
|
|
99
|
-
const
|
|
100
|
-
for (let i = 0, l =
|
|
101
|
-
const child =
|
|
104
|
+
const children2 = composed ? getComposedChildren(node) : getChildren(node);
|
|
105
|
+
for (let i = 0, l = children2.length; i < l; i++) {
|
|
106
|
+
const child = children2[i];
|
|
102
107
|
child && traverse2(child);
|
|
103
108
|
}
|
|
104
109
|
};
|
|
105
|
-
|
|
110
|
+
const children = composed ? getComposedChildren(container) : getChildren(container);
|
|
111
|
+
for (let i = 0, l = children.length; i < l; i++) {
|
|
112
|
+
const child = children[i];
|
|
113
|
+
child && traverse2(child);
|
|
114
|
+
}
|
|
106
115
|
} else {
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
116
|
+
const matches = container.querySelectorAll(
|
|
117
|
+
skipNegativeTabIndexCheck ? FOCUSABLE_SELECTOR_WITH_NEGATIVE_TABINDEX : FOCUSABLE_SELECTOR
|
|
118
|
+
);
|
|
119
|
+
for (let i = 0, l = matches.length; i < l; i++) {
|
|
120
|
+
const matched = matches[i];
|
|
121
|
+
if (matched && isFocusable(matched, {
|
|
111
122
|
skipNegativeTabIndexCheck,
|
|
112
123
|
skipVisibilityCheck
|
|
113
124
|
})) {
|
|
114
|
-
|
|
125
|
+
candidates[candidates.length] = matched;
|
|
115
126
|
}
|
|
116
127
|
}
|
|
117
128
|
}
|
|
118
|
-
|
|
119
|
-
|
|
129
|
+
return normalizeRadioGroup(
|
|
130
|
+
sortByTabIndex(filter ? candidates.filter(filter) : candidates)
|
|
131
|
+
);
|
|
120
132
|
}
|
|
121
133
|
function isFocusable(element, options = {}) {
|
|
122
134
|
if (!(element instanceof Element)) {
|
|
@@ -139,7 +151,7 @@ function isFocusable(element, options = {}) {
|
|
|
139
151
|
return false;
|
|
140
152
|
}
|
|
141
153
|
if (!element.matches(
|
|
142
|
-
skipNegativeTabIndexCheck ?
|
|
154
|
+
skipNegativeTabIndexCheck ? FOCUSABLE_SELECTOR_WITH_NEGATIVE_TABINDEX : FOCUSABLE_SELECTOR
|
|
143
155
|
)) {
|
|
144
156
|
return false;
|
|
145
157
|
}
|
|
@@ -197,22 +209,42 @@ function normalizeRadioGroup(elements) {
|
|
|
197
209
|
if (!map) {
|
|
198
210
|
map = /* @__PURE__ */ new Map();
|
|
199
211
|
}
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
if (
|
|
203
|
-
|
|
212
|
+
const root = element.getRootNode();
|
|
213
|
+
let value = map.get(root);
|
|
214
|
+
if (!value) {
|
|
215
|
+
value = /* @__PURE__ */ new Map();
|
|
216
|
+
map.set(root, value);
|
|
217
|
+
}
|
|
218
|
+
let v = value.get(element.form);
|
|
219
|
+
if (!v) {
|
|
220
|
+
v = /* @__PURE__ */ new Map();
|
|
221
|
+
value.set(element.form, v);
|
|
222
|
+
}
|
|
223
|
+
let vv = v.get(element.name);
|
|
224
|
+
if (!vv) {
|
|
225
|
+
vv = [];
|
|
226
|
+
v.set(element.name, vv);
|
|
204
227
|
}
|
|
228
|
+
vv[vv.length] = element;
|
|
205
229
|
}
|
|
206
230
|
if (!map) {
|
|
207
231
|
return elements;
|
|
208
232
|
}
|
|
209
233
|
const placeholder = /* @__PURE__ */ new Set();
|
|
210
|
-
for (const
|
|
211
|
-
|
|
234
|
+
for (const value of map.values()) {
|
|
235
|
+
for (const v of value.values()) {
|
|
236
|
+
for (const vv of v.values()) {
|
|
237
|
+
const radio = vv.find((element) => element.checked) ?? vv[0];
|
|
238
|
+
radio && placeholder.add(radio);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
212
241
|
}
|
|
213
|
-
return elements.filter(
|
|
214
|
-
|
|
215
|
-
|
|
242
|
+
return elements.filter((element) => {
|
|
243
|
+
if (!(element instanceof HTMLInputElement)) {
|
|
244
|
+
return true;
|
|
245
|
+
}
|
|
246
|
+
return !isUngroupedRadio(element) || placeholder.has(element);
|
|
247
|
+
});
|
|
216
248
|
}
|
|
217
249
|
function sortByTabIndex(elements) {
|
|
218
250
|
const ordered = [];
|
|
@@ -284,7 +316,7 @@ function isInert(element) {
|
|
|
284
316
|
return "inert" in element && !!element.inert;
|
|
285
317
|
}
|
|
286
318
|
function isUngroupedRadio(element) {
|
|
287
|
-
return element
|
|
319
|
+
return element.type === "radio" && !!element.name;
|
|
288
320
|
}
|
|
289
321
|
|
|
290
322
|
// node_modules/@y14e/button/dist/index.js
|
|
@@ -343,14 +375,8 @@ function createRovingTabIndex(container, options = {}) {
|
|
|
343
375
|
return () => {
|
|
344
376
|
};
|
|
345
377
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
return () => roving.destroy();
|
|
349
|
-
} catch (error) {
|
|
350
|
-
error instanceof Error && console.warn(error.message || error);
|
|
351
|
-
return () => {
|
|
352
|
-
};
|
|
353
|
-
}
|
|
378
|
+
const roving = new RovingTabIndex(container, options);
|
|
379
|
+
return () => roving.destroy();
|
|
354
380
|
}
|
|
355
381
|
var RovingTabIndex = class _RovingTabIndex {
|
|
356
382
|
static #initialized = /* @__PURE__ */ new Set();
|
|
@@ -364,17 +390,17 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
364
390
|
constructor(container, options = {}) {
|
|
365
391
|
this.#container = container;
|
|
366
392
|
let {
|
|
367
|
-
direction,
|
|
393
|
+
direction = "both",
|
|
368
394
|
navigationOnly = false,
|
|
369
395
|
noMemory = false,
|
|
370
396
|
noStart = false,
|
|
371
|
-
selector,
|
|
397
|
+
selector = "",
|
|
372
398
|
typeahead = false,
|
|
373
399
|
wrap = false
|
|
374
400
|
} = options;
|
|
375
|
-
if (
|
|
376
|
-
console.warn("Invalid direction option. Fallback: both
|
|
377
|
-
direction =
|
|
401
|
+
if (!["both", "horizontal", "vertical"].includes(direction)) {
|
|
402
|
+
console.warn("Invalid direction option. Fallback: 'both'.");
|
|
403
|
+
direction = "both";
|
|
378
404
|
}
|
|
379
405
|
if (typeof navigationOnly !== "boolean") {
|
|
380
406
|
console.warn("Invalid navigationOnly option. Fallback: false.");
|
|
@@ -388,11 +414,18 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
388
414
|
console.warn("Invalid noStart option. Fallback: false.");
|
|
389
415
|
noStart = false;
|
|
390
416
|
}
|
|
391
|
-
if (
|
|
392
|
-
|
|
393
|
-
"Invalid selector. Fallback:
|
|
394
|
-
|
|
395
|
-
|
|
417
|
+
if (selector !== "") {
|
|
418
|
+
if (typeof selector !== "string" || !selector.trim()) {
|
|
419
|
+
console.warn("Invalid selector. Fallback: no selector string.");
|
|
420
|
+
selector = "";
|
|
421
|
+
} else {
|
|
422
|
+
try {
|
|
423
|
+
container.querySelector(selector);
|
|
424
|
+
} catch {
|
|
425
|
+
console.warn("Invalid selector. Fallback: no selector string.");
|
|
426
|
+
selector = "";
|
|
427
|
+
}
|
|
428
|
+
}
|
|
396
429
|
}
|
|
397
430
|
if (typeof typeahead !== "boolean") {
|
|
398
431
|
console.warn("Invalid typeahead option. Fallback: false.");
|
|
@@ -402,9 +435,15 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
402
435
|
console.warn("Invalid wrap option. Fallback: false.");
|
|
403
436
|
wrap = false;
|
|
404
437
|
}
|
|
405
|
-
this.#settings = {
|
|
406
|
-
|
|
407
|
-
|
|
438
|
+
this.#settings = {
|
|
439
|
+
direction,
|
|
440
|
+
navigationOnly,
|
|
441
|
+
noMemory,
|
|
442
|
+
noStart,
|
|
443
|
+
selector,
|
|
444
|
+
typeahead,
|
|
445
|
+
wrap
|
|
446
|
+
};
|
|
408
447
|
this.#selectorFilter = this.#createSelectorFilter();
|
|
409
448
|
this.#initialize();
|
|
410
449
|
}
|
|
@@ -415,7 +454,10 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
415
454
|
this.#isDestroyed = true;
|
|
416
455
|
this.#controller?.abort();
|
|
417
456
|
this.#controller = null;
|
|
418
|
-
|
|
457
|
+
this.#focusables.forEach((focusable) => {
|
|
458
|
+
_RovingTabIndex.#initialized.delete(focusable);
|
|
459
|
+
restoreAttributes(focusable);
|
|
460
|
+
});
|
|
419
461
|
this.#focusables.clear();
|
|
420
462
|
this.#focusablesByFirstChar.clear();
|
|
421
463
|
}
|
|
@@ -452,7 +494,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
452
494
|
return;
|
|
453
495
|
}
|
|
454
496
|
const { direction, typeahead, wrap } = this.#settings;
|
|
455
|
-
const isBoth =
|
|
497
|
+
const isBoth = direction === "both";
|
|
456
498
|
const isHorizontal = direction === "horizontal";
|
|
457
499
|
if (![
|
|
458
500
|
"End",
|
|
@@ -468,14 +510,16 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
468
510
|
if (!(active instanceof Element)) {
|
|
469
511
|
return;
|
|
470
512
|
}
|
|
471
|
-
const
|
|
472
|
-
|
|
513
|
+
const candidates = this.#getFocusables().filter(
|
|
514
|
+
(focusable2) => this.#focusables.has(focusable2)
|
|
515
|
+
);
|
|
516
|
+
if (!candidates.includes(active)) {
|
|
473
517
|
return;
|
|
474
518
|
}
|
|
475
519
|
event.preventDefault();
|
|
476
|
-
const
|
|
520
|
+
const activeIndex = candidates.indexOf(active);
|
|
477
521
|
let newIndex;
|
|
478
|
-
let target =
|
|
522
|
+
let target = candidates;
|
|
479
523
|
switch (key) {
|
|
480
524
|
case "End":
|
|
481
525
|
newIndex = -1;
|
|
@@ -485,22 +529,26 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
485
529
|
break;
|
|
486
530
|
case "ArrowLeft":
|
|
487
531
|
case "ArrowUp": {
|
|
488
|
-
const rawIndex =
|
|
532
|
+
const rawIndex = activeIndex - 1;
|
|
489
533
|
newIndex = wrap ? rawIndex : Math.max(rawIndex, 0);
|
|
490
534
|
break;
|
|
491
535
|
}
|
|
492
536
|
case "ArrowRight":
|
|
493
537
|
case "ArrowDown": {
|
|
494
|
-
const rawIndex =
|
|
495
|
-
|
|
538
|
+
const rawIndex = activeIndex + 1;
|
|
539
|
+
const length = target.length;
|
|
540
|
+
newIndex = wrap ? rawIndex % length : Math.min(rawIndex, length - 1);
|
|
496
541
|
break;
|
|
497
542
|
}
|
|
498
543
|
default: {
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
(focusable2) => current.indexOf(focusable2) > currentIndex
|
|
544
|
+
const focusables = new Set(
|
|
545
|
+
this.#focusablesByFirstChar.get(key.toUpperCase()) ?? []
|
|
502
546
|
);
|
|
503
|
-
|
|
547
|
+
target = candidates.filter((focusable2) => focusables.has(focusable2));
|
|
548
|
+
const afterIndex = target.findIndex(
|
|
549
|
+
(focusable2) => candidates.indexOf(focusable2) > activeIndex
|
|
550
|
+
);
|
|
551
|
+
newIndex = afterIndex >= 0 ? afterIndex : 0;
|
|
504
552
|
}
|
|
505
553
|
}
|
|
506
554
|
const focusable = target.at(newIndex);
|
|
@@ -510,12 +558,16 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
510
558
|
const current = new Set(this.#getFocusables());
|
|
511
559
|
for (const focusable of this.#focusables) {
|
|
512
560
|
if (!current.has(focusable)) {
|
|
513
|
-
|
|
561
|
+
_RovingTabIndex.#initialized.delete(focusable);
|
|
562
|
+
restoreAttributes(focusable);
|
|
514
563
|
this.#focusables.delete(focusable);
|
|
515
|
-
this.#focusablesByFirstChar
|
|
564
|
+
for (const [key, focusables] of this.#focusablesByFirstChar) {
|
|
516
565
|
const index = focusables.indexOf(focusable);
|
|
517
|
-
index >= 0
|
|
518
|
-
|
|
566
|
+
if (index >= 0) {
|
|
567
|
+
focusables.splice(index, 1);
|
|
568
|
+
!focusables.length && this.#focusablesByFirstChar.delete(key);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
519
571
|
}
|
|
520
572
|
}
|
|
521
573
|
const { navigationOnly, noStart, typeahead } = this.#settings;
|
|
@@ -524,12 +576,12 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
524
576
|
continue;
|
|
525
577
|
}
|
|
526
578
|
if (_RovingTabIndex.#initialized.has(focusable)) {
|
|
527
|
-
|
|
579
|
+
continue;
|
|
528
580
|
}
|
|
529
581
|
this.#focusables.add(focusable);
|
|
530
582
|
_RovingTabIndex.#initialized.add(focusable);
|
|
531
583
|
if (!navigationOnly) {
|
|
532
|
-
saveAttributes(
|
|
584
|
+
saveAttributes(focusable, "tabindex");
|
|
533
585
|
focusable.setAttribute("tabindex", "-1");
|
|
534
586
|
}
|
|
535
587
|
if (!typeahead) {
|
|
@@ -542,7 +594,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
542
594
|
);
|
|
543
595
|
if (char) {
|
|
544
596
|
keys.add(char);
|
|
545
|
-
saveAttributes(
|
|
597
|
+
saveAttributes(focusable, "aria-keyshortcuts");
|
|
546
598
|
addTokenToAttribute(focusable, "aria-keyshortcuts", char, {
|
|
547
599
|
caseInsensitive: true
|
|
548
600
|
});
|
|
@@ -856,7 +908,7 @@ var Tabs = class _Tabs {
|
|
|
856
908
|
...this.#indicatorElements,
|
|
857
909
|
...this.#panelElements
|
|
858
910
|
]);
|
|
859
|
-
this.#contentElement && restoreAttributes(
|
|
911
|
+
this.#contentElement && restoreAttributes(this.#contentElement);
|
|
860
912
|
this.#listElements.length = 0;
|
|
861
913
|
this.#tabElements.length = 0;
|
|
862
914
|
this.#contentElement = null;
|
|
@@ -877,8 +929,8 @@ var Tabs = class _Tabs {
|
|
|
877
929
|
"style",
|
|
878
930
|
"tabindex"
|
|
879
931
|
]);
|
|
880
|
-
saveAttributes(this.#indicatorElements,
|
|
881
|
-
this.#contentElement && saveAttributes(
|
|
932
|
+
saveAttributes(this.#indicatorElements, "style");
|
|
933
|
+
this.#contentElement && saveAttributes(this.#contentElement, "style");
|
|
882
934
|
saveAttributes(this.#panelElements, [
|
|
883
935
|
"aria-controls",
|
|
884
936
|
"aria-labelledby",
|
|
@@ -1098,7 +1150,7 @@ var TabsIndicator = class {
|
|
|
1098
1150
|
* Tabs
|
|
1099
1151
|
* WAI-ARIA compliant tabs pattern implementation in TypeScript.
|
|
1100
1152
|
*
|
|
1101
|
-
* @version 2.0.
|
|
1153
|
+
* @version 2.0.8
|
|
1102
1154
|
* @author Yusuke Kamiyamane
|
|
1103
1155
|
* @license MIT
|
|
1104
1156
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -1110,7 +1162,7 @@ var TabsIndicator = class {
|
|
|
1110
1162
|
(**
|
|
1111
1163
|
* Attributes Utils
|
|
1112
1164
|
*
|
|
1113
|
-
* @version 1.1.
|
|
1165
|
+
* @version 1.1.4
|
|
1114
1166
|
* @author Yusuke Kamiyamane
|
|
1115
1167
|
* @license MIT
|
|
1116
1168
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -1123,7 +1175,7 @@ power-focusable/dist/index.js:
|
|
|
1123
1175
|
* High-precision focus management utility with full composed tree support.
|
|
1124
1176
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
1125
1177
|
*
|
|
1126
|
-
* @version 4.3.
|
|
1178
|
+
* @version 4.3.21
|
|
1127
1179
|
* @author Yusuke Kamiyamane
|
|
1128
1180
|
* @license MIT
|
|
1129
1181
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -1147,7 +1199,7 @@ power-focusable/dist/index.js:
|
|
|
1147
1199
|
* Lightweight roving tabindex utility with fully focus management.
|
|
1148
1200
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
1149
1201
|
*
|
|
1150
|
-
* @version 3.1.
|
|
1202
|
+
* @version 3.1.18
|
|
1151
1203
|
* @author Yusuke Kamiyamane
|
|
1152
1204
|
* @license MIT
|
|
1153
1205
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.bundle.js
CHANGED
|
@@ -22,8 +22,8 @@ function addTokenToAttribute(element, attribute, token, options = {}) {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
var snapshots = /* @__PURE__ */ new WeakMap();
|
|
25
|
-
function restoreAttributes(
|
|
26
|
-
for (const element of
|
|
25
|
+
function restoreAttributes(element_or_elements) {
|
|
26
|
+
for (const element of Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]) {
|
|
27
27
|
const snapshot = snapshots.get(element);
|
|
28
28
|
if (!snapshot) {
|
|
29
29
|
continue;
|
|
@@ -34,8 +34,9 @@ function restoreAttributes(elements) {
|
|
|
34
34
|
snapshots.delete(element);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
function saveAttributes(
|
|
38
|
-
|
|
37
|
+
function saveAttributes(element_or_elements, attribute_or_attributes) {
|
|
38
|
+
const attributes = Array.isArray(attribute_or_attributes) ? attribute_or_attributes : [attribute_or_attributes];
|
|
39
|
+
(Array.isArray(element_or_elements) ? element_or_elements : [element_or_elements]).forEach((element) => {
|
|
39
40
|
let snapshot = snapshots.get(element);
|
|
40
41
|
if (!snapshot) {
|
|
41
42
|
snapshot = /* @__PURE__ */ new Map();
|
|
@@ -49,6 +50,10 @@ function saveAttributes(elements, attributes) {
|
|
|
49
50
|
|
|
50
51
|
// node_modules/power-focusable/dist/index.js
|
|
51
52
|
var FOCUSABLE_SELECTOR = `:is(a[href], area[href], button, embed, iframe, input:not([type="hidden" i]), object, select, details > summary:first-of-type, textarea, [contenteditable]:not([contenteditable="false" i]), [controls], [tabindex]):not(:disabled, [hidden], [inert], [tabindex="-1"])`;
|
|
53
|
+
var FOCUSABLE_SELECTOR_WITH_NEGATIVE_TABINDEX = FOCUSABLE_SELECTOR.replace(
|
|
54
|
+
/(,\s*)?\[tabindex="-1"\]/g,
|
|
55
|
+
""
|
|
56
|
+
);
|
|
52
57
|
function getFocusables(container = document.body, options = {}) {
|
|
53
58
|
if (!(container instanceof Element)) {
|
|
54
59
|
console.warn("Invalid container element. Fallback: <body> element.");
|
|
@@ -85,36 +90,43 @@ function getFocusables(container = document.body, options = {}) {
|
|
|
85
90
|
console.warn("Invalid skipVisibilityCheck option. Fallback: false.");
|
|
86
91
|
skipVisibilityCheck = false;
|
|
87
92
|
}
|
|
88
|
-
const
|
|
93
|
+
const candidates = [];
|
|
89
94
|
if (composed || include) {
|
|
90
95
|
let traverse2 = function(node) {
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
if (isFocusable(node, {
|
|
97
|
+
skipNegativeTabIndexCheck,
|
|
98
|
+
skipVisibilityCheck
|
|
99
|
+
}) || include?.(node)) {
|
|
100
|
+
candidates[candidates.length] = node;
|
|
96
101
|
}
|
|
97
|
-
const
|
|
98
|
-
for (let i = 0, l =
|
|
99
|
-
const child =
|
|
102
|
+
const children2 = composed ? getComposedChildren(node) : getChildren(node);
|
|
103
|
+
for (let i = 0, l = children2.length; i < l; i++) {
|
|
104
|
+
const child = children2[i];
|
|
100
105
|
child && traverse2(child);
|
|
101
106
|
}
|
|
102
107
|
};
|
|
103
|
-
|
|
108
|
+
const children = composed ? getComposedChildren(container) : getChildren(container);
|
|
109
|
+
for (let i = 0, l = children.length; i < l; i++) {
|
|
110
|
+
const child = children[i];
|
|
111
|
+
child && traverse2(child);
|
|
112
|
+
}
|
|
104
113
|
} else {
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
114
|
+
const matches = container.querySelectorAll(
|
|
115
|
+
skipNegativeTabIndexCheck ? FOCUSABLE_SELECTOR_WITH_NEGATIVE_TABINDEX : FOCUSABLE_SELECTOR
|
|
116
|
+
);
|
|
117
|
+
for (let i = 0, l = matches.length; i < l; i++) {
|
|
118
|
+
const matched = matches[i];
|
|
119
|
+
if (matched && isFocusable(matched, {
|
|
109
120
|
skipNegativeTabIndexCheck,
|
|
110
121
|
skipVisibilityCheck
|
|
111
122
|
})) {
|
|
112
|
-
|
|
123
|
+
candidates[candidates.length] = matched;
|
|
113
124
|
}
|
|
114
125
|
}
|
|
115
126
|
}
|
|
116
|
-
|
|
117
|
-
|
|
127
|
+
return normalizeRadioGroup(
|
|
128
|
+
sortByTabIndex(filter ? candidates.filter(filter) : candidates)
|
|
129
|
+
);
|
|
118
130
|
}
|
|
119
131
|
function isFocusable(element, options = {}) {
|
|
120
132
|
if (!(element instanceof Element)) {
|
|
@@ -137,7 +149,7 @@ function isFocusable(element, options = {}) {
|
|
|
137
149
|
return false;
|
|
138
150
|
}
|
|
139
151
|
if (!element.matches(
|
|
140
|
-
skipNegativeTabIndexCheck ?
|
|
152
|
+
skipNegativeTabIndexCheck ? FOCUSABLE_SELECTOR_WITH_NEGATIVE_TABINDEX : FOCUSABLE_SELECTOR
|
|
141
153
|
)) {
|
|
142
154
|
return false;
|
|
143
155
|
}
|
|
@@ -195,22 +207,42 @@ function normalizeRadioGroup(elements) {
|
|
|
195
207
|
if (!map) {
|
|
196
208
|
map = /* @__PURE__ */ new Map();
|
|
197
209
|
}
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
if (
|
|
201
|
-
|
|
210
|
+
const root = element.getRootNode();
|
|
211
|
+
let value = map.get(root);
|
|
212
|
+
if (!value) {
|
|
213
|
+
value = /* @__PURE__ */ new Map();
|
|
214
|
+
map.set(root, value);
|
|
215
|
+
}
|
|
216
|
+
let v = value.get(element.form);
|
|
217
|
+
if (!v) {
|
|
218
|
+
v = /* @__PURE__ */ new Map();
|
|
219
|
+
value.set(element.form, v);
|
|
220
|
+
}
|
|
221
|
+
let vv = v.get(element.name);
|
|
222
|
+
if (!vv) {
|
|
223
|
+
vv = [];
|
|
224
|
+
v.set(element.name, vv);
|
|
202
225
|
}
|
|
226
|
+
vv[vv.length] = element;
|
|
203
227
|
}
|
|
204
228
|
if (!map) {
|
|
205
229
|
return elements;
|
|
206
230
|
}
|
|
207
231
|
const placeholder = /* @__PURE__ */ new Set();
|
|
208
|
-
for (const
|
|
209
|
-
|
|
232
|
+
for (const value of map.values()) {
|
|
233
|
+
for (const v of value.values()) {
|
|
234
|
+
for (const vv of v.values()) {
|
|
235
|
+
const radio = vv.find((element) => element.checked) ?? vv[0];
|
|
236
|
+
radio && placeholder.add(radio);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
210
239
|
}
|
|
211
|
-
return elements.filter(
|
|
212
|
-
|
|
213
|
-
|
|
240
|
+
return elements.filter((element) => {
|
|
241
|
+
if (!(element instanceof HTMLInputElement)) {
|
|
242
|
+
return true;
|
|
243
|
+
}
|
|
244
|
+
return !isUngroupedRadio(element) || placeholder.has(element);
|
|
245
|
+
});
|
|
214
246
|
}
|
|
215
247
|
function sortByTabIndex(elements) {
|
|
216
248
|
const ordered = [];
|
|
@@ -282,7 +314,7 @@ function isInert(element) {
|
|
|
282
314
|
return "inert" in element && !!element.inert;
|
|
283
315
|
}
|
|
284
316
|
function isUngroupedRadio(element) {
|
|
285
|
-
return element
|
|
317
|
+
return element.type === "radio" && !!element.name;
|
|
286
318
|
}
|
|
287
319
|
|
|
288
320
|
// node_modules/@y14e/button/dist/index.js
|
|
@@ -341,14 +373,8 @@ function createRovingTabIndex(container, options = {}) {
|
|
|
341
373
|
return () => {
|
|
342
374
|
};
|
|
343
375
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
return () => roving.destroy();
|
|
347
|
-
} catch (error) {
|
|
348
|
-
error instanceof Error && console.warn(error.message || error);
|
|
349
|
-
return () => {
|
|
350
|
-
};
|
|
351
|
-
}
|
|
376
|
+
const roving = new RovingTabIndex(container, options);
|
|
377
|
+
return () => roving.destroy();
|
|
352
378
|
}
|
|
353
379
|
var RovingTabIndex = class _RovingTabIndex {
|
|
354
380
|
static #initialized = /* @__PURE__ */ new Set();
|
|
@@ -362,17 +388,17 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
362
388
|
constructor(container, options = {}) {
|
|
363
389
|
this.#container = container;
|
|
364
390
|
let {
|
|
365
|
-
direction,
|
|
391
|
+
direction = "both",
|
|
366
392
|
navigationOnly = false,
|
|
367
393
|
noMemory = false,
|
|
368
394
|
noStart = false,
|
|
369
|
-
selector,
|
|
395
|
+
selector = "",
|
|
370
396
|
typeahead = false,
|
|
371
397
|
wrap = false
|
|
372
398
|
} = options;
|
|
373
|
-
if (
|
|
374
|
-
console.warn("Invalid direction option. Fallback: both
|
|
375
|
-
direction =
|
|
399
|
+
if (!["both", "horizontal", "vertical"].includes(direction)) {
|
|
400
|
+
console.warn("Invalid direction option. Fallback: 'both'.");
|
|
401
|
+
direction = "both";
|
|
376
402
|
}
|
|
377
403
|
if (typeof navigationOnly !== "boolean") {
|
|
378
404
|
console.warn("Invalid navigationOnly option. Fallback: false.");
|
|
@@ -386,11 +412,18 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
386
412
|
console.warn("Invalid noStart option. Fallback: false.");
|
|
387
413
|
noStart = false;
|
|
388
414
|
}
|
|
389
|
-
if (
|
|
390
|
-
|
|
391
|
-
"Invalid selector. Fallback:
|
|
392
|
-
|
|
393
|
-
|
|
415
|
+
if (selector !== "") {
|
|
416
|
+
if (typeof selector !== "string" || !selector.trim()) {
|
|
417
|
+
console.warn("Invalid selector. Fallback: no selector string.");
|
|
418
|
+
selector = "";
|
|
419
|
+
} else {
|
|
420
|
+
try {
|
|
421
|
+
container.querySelector(selector);
|
|
422
|
+
} catch {
|
|
423
|
+
console.warn("Invalid selector. Fallback: no selector string.");
|
|
424
|
+
selector = "";
|
|
425
|
+
}
|
|
426
|
+
}
|
|
394
427
|
}
|
|
395
428
|
if (typeof typeahead !== "boolean") {
|
|
396
429
|
console.warn("Invalid typeahead option. Fallback: false.");
|
|
@@ -400,9 +433,15 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
400
433
|
console.warn("Invalid wrap option. Fallback: false.");
|
|
401
434
|
wrap = false;
|
|
402
435
|
}
|
|
403
|
-
this.#settings = {
|
|
404
|
-
|
|
405
|
-
|
|
436
|
+
this.#settings = {
|
|
437
|
+
direction,
|
|
438
|
+
navigationOnly,
|
|
439
|
+
noMemory,
|
|
440
|
+
noStart,
|
|
441
|
+
selector,
|
|
442
|
+
typeahead,
|
|
443
|
+
wrap
|
|
444
|
+
};
|
|
406
445
|
this.#selectorFilter = this.#createSelectorFilter();
|
|
407
446
|
this.#initialize();
|
|
408
447
|
}
|
|
@@ -413,7 +452,10 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
413
452
|
this.#isDestroyed = true;
|
|
414
453
|
this.#controller?.abort();
|
|
415
454
|
this.#controller = null;
|
|
416
|
-
|
|
455
|
+
this.#focusables.forEach((focusable) => {
|
|
456
|
+
_RovingTabIndex.#initialized.delete(focusable);
|
|
457
|
+
restoreAttributes(focusable);
|
|
458
|
+
});
|
|
417
459
|
this.#focusables.clear();
|
|
418
460
|
this.#focusablesByFirstChar.clear();
|
|
419
461
|
}
|
|
@@ -450,7 +492,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
450
492
|
return;
|
|
451
493
|
}
|
|
452
494
|
const { direction, typeahead, wrap } = this.#settings;
|
|
453
|
-
const isBoth =
|
|
495
|
+
const isBoth = direction === "both";
|
|
454
496
|
const isHorizontal = direction === "horizontal";
|
|
455
497
|
if (![
|
|
456
498
|
"End",
|
|
@@ -466,14 +508,16 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
466
508
|
if (!(active instanceof Element)) {
|
|
467
509
|
return;
|
|
468
510
|
}
|
|
469
|
-
const
|
|
470
|
-
|
|
511
|
+
const candidates = this.#getFocusables().filter(
|
|
512
|
+
(focusable2) => this.#focusables.has(focusable2)
|
|
513
|
+
);
|
|
514
|
+
if (!candidates.includes(active)) {
|
|
471
515
|
return;
|
|
472
516
|
}
|
|
473
517
|
event.preventDefault();
|
|
474
|
-
const
|
|
518
|
+
const activeIndex = candidates.indexOf(active);
|
|
475
519
|
let newIndex;
|
|
476
|
-
let target =
|
|
520
|
+
let target = candidates;
|
|
477
521
|
switch (key) {
|
|
478
522
|
case "End":
|
|
479
523
|
newIndex = -1;
|
|
@@ -483,22 +527,26 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
483
527
|
break;
|
|
484
528
|
case "ArrowLeft":
|
|
485
529
|
case "ArrowUp": {
|
|
486
|
-
const rawIndex =
|
|
530
|
+
const rawIndex = activeIndex - 1;
|
|
487
531
|
newIndex = wrap ? rawIndex : Math.max(rawIndex, 0);
|
|
488
532
|
break;
|
|
489
533
|
}
|
|
490
534
|
case "ArrowRight":
|
|
491
535
|
case "ArrowDown": {
|
|
492
|
-
const rawIndex =
|
|
493
|
-
|
|
536
|
+
const rawIndex = activeIndex + 1;
|
|
537
|
+
const length = target.length;
|
|
538
|
+
newIndex = wrap ? rawIndex % length : Math.min(rawIndex, length - 1);
|
|
494
539
|
break;
|
|
495
540
|
}
|
|
496
541
|
default: {
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
(focusable2) => current.indexOf(focusable2) > currentIndex
|
|
542
|
+
const focusables = new Set(
|
|
543
|
+
this.#focusablesByFirstChar.get(key.toUpperCase()) ?? []
|
|
500
544
|
);
|
|
501
|
-
|
|
545
|
+
target = candidates.filter((focusable2) => focusables.has(focusable2));
|
|
546
|
+
const afterIndex = target.findIndex(
|
|
547
|
+
(focusable2) => candidates.indexOf(focusable2) > activeIndex
|
|
548
|
+
);
|
|
549
|
+
newIndex = afterIndex >= 0 ? afterIndex : 0;
|
|
502
550
|
}
|
|
503
551
|
}
|
|
504
552
|
const focusable = target.at(newIndex);
|
|
@@ -508,12 +556,16 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
508
556
|
const current = new Set(this.#getFocusables());
|
|
509
557
|
for (const focusable of this.#focusables) {
|
|
510
558
|
if (!current.has(focusable)) {
|
|
511
|
-
|
|
559
|
+
_RovingTabIndex.#initialized.delete(focusable);
|
|
560
|
+
restoreAttributes(focusable);
|
|
512
561
|
this.#focusables.delete(focusable);
|
|
513
|
-
this.#focusablesByFirstChar
|
|
562
|
+
for (const [key, focusables] of this.#focusablesByFirstChar) {
|
|
514
563
|
const index = focusables.indexOf(focusable);
|
|
515
|
-
index >= 0
|
|
516
|
-
|
|
564
|
+
if (index >= 0) {
|
|
565
|
+
focusables.splice(index, 1);
|
|
566
|
+
!focusables.length && this.#focusablesByFirstChar.delete(key);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
517
569
|
}
|
|
518
570
|
}
|
|
519
571
|
const { navigationOnly, noStart, typeahead } = this.#settings;
|
|
@@ -522,12 +574,12 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
522
574
|
continue;
|
|
523
575
|
}
|
|
524
576
|
if (_RovingTabIndex.#initialized.has(focusable)) {
|
|
525
|
-
|
|
577
|
+
continue;
|
|
526
578
|
}
|
|
527
579
|
this.#focusables.add(focusable);
|
|
528
580
|
_RovingTabIndex.#initialized.add(focusable);
|
|
529
581
|
if (!navigationOnly) {
|
|
530
|
-
saveAttributes(
|
|
582
|
+
saveAttributes(focusable, "tabindex");
|
|
531
583
|
focusable.setAttribute("tabindex", "-1");
|
|
532
584
|
}
|
|
533
585
|
if (!typeahead) {
|
|
@@ -540,7 +592,7 @@ var RovingTabIndex = class _RovingTabIndex {
|
|
|
540
592
|
);
|
|
541
593
|
if (char) {
|
|
542
594
|
keys.add(char);
|
|
543
|
-
saveAttributes(
|
|
595
|
+
saveAttributes(focusable, "aria-keyshortcuts");
|
|
544
596
|
addTokenToAttribute(focusable, "aria-keyshortcuts", char, {
|
|
545
597
|
caseInsensitive: true
|
|
546
598
|
});
|
|
@@ -854,7 +906,7 @@ var Tabs = class _Tabs {
|
|
|
854
906
|
...this.#indicatorElements,
|
|
855
907
|
...this.#panelElements
|
|
856
908
|
]);
|
|
857
|
-
this.#contentElement && restoreAttributes(
|
|
909
|
+
this.#contentElement && restoreAttributes(this.#contentElement);
|
|
858
910
|
this.#listElements.length = 0;
|
|
859
911
|
this.#tabElements.length = 0;
|
|
860
912
|
this.#contentElement = null;
|
|
@@ -875,8 +927,8 @@ var Tabs = class _Tabs {
|
|
|
875
927
|
"style",
|
|
876
928
|
"tabindex"
|
|
877
929
|
]);
|
|
878
|
-
saveAttributes(this.#indicatorElements,
|
|
879
|
-
this.#contentElement && saveAttributes(
|
|
930
|
+
saveAttributes(this.#indicatorElements, "style");
|
|
931
|
+
this.#contentElement && saveAttributes(this.#contentElement, "style");
|
|
880
932
|
saveAttributes(this.#panelElements, [
|
|
881
933
|
"aria-controls",
|
|
882
934
|
"aria-labelledby",
|
|
@@ -1096,7 +1148,7 @@ var TabsIndicator = class {
|
|
|
1096
1148
|
* Tabs
|
|
1097
1149
|
* WAI-ARIA compliant tabs pattern implementation in TypeScript.
|
|
1098
1150
|
*
|
|
1099
|
-
* @version 2.0.
|
|
1151
|
+
* @version 2.0.8
|
|
1100
1152
|
* @author Yusuke Kamiyamane
|
|
1101
1153
|
* @license MIT
|
|
1102
1154
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -1108,7 +1160,7 @@ var TabsIndicator = class {
|
|
|
1108
1160
|
(**
|
|
1109
1161
|
* Attributes Utils
|
|
1110
1162
|
*
|
|
1111
|
-
* @version 1.1.
|
|
1163
|
+
* @version 1.1.4
|
|
1112
1164
|
* @author Yusuke Kamiyamane
|
|
1113
1165
|
* @license MIT
|
|
1114
1166
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -1121,7 +1173,7 @@ power-focusable/dist/index.js:
|
|
|
1121
1173
|
* High-precision focus management utility with full composed tree support.
|
|
1122
1174
|
* Handles complex focus rules including tabindex ordering, radio groups, inert.
|
|
1123
1175
|
*
|
|
1124
|
-
* @version 4.3.
|
|
1176
|
+
* @version 4.3.21
|
|
1125
1177
|
* @author Yusuke Kamiyamane
|
|
1126
1178
|
* @license MIT
|
|
1127
1179
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -1145,7 +1197,7 @@ power-focusable/dist/index.js:
|
|
|
1145
1197
|
* Lightweight roving tabindex utility with fully focus management.
|
|
1146
1198
|
* Designed for accessible menus, tabs, toolbars, and composite widgets.
|
|
1147
1199
|
*
|
|
1148
|
-
* @version 3.1.
|
|
1200
|
+
* @version 3.1.18
|
|
1149
1201
|
* @author Yusuke Kamiyamane
|
|
1150
1202
|
* @license MIT
|
|
1151
1203
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.cjs
CHANGED
|
@@ -285,7 +285,7 @@ var Tabs = class _Tabs {
|
|
|
285
285
|
...this.#indicatorElements,
|
|
286
286
|
...this.#panelElements
|
|
287
287
|
]);
|
|
288
|
-
this.#contentElement && attributesUtils.restoreAttributes(
|
|
288
|
+
this.#contentElement && attributesUtils.restoreAttributes(this.#contentElement);
|
|
289
289
|
this.#listElements.length = 0;
|
|
290
290
|
this.#tabElements.length = 0;
|
|
291
291
|
this.#contentElement = null;
|
|
@@ -306,8 +306,8 @@ var Tabs = class _Tabs {
|
|
|
306
306
|
"style",
|
|
307
307
|
"tabindex"
|
|
308
308
|
]);
|
|
309
|
-
attributesUtils.saveAttributes(this.#indicatorElements,
|
|
310
|
-
this.#contentElement && attributesUtils.saveAttributes(
|
|
309
|
+
attributesUtils.saveAttributes(this.#indicatorElements, "style");
|
|
310
|
+
this.#contentElement && attributesUtils.saveAttributes(this.#contentElement, "style");
|
|
311
311
|
attributesUtils.saveAttributes(this.#panelElements, [
|
|
312
312
|
"aria-controls",
|
|
313
313
|
"aria-labelledby",
|
|
@@ -527,7 +527,7 @@ var TabsIndicator = class {
|
|
|
527
527
|
* Tabs
|
|
528
528
|
* WAI-ARIA compliant tabs pattern implementation in TypeScript.
|
|
529
529
|
*
|
|
530
|
-
* @version 2.0.
|
|
530
|
+
* @version 2.0.8
|
|
531
531
|
* @author Yusuke Kamiyamane
|
|
532
532
|
* @license MIT
|
|
533
533
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -279,7 +279,7 @@ var Tabs = class _Tabs {
|
|
|
279
279
|
...this.#indicatorElements,
|
|
280
280
|
...this.#panelElements
|
|
281
281
|
]);
|
|
282
|
-
this.#contentElement && restoreAttributes(
|
|
282
|
+
this.#contentElement && restoreAttributes(this.#contentElement);
|
|
283
283
|
this.#listElements.length = 0;
|
|
284
284
|
this.#tabElements.length = 0;
|
|
285
285
|
this.#contentElement = null;
|
|
@@ -300,8 +300,8 @@ var Tabs = class _Tabs {
|
|
|
300
300
|
"style",
|
|
301
301
|
"tabindex"
|
|
302
302
|
]);
|
|
303
|
-
saveAttributes(this.#indicatorElements,
|
|
304
|
-
this.#contentElement && saveAttributes(
|
|
303
|
+
saveAttributes(this.#indicatorElements, "style");
|
|
304
|
+
this.#contentElement && saveAttributes(this.#contentElement, "style");
|
|
305
305
|
saveAttributes(this.#panelElements, [
|
|
306
306
|
"aria-controls",
|
|
307
307
|
"aria-labelledby",
|
|
@@ -521,7 +521,7 @@ var TabsIndicator = class {
|
|
|
521
521
|
* Tabs
|
|
522
522
|
* WAI-ARIA compliant tabs pattern implementation in TypeScript.
|
|
523
523
|
*
|
|
524
|
-
* @version 2.0.
|
|
524
|
+
* @version 2.0.8
|
|
525
525
|
* @author Yusuke Kamiyamane
|
|
526
526
|
* @license MIT
|
|
527
527
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@y14e/tabs",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "WAI-ARIA compliant tabs pattern implementation in TypeScript",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"node": ">=18"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@y14e/attributes-utils": "^1.1.
|
|
53
|
+
"@y14e/attributes-utils": "^1.1.4",
|
|
54
54
|
"@y14e/button": "^1.0.6",
|
|
55
|
-
"@y14e/roving-tabindex": "^3.1.
|
|
55
|
+
"@y14e/roving-tabindex": "^3.1.18"
|
|
56
56
|
}
|
|
57
57
|
}
|