@y14e/parent-checkbox 1.0.11 → 1.0.13

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/parent-checkbox
10
10
 
11
11
  ```ts
12
12
  // npm
13
- import ParentCheckbox from '@y14e/parent-checkbox';
13
+ import { ParentCheckbox } from '@y14e/parent-checkbox';
14
14
 
15
15
  // CDNs
16
- import ParentCheckbox from 'https://esm.sh/@y14e/parent-checkbox@1.0.11';
16
+ import { ParentCheckbox } from 'https://esm.sh/@y14e/parent-checkbox@1.0.13';
17
17
  // or
18
- import ParentCheckbox from 'https://cdn.jsdelivr.net/npm/@y14e/parent-checkbox@1.0.11/+esm';
18
+ import { ParentCheckbox } from 'https://cdn.jsdelivr.net/npm/@y14e/parent-checkbox@1.0.13/+esm';
19
19
  // or
20
- import ParentCheckbox from 'https://esm.unpkg.com/@y14e/parent-checkbox@1.0.11';
20
+ import { ParentCheckbox } from 'https://esm.unpkg.com/@y14e/parent-checkbox@1.0.13';
21
21
  ```
22
22
 
23
23
  ## Usage
package/dist/index.cjs CHANGED
@@ -37,9 +37,9 @@ var ParentCheckbox = class {
37
37
  this.#rootElement.addEventListener("change", this.#onRootChange, {
38
38
  signal
39
39
  });
40
- this.#childElements.forEach((child) => {
40
+ for (const child of this.#childElements) {
41
41
  child.addEventListener("change", this.#onChildChange, { signal });
42
- });
42
+ }
43
43
  this.#update();
44
44
  this.#rootElement.setAttribute("data-parent-checkbox-initialized", "");
45
45
  }
@@ -51,9 +51,9 @@ var ParentCheckbox = class {
51
51
  #onRootChange = () => {
52
52
  this.#rootElement.indeterminate = false;
53
53
  const isChecked = this.#rootElement.checked;
54
- this.#childElements.forEach((child) => {
54
+ for (const child of this.#childElements) {
55
55
  child.checked = isChecked;
56
- });
56
+ }
57
57
  };
58
58
  #onChildChange = () => {
59
59
  this.#update();
@@ -63,11 +63,11 @@ var ParentCheckbox = class {
63
63
  * Parent Checkbox
64
64
  * WAI-ARIA compliant checkbox (mixed) pattern implementation in TypeScript.
65
65
  *
66
- * @version 1.0.11
66
+ * @version 1.0.13
67
67
  * @author Yusuke Kamiyamane
68
68
  * @license MIT
69
69
  * @copyright Copyright (c) Yusuke Kamiyamane
70
70
  * @see {@link https://github.com/y14e/parent-checkbox}
71
71
  */
72
72
 
73
- module.exports = ParentCheckbox;
73
+ exports.ParentCheckbox = ParentCheckbox;
package/dist/index.d.cts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Parent Checkbox
3
3
  * WAI-ARIA compliant checkbox (mixed) pattern implementation in TypeScript.
4
4
  *
5
- * @version 1.0.11
5
+ * @version 1.0.13
6
6
  * @author Yusuke Kamiyamane
7
7
  * @license MIT
8
8
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -14,4 +14,4 @@ declare class ParentCheckbox {
14
14
  destroy(): void;
15
15
  }
16
16
 
17
- export { ParentCheckbox as default };
17
+ export { ParentCheckbox };
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Parent Checkbox
3
3
  * WAI-ARIA compliant checkbox (mixed) pattern implementation in TypeScript.
4
4
  *
5
- * @version 1.0.11
5
+ * @version 1.0.13
6
6
  * @author Yusuke Kamiyamane
7
7
  * @license MIT
8
8
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -14,4 +14,4 @@ declare class ParentCheckbox {
14
14
  destroy(): void;
15
15
  }
16
16
 
17
- export { ParentCheckbox as default };
17
+ export { ParentCheckbox };
package/dist/index.js CHANGED
@@ -35,9 +35,9 @@ var ParentCheckbox = class {
35
35
  this.#rootElement.addEventListener("change", this.#onRootChange, {
36
36
  signal
37
37
  });
38
- this.#childElements.forEach((child) => {
38
+ for (const child of this.#childElements) {
39
39
  child.addEventListener("change", this.#onChildChange, { signal });
40
- });
40
+ }
41
41
  this.#update();
42
42
  this.#rootElement.setAttribute("data-parent-checkbox-initialized", "");
43
43
  }
@@ -49,9 +49,9 @@ var ParentCheckbox = class {
49
49
  #onRootChange = () => {
50
50
  this.#rootElement.indeterminate = false;
51
51
  const isChecked = this.#rootElement.checked;
52
- this.#childElements.forEach((child) => {
52
+ for (const child of this.#childElements) {
53
53
  child.checked = isChecked;
54
- });
54
+ }
55
55
  };
56
56
  #onChildChange = () => {
57
57
  this.#update();
@@ -61,11 +61,11 @@ var ParentCheckbox = class {
61
61
  * Parent Checkbox
62
62
  * WAI-ARIA compliant checkbox (mixed) pattern implementation in TypeScript.
63
63
  *
64
- * @version 1.0.11
64
+ * @version 1.0.13
65
65
  * @author Yusuke Kamiyamane
66
66
  * @license MIT
67
67
  * @copyright Copyright (c) Yusuke Kamiyamane
68
68
  * @see {@link https://github.com/y14e/parent-checkbox}
69
69
  */
70
70
 
71
- export { ParentCheckbox as default };
71
+ export { ParentCheckbox };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/parent-checkbox",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "WAI-ARIA compliant checkbox (mixed) pattern implementation in TypeScript",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -49,5 +49,8 @@
49
49
  },
50
50
  "engines": {
51
51
  "node": ">=18"
52
+ },
53
+ "allowScripts": {
54
+ "esbuild": true
52
55
  }
53
56
  }