@y14e/disclosure 1.3.7 → 1.3.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 +13 -13
- package/dist/index.cjs +11 -11
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,14 +10,14 @@ npm i @y14e/disclosure
|
|
|
10
10
|
|
|
11
11
|
```ts
|
|
12
12
|
// npm
|
|
13
|
-
import Disclosure from '@y14e/disclosure@1.3.
|
|
13
|
+
import Disclosure from '@y14e/disclosure@1.3.8';
|
|
14
14
|
|
|
15
15
|
// CDNs
|
|
16
|
-
import Disclosure from 'https://esm.sh/@y14e/disclosure@1.3.
|
|
16
|
+
import Disclosure from 'https://esm.sh/@y14e/disclosure@1.3.8';
|
|
17
17
|
// or
|
|
18
|
-
import Disclosure from 'https://cdn.jsdelivr.net/npm/@y14e/disclosure@1.3.
|
|
18
|
+
import Disclosure from 'https://cdn.jsdelivr.net/npm/@y14e/disclosure@1.3.8/+esm';
|
|
19
19
|
// or
|
|
20
|
-
import Disclosure from 'https://esm.unpkg.com/@y14e/disclosure@1.3.
|
|
20
|
+
import Disclosure from 'https://esm.unpkg.com/@y14e/disclosure@1.3.8';
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Usage
|
|
@@ -60,15 +60,6 @@ new Disclosure(root);
|
|
|
60
60
|
|
|
61
61
|
## 📦 APIs
|
|
62
62
|
|
|
63
|
-
### `open`
|
|
64
|
-
|
|
65
|
-
```ts
|
|
66
|
-
disclosure.open(details);
|
|
67
|
-
// => void
|
|
68
|
-
//
|
|
69
|
-
// details: HTMLDetailsElement
|
|
70
|
-
```
|
|
71
|
-
|
|
72
63
|
### `close`
|
|
73
64
|
|
|
74
65
|
```ts
|
|
@@ -89,6 +80,15 @@ disclosure.destroy(force);
|
|
|
89
80
|
// force (optional): If true, skips waiting for animations to finish.
|
|
90
81
|
```
|
|
91
82
|
|
|
83
|
+
### `open`
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
disclosure.open(details);
|
|
87
|
+
// => void
|
|
88
|
+
//
|
|
89
|
+
// details: HTMLDetailsElement
|
|
90
|
+
```
|
|
91
|
+
|
|
92
92
|
## Demo
|
|
93
93
|
|
|
94
94
|
- https://y14e.github.io/disclosure/
|
package/dist/index.cjs
CHANGED
|
@@ -614,16 +614,6 @@ var Disclosure = class _Disclosure {
|
|
|
614
614
|
});
|
|
615
615
|
this.#initialize();
|
|
616
616
|
}
|
|
617
|
-
open(details) {
|
|
618
|
-
if (this.#isDestroyed) {
|
|
619
|
-
return;
|
|
620
|
-
}
|
|
621
|
-
if (!(details instanceof HTMLDetailsElement) || !this.#bindings.has(details)) {
|
|
622
|
-
console.warn("Invalid <details> element");
|
|
623
|
-
return;
|
|
624
|
-
}
|
|
625
|
-
this.#toggle(details, true);
|
|
626
|
-
}
|
|
627
617
|
close(details) {
|
|
628
618
|
if (this.#isDestroyed) {
|
|
629
619
|
return;
|
|
@@ -665,6 +655,16 @@ var Disclosure = class _Disclosure {
|
|
|
665
655
|
this.#contentElements.length = 0;
|
|
666
656
|
this.#rootElement.removeAttribute("data-disclosure-initialized");
|
|
667
657
|
}
|
|
658
|
+
open(details) {
|
|
659
|
+
if (this.#isDestroyed) {
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
if (!(details instanceof HTMLDetailsElement) || !this.#bindings.has(details)) {
|
|
663
|
+
console.warn("Invalid <details> element");
|
|
664
|
+
return;
|
|
665
|
+
}
|
|
666
|
+
this.#toggle(details, true);
|
|
667
|
+
}
|
|
668
668
|
#initialize() {
|
|
669
669
|
saveAttributes(this.#summaryElements, [
|
|
670
670
|
"aria-disabled",
|
|
@@ -819,7 +819,7 @@ function waitAnimationFinish(animation) {
|
|
|
819
819
|
* WAI-ARIA compliant disclosure pattern implementation in TypeScript.
|
|
820
820
|
* Using the <details> and <summary> element.
|
|
821
821
|
*
|
|
822
|
-
* @version 1.3.
|
|
822
|
+
* @version 1.3.8
|
|
823
823
|
* @author Yusuke Kamiyamane
|
|
824
824
|
* @license MIT
|
|
825
825
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* WAI-ARIA compliant disclosure pattern implementation in TypeScript.
|
|
4
4
|
* Using the <details> and <summary> element.
|
|
5
5
|
*
|
|
6
|
-
* @version 1.3.
|
|
6
|
+
* @version 1.3.8
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -19,9 +19,9 @@ declare class Disclosure {
|
|
|
19
19
|
#private;
|
|
20
20
|
static defaults: DisclosureOptions;
|
|
21
21
|
constructor(root: HTMLElement, options?: DisclosureOptions);
|
|
22
|
-
open(details: HTMLDetailsElement): void;
|
|
23
22
|
close(details: HTMLDetailsElement): void;
|
|
24
23
|
destroy(force?: boolean): Promise<void>;
|
|
24
|
+
open(details: HTMLDetailsElement): void;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export { type DisclosureOptions, Disclosure as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* WAI-ARIA compliant disclosure pattern implementation in TypeScript.
|
|
4
4
|
* Using the <details> and <summary> element.
|
|
5
5
|
*
|
|
6
|
-
* @version 1.3.
|
|
6
|
+
* @version 1.3.8
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -19,9 +19,9 @@ declare class Disclosure {
|
|
|
19
19
|
#private;
|
|
20
20
|
static defaults: DisclosureOptions;
|
|
21
21
|
constructor(root: HTMLElement, options?: DisclosureOptions);
|
|
22
|
-
open(details: HTMLDetailsElement): void;
|
|
23
22
|
close(details: HTMLDetailsElement): void;
|
|
24
23
|
destroy(force?: boolean): Promise<void>;
|
|
24
|
+
open(details: HTMLDetailsElement): void;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export { type DisclosureOptions, Disclosure as default };
|
package/dist/index.js
CHANGED
|
@@ -612,16 +612,6 @@ var Disclosure = class _Disclosure {
|
|
|
612
612
|
});
|
|
613
613
|
this.#initialize();
|
|
614
614
|
}
|
|
615
|
-
open(details) {
|
|
616
|
-
if (this.#isDestroyed) {
|
|
617
|
-
return;
|
|
618
|
-
}
|
|
619
|
-
if (!(details instanceof HTMLDetailsElement) || !this.#bindings.has(details)) {
|
|
620
|
-
console.warn("Invalid <details> element");
|
|
621
|
-
return;
|
|
622
|
-
}
|
|
623
|
-
this.#toggle(details, true);
|
|
624
|
-
}
|
|
625
615
|
close(details) {
|
|
626
616
|
if (this.#isDestroyed) {
|
|
627
617
|
return;
|
|
@@ -663,6 +653,16 @@ var Disclosure = class _Disclosure {
|
|
|
663
653
|
this.#contentElements.length = 0;
|
|
664
654
|
this.#rootElement.removeAttribute("data-disclosure-initialized");
|
|
665
655
|
}
|
|
656
|
+
open(details) {
|
|
657
|
+
if (this.#isDestroyed) {
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
if (!(details instanceof HTMLDetailsElement) || !this.#bindings.has(details)) {
|
|
661
|
+
console.warn("Invalid <details> element");
|
|
662
|
+
return;
|
|
663
|
+
}
|
|
664
|
+
this.#toggle(details, true);
|
|
665
|
+
}
|
|
666
666
|
#initialize() {
|
|
667
667
|
saveAttributes(this.#summaryElements, [
|
|
668
668
|
"aria-disabled",
|
|
@@ -817,7 +817,7 @@ function waitAnimationFinish(animation) {
|
|
|
817
817
|
* WAI-ARIA compliant disclosure pattern implementation in TypeScript.
|
|
818
818
|
* Using the <details> and <summary> element.
|
|
819
819
|
*
|
|
820
|
-
* @version 1.3.
|
|
820
|
+
* @version 1.3.8
|
|
821
821
|
* @author Yusuke Kamiyamane
|
|
822
822
|
* @license MIT
|
|
823
823
|
* @copyright Copyright (c) Yusuke Kamiyamane
|