@y14e/disclosure-css 1.3.4 → 1.3.5

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 CHANGED
@@ -10,14 +10,14 @@ npm i @y14e/disclosure-css
10
10
 
11
11
  ```ts
12
12
  // npm
13
- import Disclosure from '@y14e/disclosure-css@1.3.4';
13
+ import Disclosure from '@y14e/disclosure-css@1.3.5';
14
14
 
15
15
  // CDNs
16
- import Disclosure from 'https://esm.sh/@y14e/disclosure-css@1.3.4';
16
+ import Disclosure from 'https://esm.sh/@y14e/disclosure-css@1.3.5';
17
17
  // or
18
- import Disclosure from 'https://cdn.jsdelivr.net/npm/@y14e/disclosure-css@1.3.4/+esm';
18
+ import Disclosure from 'https://cdn.jsdelivr.net/npm/@y14e/disclosure-css@1.3.5/+esm';
19
19
  // or
20
- import Disclosure from 'https://esm.unpkg.com/@y14e/disclosure-css@1.3.4';
20
+ import Disclosure from 'https://esm.unpkg.com/@y14e/disclosure-css@1.3.5';
21
21
  ```
22
22
 
23
23
  ## Usage
@@ -30,15 +30,6 @@ new Disclosure(root);
30
30
 
31
31
  ## 📦 APIs
32
32
 
33
- ### `open`
34
-
35
- ```ts
36
- disclosure.open(details);
37
- // => void
38
- //
39
- // details: HTMLDetailsElement
40
- ```
41
-
42
33
  ### `close`
43
34
 
44
35
  ```ts
@@ -57,6 +48,15 @@ disclosure.destroy();
57
48
  // => void
58
49
  ```
59
50
 
51
+ ### `open`
52
+
53
+ ```ts
54
+ disclosure.open(details);
55
+ // => void
56
+ //
57
+ // details: HTMLDetailsElement
58
+ ```
59
+
60
60
  ## Demo
61
61
 
62
62
  - https://y14e.github.io/disclosure-css/
package/dist/index.cjs CHANGED
@@ -600,16 +600,6 @@ var Disclosure = class {
600
600
  });
601
601
  this.#initialize();
602
602
  }
603
- open(details) {
604
- if (this.#isDestroyed) {
605
- return;
606
- }
607
- if (!(details instanceof HTMLDetailsElement) || !this.#bindings.has(details)) {
608
- console.warn("Invalid <details> element");
609
- return;
610
- }
611
- this.#toggle(details, true);
612
- }
613
603
  close(details) {
614
604
  if (this.#isDestroyed) {
615
605
  return;
@@ -633,6 +623,16 @@ var Disclosure = class {
633
623
  this.#contentElements.length = 0;
634
624
  this.#rootElement.removeAttribute("data-disclosure-initialized");
635
625
  }
626
+ open(details) {
627
+ if (this.#isDestroyed) {
628
+ return;
629
+ }
630
+ if (!(details instanceof HTMLDetailsElement) || !this.#bindings.has(details)) {
631
+ console.warn("Invalid <details> element");
632
+ return;
633
+ }
634
+ this.#toggle(details, true);
635
+ }
636
636
  #initialize() {
637
637
  saveAttributes(this.#summaryElements, [
638
638
  "aria-disabled",
@@ -669,7 +669,7 @@ function isFocusable2(element) {
669
669
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
670
670
  * Using the <details> and <summary> element.
671
671
  *
672
- * @version 1.3.4
672
+ * @version 1.3.5
673
673
  * @author Yusuke Kamiyamane
674
674
  * @license MIT
675
675
  * @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.4
6
+ * @version 1.3.5
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -12,9 +12,9 @@
12
12
  declare class Disclosure {
13
13
  #private;
14
14
  constructor(root: HTMLElement);
15
- open(details: HTMLDetailsElement): void;
16
15
  close(details: HTMLDetailsElement): void;
17
16
  destroy(): void;
17
+ open(details: HTMLDetailsElement): void;
18
18
  }
19
19
 
20
20
  export { 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.4
6
+ * @version 1.3.5
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -12,9 +12,9 @@
12
12
  declare class Disclosure {
13
13
  #private;
14
14
  constructor(root: HTMLElement);
15
- open(details: HTMLDetailsElement): void;
16
15
  close(details: HTMLDetailsElement): void;
17
16
  destroy(): void;
17
+ open(details: HTMLDetailsElement): void;
18
18
  }
19
19
 
20
20
  export { Disclosure as default };
package/dist/index.js CHANGED
@@ -598,16 +598,6 @@ var Disclosure = class {
598
598
  });
599
599
  this.#initialize();
600
600
  }
601
- open(details) {
602
- if (this.#isDestroyed) {
603
- return;
604
- }
605
- if (!(details instanceof HTMLDetailsElement) || !this.#bindings.has(details)) {
606
- console.warn("Invalid <details> element");
607
- return;
608
- }
609
- this.#toggle(details, true);
610
- }
611
601
  close(details) {
612
602
  if (this.#isDestroyed) {
613
603
  return;
@@ -631,6 +621,16 @@ var Disclosure = class {
631
621
  this.#contentElements.length = 0;
632
622
  this.#rootElement.removeAttribute("data-disclosure-initialized");
633
623
  }
624
+ open(details) {
625
+ if (this.#isDestroyed) {
626
+ return;
627
+ }
628
+ if (!(details instanceof HTMLDetailsElement) || !this.#bindings.has(details)) {
629
+ console.warn("Invalid <details> element");
630
+ return;
631
+ }
632
+ this.#toggle(details, true);
633
+ }
634
634
  #initialize() {
635
635
  saveAttributes(this.#summaryElements, [
636
636
  "aria-disabled",
@@ -667,7 +667,7 @@ function isFocusable2(element) {
667
667
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
668
668
  * Using the <details> and <summary> element.
669
669
  *
670
- * @version 1.3.4
670
+ * @version 1.3.5
671
671
  * @author Yusuke Kamiyamane
672
672
  * @license MIT
673
673
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/disclosure-css",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "description": "WAI-ARIA compliant disclosure pattern implementation in TypeScript",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",