@rogieking/figui3 1.5.0 → 1.5.1
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/example.html +3 -0
- package/fig.css +1 -0
- package/fig.js +4 -4
- package/package.json +1 -1
package/example.html
CHANGED
|
@@ -793,6 +793,9 @@
|
|
|
793
793
|
elements.filter(n => n.tagName.toLowerCase().indexOf("fig-slider") > -1).forEach(n => n.addEventListener('input', (e) => {
|
|
794
794
|
console.log('input:', n.tagName, e.target)
|
|
795
795
|
}))
|
|
796
|
+
document.querySelectorAll('fig-input-color').forEach(n => n.addEventListener('input', (e) => {
|
|
797
|
+
console.log('input:', n.tagName, e.target.value)
|
|
798
|
+
}))
|
|
796
799
|
</script>
|
|
797
800
|
</body>
|
|
798
801
|
|
package/fig.css
CHANGED
package/fig.js
CHANGED
|
@@ -1389,13 +1389,13 @@ class FigInputColor extends HTMLElement {
|
|
|
1389
1389
|
this.rgba = this.convertToRGBA(hexValue);
|
|
1390
1390
|
this.value = this.rgbAlphaToHex(
|
|
1391
1391
|
{
|
|
1392
|
-
r: this.rgba.r,
|
|
1393
|
-
g: this.rgba.g,
|
|
1394
|
-
b: this.rgba.b,
|
|
1392
|
+
r: isNaN(this.rgba.r) ? 0 : this.rgba.r,
|
|
1393
|
+
g: isNaN(this.rgba.g) ? 0 : this.rgba.g,
|
|
1394
|
+
b: isNaN(this.rgba.b) ? 0 : this.rgba.b,
|
|
1395
1395
|
},
|
|
1396
1396
|
this.rgba.a
|
|
1397
1397
|
);
|
|
1398
|
-
this.hexWithAlpha = this.value;
|
|
1398
|
+
this.hexWithAlpha = this.value.toUpperCase();
|
|
1399
1399
|
this.hexOpaque = this.hexWithAlpha.slice(0, 7);
|
|
1400
1400
|
if (hexValue.length > 7) {
|
|
1401
1401
|
this.alpha = (this.rgba.a * 100).toFixed(0);
|