@bruit/component
Advanced tools
Comparing version 0.7.1 to 0.7.2
export class BruitRatingComponent { | ||
constructor() { | ||
this.value = 1; | ||
this.value = 0; | ||
this.max = 5; | ||
@@ -10,4 +10,4 @@ this.color = '#ffd83d'; | ||
watchValue(newValue, oldValue) { | ||
if (!newValue || newValue <= 0) { | ||
this.value = 1; | ||
if (!newValue || newValue < 0) { | ||
this.value = 0; | ||
} | ||
@@ -42,3 +42,3 @@ else if (newValue > this.max) { | ||
setStars() { | ||
if (this.value && this.value <= this.max && this.value > 0 && this.max && this.max > 1) { | ||
if (typeof this.value === 'number' && this.value <= this.max && this.value >= 0 && this.max && this.max > 1) { | ||
const stars = new Array(this.max); | ||
@@ -45,0 +45,0 @@ for (let i = 0; i < stars.length; i++) { |
{ | ||
"name": "@bruit/component", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"description": "send your feedbacks with bruit.io", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2405992