From 2e3fff73f932078c1548a7cbfe50036452977c9f Mon Sep 17 00:00:00 2001
From: Tommy
Date: Wed, 18 Sep 2024 11:31:10 -0400
Subject: [PATCH 01/12] fix: double events
---
es-ds-components/components/es-rating.vue | 61 ++++++++++-------------
es-ds-docs/pages/molecules/rating.vue | 34 ++++++-------
2 files changed, 44 insertions(+), 51 deletions(-)
diff --git a/es-ds-components/components/es-rating.vue b/es-ds-components/components/es-rating.vue
index 857a43e59..69dad97de 100644
--- a/es-ds-components/components/es-rating.vue
+++ b/es-ds-components/components/es-rating.vue
@@ -44,52 +44,45 @@ const props = defineProps({
},
});
-const localRating = ref(props.rating);
+const model = defineModel()
+model.value = props.rating;
-const roundedRating = computed(() => {
- if (!props.rounded) {
- return localRating.value;
- }
- // Rounds to nearest .5
- return Math.round(localRating.value * 2) / 2;
-});
-
-const update = (value: number) => {
- localRating.value = value;
-};
+// Rounds to nearest .5
+const round = (value: number) => value ? Math.round(value * 2) / 2 : 0;
+const localRating = computed(() => props.rounded ? round(model.value as number) : model.value || 0);
-
+
+ :width="props.width"
+ :height="props.height" />
-
+
+ :width="props.width"
+ :height="props.height" />
+ :width="props.width"
+ :height="props.height" />
+ }">
+ :width="props.width"
+ :height="props.height" />
+ :width="props.width"
+ :height="props.height" />
@@ -130,9 +122,10 @@ const update = (value: number) => {
cursor: pointer !important;
}
-// TODO: Star should go back to normal size after click
-.reactiveStar:hover,
-.reactiveStar[data-p-focused='true'] {
- transform: scale(1.5);
+.reactiveStar {
+ &:hover,
+ &[data-p-focused='true'] {
+ transform: scale(1.5);
+ }
}
diff --git a/es-ds-docs/pages/molecules/rating.vue b/es-ds-docs/pages/molecules/rating.vue
index 4abd053a5..db0033d6b 100644
--- a/es-ds-docs/pages/molecules/rating.vue
+++ b/es-ds-docs/pages/molecules/rating.vue
@@ -1,10 +1,4 @@
@@ -42,8 +38,8 @@ onMounted(async () => {
Form Input
+ v-model="rating1Val"
+ :read-only="false" />
Static Display
{
-
-
-
-
-
-
-
-
-
+
+
+
Background Variations
+
From c8e5d868b62e4817c726ed5a34b1597d93968d73 Mon Sep 17 00:00:00 2001
From: Tommy
Date: Thu, 19 Sep 2024 09:28:54 -0400
Subject: [PATCH 02/12] feat: add local focus variable
---
es-ds-components/components/es-rating.vue | 80 +++++++++++++++--------
1 file changed, 53 insertions(+), 27 deletions(-)
diff --git a/es-ds-components/components/es-rating.vue b/es-ds-components/components/es-rating.vue
index 69dad97de..b3b12a7de 100644
--- a/es-ds-components/components/es-rating.vue
+++ b/es-ds-components/components/es-rating.vue
@@ -50,6 +50,8 @@ model.value = props.rating;
// Rounds to nearest .5
const round = (value: number) => value ? Math.round(value * 2) / 2 : 0;
const localRating = computed(() => props.rounded ? round(model.value as number) : model.value || 0);
+
+const showFocus = ref(false);
@@ -78,31 +80,41 @@ const localRating = computed(() => props.rounded ? round(model.value as number)
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+ showFocus: {{ showFocus }}
+
From 7115e9f644cb80b52189ace6f124c8ebe84a2d4e Mon Sep 17 00:00:00 2001
From: Tommy
Date: Thu, 26 Sep 2024 17:00:50 -0400
Subject: [PATCH 03/12] feat: wip
---
es-ds-components/components/es-rating-new.vue | 77 +++++++++++++++++++
es-ds-components/components/es-rating.vue | 43 +----------
2 files changed, 78 insertions(+), 42 deletions(-)
create mode 100644 es-ds-components/components/es-rating-new.vue
diff --git a/es-ds-components/components/es-rating-new.vue b/es-ds-components/components/es-rating-new.vue
new file mode 100644
index 000000000..a1b0cd195
--- /dev/null
+++ b/es-ds-components/components/es-rating-new.vue
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
diff --git a/es-ds-components/components/es-rating.vue b/es-ds-components/components/es-rating.vue
index b3b12a7de..b4e5862c0 100644
--- a/es-ds-components/components/es-rating.vue
+++ b/es-ds-components/components/es-rating.vue
@@ -1,48 +1,7 @@
-
-
-
-
-
-
-
-
diff --git a/es-ds-components/components/es-rating.vue b/es-ds-components/components/es-rating.vue
index b4e5862c0..8ce22a9d9 100644
--- a/es-ds-components/components/es-rating.vue
+++ b/es-ds-components/components/es-rating.vue
@@ -1,7 +1,21 @@
@@ -65,12 +65,14 @@ const showFocus = ref(false);
},
item: (options) => {
return {
- class: [{
- 'reactiveStar': true,
- 'focused': options.context.focused,
- 'fade-focus': options.context.active && options.context.focused,
- }]
- }
+ class: [
+ {
+ reactiveStar: true,
+ focused: options.context.focused,
+ 'fade-focus': options.context.active && options.context.focused,
+ },
+ ],
+ };
},
}"
@focus="showFocus = true"
@@ -111,7 +113,6 @@ const showFocus = ref(false);
&:hover {
transform: scale(1.5);
-
}
&.focused {
transform: scale(1.5);
diff --git a/es-ds-docs/pages/molecules/rating.vue b/es-ds-docs/pages/molecules/rating.vue
index db0033d6b..69e8db323 100644
--- a/es-ds-docs/pages/molecules/rating.vue
+++ b/es-ds-docs/pages/molecules/rating.vue
@@ -36,11 +36,11 @@ const rating1Val = ref(0);
-
Form Input
+
Form input
-
Static Display
+
Static display
@@ -49,7 +49,7 @@ const rating1Val = ref(0);
-
Background Variations
+
Background variations
From 63f7e83d68e1ac5968bc1d7aca0bcf79e7acc312 Mon Sep 17 00:00:00 2001
From: Tommy
Date: Tue, 1 Oct 2024 15:10:01 -0400
Subject: [PATCH 07/12] chore: remove props variable in template section
---
es-ds-components/components/es-rating.vue | 24 +++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/es-ds-components/components/es-rating.vue b/es-ds-components/components/es-rating.vue
index 186132d42..56e59bf44 100644
--- a/es-ds-components/components/es-rating.vue
+++ b/es-ds-components/components/es-rating.vue
@@ -29,7 +29,7 @@ const showFocus = ref(false);
+ :width="width"
+ :height="height" />
+ :width="width"
+ :height="height" />
+ :width="width"
+ :height="height" />
@@ -57,7 +57,7 @@ const showFocus = ref(false);
+ :width="width"
+ :height="height" />
+ :width="width"
+ :height="height" />
From 746a674ee7e0b64c6f9689bd163e40a875ac6964 Mon Sep 17 00:00:00 2001
From: Tommy
Date: Tue, 1 Oct 2024 15:16:03 -0400
Subject: [PATCH 08/12] feat: add back alert in docs
---
es-ds-docs/pages/molecules/rating.vue | 3 +++
1 file changed, 3 insertions(+)
diff --git a/es-ds-docs/pages/molecules/rating.vue b/es-ds-docs/pages/molecules/rating.vue
index 69e8db323..46f1ea47a 100644
--- a/es-ds-docs/pages/molecules/rating.vue
+++ b/es-ds-docs/pages/molecules/rating.vue
@@ -22,6 +22,9 @@ onMounted(async () => {
});
const rating1Val = ref(0);
+watch(rating1Val, () => {
+ alert(rating1Val.value);
+})
From 638aace1466b31ed890c4c0da57e4c14960d6ad6 Mon Sep 17 00:00:00 2001
From: Tommy
Date: Thu, 3 Oct 2024 12:49:32 -0400
Subject: [PATCH 09/12] fix: small tweaks
---
es-ds-components/components/es-rating.vue | 1 -
es-ds-docs/pages/molecules/rating.vue | 1 +
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/es-ds-components/components/es-rating.vue b/es-ds-components/components/es-rating.vue
index 56e59bf44..1b22d6648 100644
--- a/es-ds-components/components/es-rating.vue
+++ b/es-ds-components/components/es-rating.vue
@@ -69,7 +69,6 @@ const showFocus = ref(false);
{
reactiveStar: true,
focused: options.context.focused,
- 'fade-focus': options.context.active && options.context.focused,
},
],
};
diff --git a/es-ds-docs/pages/molecules/rating.vue b/es-ds-docs/pages/molecules/rating.vue
index 46f1ea47a..a4444e269 100644
--- a/es-ds-docs/pages/molecules/rating.vue
+++ b/es-ds-docs/pages/molecules/rating.vue
@@ -23,6 +23,7 @@ onMounted(async () => {
const rating1Val = ref(0);
watch(rating1Val, () => {
+ // eslint-disable-next-line no-alert
alert(rating1Val.value);
})
From 0d3384440fa995b25f7083e5dea866b8fbe25a1b Mon Sep 17 00:00:00 2001
From: Tommy
Date: Thu, 3 Oct 2024 12:50:35 -0400
Subject: [PATCH 10/12] chore: apply formatting
---
es-ds-docs/pages/molecules/rating.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/es-ds-docs/pages/molecules/rating.vue b/es-ds-docs/pages/molecules/rating.vue
index a4444e269..9cec679bf 100644
--- a/es-ds-docs/pages/molecules/rating.vue
+++ b/es-ds-docs/pages/molecules/rating.vue
@@ -25,7 +25,7 @@ const rating1Val = ref(0);
watch(rating1Val, () => {
// eslint-disable-next-line no-alert
alert(rating1Val.value);
-})
+});
From 1912f970a9ea043b3d783b99728c83fec641b22d Mon Sep 17 00:00:00 2001
From: Tommy
Date: Thu, 3 Oct 2024 14:03:54 -0400
Subject: [PATCH 11/12] feat: remove alert
---
es-ds-components/components/es-rating.vue | 9 ---------
es-ds-docs/pages/molecules/rating.vue | 5 +----
2 files changed, 1 insertion(+), 13 deletions(-)
diff --git a/es-ds-components/components/es-rating.vue b/es-ds-components/components/es-rating.vue
index 1b22d6648..a68f24441 100644
--- a/es-ds-components/components/es-rating.vue
+++ b/es-ds-components/components/es-rating.vue
@@ -117,13 +117,4 @@ const showFocus = ref(false);
transform: scale(1.5);
}
}
-
-.rating {
- .reactiveStar.focused,
- .reactiveStar:hover {
- .reactiveStar {
- transform: scale(1.5);
- }
- }
-}
diff --git a/es-ds-docs/pages/molecules/rating.vue b/es-ds-docs/pages/molecules/rating.vue
index 9cec679bf..896b56602 100644
--- a/es-ds-docs/pages/molecules/rating.vue
+++ b/es-ds-docs/pages/molecules/rating.vue
@@ -22,10 +22,6 @@ onMounted(async () => {
});
const rating1Val = ref(0);
-watch(rating1Val, () => {
- // eslint-disable-next-line no-alert
- alert(rating1Val.value);
-});
@@ -44,6 +40,7 @@ watch(rating1Val, () => {
+ Value: {{ rating1Val }}
Static display
Date: Fri, 4 Oct 2024 09:30:39 -0400
Subject: [PATCH 12/12] chore: tweak padding
---
es-ds-docs/pages/molecules/rating.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/es-ds-docs/pages/molecules/rating.vue b/es-ds-docs/pages/molecules/rating.vue
index 896b56602..0470b3b29 100644
--- a/es-ds-docs/pages/molecules/rating.vue
+++ b/es-ds-docs/pages/molecules/rating.vue
@@ -40,7 +40,7 @@ const rating1Val = ref(0);
-
Value: {{ rating1Val }}
+
Value: {{ rating1Val }}
Static display