@nectary/components 5.15.3 → 5.15.4
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/bundle.js +14 -0
- package/checkbox/index.js +7 -0
- package/package.json +1 -1
- package/radio/index.js +7 -0
package/bundle.js
CHANGED
|
@@ -2640,6 +2640,7 @@ class Checkbox extends NectaryElement {
|
|
|
2640
2640
|
this.#internals.role = "checkbox";
|
|
2641
2641
|
this.tabIndex = 0;
|
|
2642
2642
|
this.addEventListener("click", this.#onClick, options);
|
|
2643
|
+
this.addEventListener("keydown", this.#onKeyDown, options);
|
|
2643
2644
|
this.addEventListener("focus", this.#onFocus, options);
|
|
2644
2645
|
this.addEventListener("blur", this.#onBlur, options);
|
|
2645
2646
|
this.addEventListener("-change", this.#onChangeReactHandler, options);
|
|
@@ -2765,6 +2766,12 @@ class Checkbox extends NectaryElement {
|
|
|
2765
2766
|
new CustomEvent("-change", { detail: !this.checked })
|
|
2766
2767
|
);
|
|
2767
2768
|
};
|
|
2769
|
+
#onKeyDown = (e) => {
|
|
2770
|
+
if (e.code === "Space") {
|
|
2771
|
+
e.preventDefault();
|
|
2772
|
+
this.#onClick();
|
|
2773
|
+
}
|
|
2774
|
+
};
|
|
2768
2775
|
#onFocus = () => {
|
|
2769
2776
|
this.dispatchEvent(
|
|
2770
2777
|
new CustomEvent("-focus")
|
|
@@ -8661,6 +8668,13 @@ class Radio extends NectaryElement {
|
|
|
8661
8668
|
}
|
|
8662
8669
|
break;
|
|
8663
8670
|
}
|
|
8671
|
+
case "Space": {
|
|
8672
|
+
e.preventDefault();
|
|
8673
|
+
if (option !== null && !option.hasAttribute("disabled")) {
|
|
8674
|
+
option.click();
|
|
8675
|
+
}
|
|
8676
|
+
break;
|
|
8677
|
+
}
|
|
8664
8678
|
}
|
|
8665
8679
|
};
|
|
8666
8680
|
#onSlotChange = () => {
|
package/checkbox/index.js
CHANGED
|
@@ -26,6 +26,7 @@ class Checkbox extends NectaryElement {
|
|
|
26
26
|
this.#internals.role = "checkbox";
|
|
27
27
|
this.tabIndex = 0;
|
|
28
28
|
this.addEventListener("click", this.#onClick, options);
|
|
29
|
+
this.addEventListener("keydown", this.#onKeyDown, options);
|
|
29
30
|
this.addEventListener("focus", this.#onFocus, options);
|
|
30
31
|
this.addEventListener("blur", this.#onBlur, options);
|
|
31
32
|
this.addEventListener("-change", this.#onChangeReactHandler, options);
|
|
@@ -151,6 +152,12 @@ class Checkbox extends NectaryElement {
|
|
|
151
152
|
new CustomEvent("-change", { detail: !this.checked })
|
|
152
153
|
);
|
|
153
154
|
};
|
|
155
|
+
#onKeyDown = (e) => {
|
|
156
|
+
if (e.code === "Space") {
|
|
157
|
+
e.preventDefault();
|
|
158
|
+
this.#onClick();
|
|
159
|
+
}
|
|
160
|
+
};
|
|
154
161
|
#onFocus = () => {
|
|
155
162
|
this.dispatchEvent(
|
|
156
163
|
new CustomEvent("-focus")
|
package/package.json
CHANGED
package/radio/index.js
CHANGED
|
@@ -109,6 +109,13 @@ class Radio extends NectaryElement {
|
|
|
109
109
|
}
|
|
110
110
|
break;
|
|
111
111
|
}
|
|
112
|
+
case "Space": {
|
|
113
|
+
e.preventDefault();
|
|
114
|
+
if (option !== null && !option.hasAttribute("disabled")) {
|
|
115
|
+
option.click();
|
|
116
|
+
}
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
112
119
|
}
|
|
113
120
|
};
|
|
114
121
|
#onSlotChange = () => {
|