@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 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
@@ -2289,6 +2289,7 @@ fig-input-color {
2289
2289
 
2290
2290
  & input[type="text"] {
2291
2291
  width: 100%;
2292
+ text-transform: uppercase;
2292
2293
  }
2293
2294
  }
2294
2295
 
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "devDependencies": {