@y14e/disclosure 1.3.0 → 1.3.2
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 +9 -9
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -9
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -586,12 +586,6 @@ var Disclosure = class _Disclosure {
|
|
|
586
586
|
this.#bindings.set(summary, binding);
|
|
587
587
|
this.#bindings.set(content, binding);
|
|
588
588
|
});
|
|
589
|
-
this.#cleanupRovingTabIndex = createRovingTabIndex(this.#rootElement, {
|
|
590
|
-
direction: "vertical",
|
|
591
|
-
navigationOnly: true,
|
|
592
|
-
selector: `summary${NOT_NESTED}`,
|
|
593
|
-
wrap: true
|
|
594
|
-
});
|
|
595
589
|
this.#initialize();
|
|
596
590
|
}
|
|
597
591
|
open(details) {
|
|
@@ -625,6 +619,8 @@ var Disclosure = class _Disclosure {
|
|
|
625
619
|
observer.disconnect();
|
|
626
620
|
});
|
|
627
621
|
this.#observers.length = 0;
|
|
622
|
+
this.#cleanupRovingTabIndex?.();
|
|
623
|
+
this.#cleanupRovingTabIndex = null;
|
|
628
624
|
!force && await this.#waitAnimationsFinish();
|
|
629
625
|
this.#contentElements.forEach((content) => {
|
|
630
626
|
force && this.#bindings.get(content)?.animation?.finish();
|
|
@@ -632,8 +628,6 @@ var Disclosure = class _Disclosure {
|
|
|
632
628
|
});
|
|
633
629
|
this.#animationController?.abort();
|
|
634
630
|
this.#animationController = null;
|
|
635
|
-
this.#cleanupRovingTabIndex?.();
|
|
636
|
-
this.#cleanupRovingTabIndex = null;
|
|
637
631
|
this.#detailsElements.forEach((details) => {
|
|
638
632
|
details.removeAttribute("data-disclosure-name");
|
|
639
633
|
details.removeAttribute("data-disclosure-open");
|
|
@@ -668,6 +662,12 @@ var Disclosure = class _Disclosure {
|
|
|
668
662
|
}
|
|
669
663
|
summary.addEventListener("click", this.#onSummaryClick, { signal });
|
|
670
664
|
});
|
|
665
|
+
this.#cleanupRovingTabIndex = createRovingTabIndex(this.#rootElement, {
|
|
666
|
+
direction: "vertical",
|
|
667
|
+
navigationOnly: true,
|
|
668
|
+
selector: `summary:not(:scope summary + * *)`,
|
|
669
|
+
wrap: true
|
|
670
|
+
});
|
|
671
671
|
this.#rootElement.setAttribute("data-disclosure-initialized", "");
|
|
672
672
|
}
|
|
673
673
|
#onSummaryClick = (event) => {
|
|
@@ -788,7 +788,7 @@ function waitAnimationFinish(animation) {
|
|
|
788
788
|
* WAI-ARIA compliant disclosure pattern implementation in TypeScript.
|
|
789
789
|
* Using the <details> and <summary> element.
|
|
790
790
|
*
|
|
791
|
-
* @version 1.3.
|
|
791
|
+
* @version 1.3.2
|
|
792
792
|
* @author Yusuke Kamiyamane
|
|
793
793
|
* @license MIT
|
|
794
794
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -584,12 +584,6 @@ var Disclosure = class _Disclosure {
|
|
|
584
584
|
this.#bindings.set(summary, binding);
|
|
585
585
|
this.#bindings.set(content, binding);
|
|
586
586
|
});
|
|
587
|
-
this.#cleanupRovingTabIndex = createRovingTabIndex(this.#rootElement, {
|
|
588
|
-
direction: "vertical",
|
|
589
|
-
navigationOnly: true,
|
|
590
|
-
selector: `summary${NOT_NESTED}`,
|
|
591
|
-
wrap: true
|
|
592
|
-
});
|
|
593
587
|
this.#initialize();
|
|
594
588
|
}
|
|
595
589
|
open(details) {
|
|
@@ -623,6 +617,8 @@ var Disclosure = class _Disclosure {
|
|
|
623
617
|
observer.disconnect();
|
|
624
618
|
});
|
|
625
619
|
this.#observers.length = 0;
|
|
620
|
+
this.#cleanupRovingTabIndex?.();
|
|
621
|
+
this.#cleanupRovingTabIndex = null;
|
|
626
622
|
!force && await this.#waitAnimationsFinish();
|
|
627
623
|
this.#contentElements.forEach((content) => {
|
|
628
624
|
force && this.#bindings.get(content)?.animation?.finish();
|
|
@@ -630,8 +626,6 @@ var Disclosure = class _Disclosure {
|
|
|
630
626
|
});
|
|
631
627
|
this.#animationController?.abort();
|
|
632
628
|
this.#animationController = null;
|
|
633
|
-
this.#cleanupRovingTabIndex?.();
|
|
634
|
-
this.#cleanupRovingTabIndex = null;
|
|
635
629
|
this.#detailsElements.forEach((details) => {
|
|
636
630
|
details.removeAttribute("data-disclosure-name");
|
|
637
631
|
details.removeAttribute("data-disclosure-open");
|
|
@@ -666,6 +660,12 @@ var Disclosure = class _Disclosure {
|
|
|
666
660
|
}
|
|
667
661
|
summary.addEventListener("click", this.#onSummaryClick, { signal });
|
|
668
662
|
});
|
|
663
|
+
this.#cleanupRovingTabIndex = createRovingTabIndex(this.#rootElement, {
|
|
664
|
+
direction: "vertical",
|
|
665
|
+
navigationOnly: true,
|
|
666
|
+
selector: `summary:not(:scope summary + * *)`,
|
|
667
|
+
wrap: true
|
|
668
|
+
});
|
|
669
669
|
this.#rootElement.setAttribute("data-disclosure-initialized", "");
|
|
670
670
|
}
|
|
671
671
|
#onSummaryClick = (event) => {
|
|
@@ -786,7 +786,7 @@ function waitAnimationFinish(animation) {
|
|
|
786
786
|
* WAI-ARIA compliant disclosure pattern implementation in TypeScript.
|
|
787
787
|
* Using the <details> and <summary> element.
|
|
788
788
|
*
|
|
789
|
-
* @version 1.3.
|
|
789
|
+
* @version 1.3.2
|
|
790
790
|
* @author Yusuke Kamiyamane
|
|
791
791
|
* @license MIT
|
|
792
792
|
* @copyright Copyright (c) Yusuke Kamiyamane
|