From 80c2f0d8dd42e0182e2869e50a33c4a829b96d8f Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 8 Jan 2024 02:27:36 +0100 Subject: [PATCH] [UI] Full restyle of `Slider` component. The component has been rewritten using only CSS 3 and no JS. --- .../webapp/src/components/Light/Animate.vue | 6 +- .../webapp/src/components/Light/Controls.vue | 4 +- .../src/components/Media/ProgressBar.vue | 2 +- .../src/components/Media/VolumeSlider.vue | 2 +- .../webapp/src/components/elements/Slider.vue | 196 ++++++++++-------- .../panels/Entities/Alarm/AlarmEditor.vue | 2 +- .../src/components/panels/Entities/Dimmer.vue | 2 +- .../src/components/panels/Entities/Light.vue | 6 +- .../panels/MusicSnapcast/Client.vue | 2 +- .../widgets/Component/components/Slider.vue | 2 +- 10 files changed, 128 insertions(+), 96 deletions(-) diff --git a/platypush/backend/http/webapp/src/components/Light/Animate.vue b/platypush/backend/http/webapp/src/components/Light/Animate.vue index 4645879e48..497f34e193 100644 --- a/platypush/backend/http/webapp/src/components/Light/Animate.vue +++ b/platypush/backend/http/webapp/src/components/Light/Animate.vue @@ -67,7 +67,7 @@
+ @change="animations.color_transition.hue_step = parseFloat($event.target.value)" />
@@ -78,7 +78,7 @@
+ @change="animations.color_transition.sat_step = parseFloat($event.target.value)" />
@@ -89,7 +89,7 @@
+ @change="animations.color_transition.bri_step = parseFloat($event.target.value)" />
diff --git a/platypush/backend/http/webapp/src/components/Light/Controls.vue b/platypush/backend/http/webapp/src/components/Light/Controls.vue index 90240de408..23a3f34471 100644 --- a/platypush/backend/http/webapp/src/components/Light/Controls.vue +++ b/platypush/backend/http/webapp/src/components/Light/Controls.vue @@ -8,7 +8,7 @@
+ @change.stop="$emit(light ? 'set-light' : 'set-group', {brightness: parseInt($event.target.value)})" />
@@ -18,7 +18,7 @@
+ @change.stop="$emit(light ? 'set-light' : 'set-group', {temperature: parseInt($event.target.value)})" />
diff --git a/platypush/backend/http/webapp/src/components/Media/ProgressBar.vue b/platypush/backend/http/webapp/src/components/Media/ProgressBar.vue index a06db86ddc..f979c0667d 100644 --- a/platypush/backend/http/webapp/src/components/Media/ProgressBar.vue +++ b/platypush/backend/http/webapp/src/components/Media/ProgressBar.vue @@ -6,7 +6,7 @@
+ @change="$emit('seek', $event.target.value)" />
+ @change="$emit('set-volume', $event.target.value)" />
diff --git a/platypush/backend/http/webapp/src/components/elements/Slider.vue b/platypush/backend/http/webapp/src/components/elements/Slider.vue index a6573d0744..c78f4571ee 100644 --- a/platypush/backend/http/webapp/src/components/elements/Slider.vue +++ b/platypush/backend/http/webapp/src/components/elements/Slider.vue @@ -15,13 +15,9 @@ :disabled="disabled" :value="value" ref="range" - @input.stop="onUpdate" - @change.stop="onUpdate"> + @input.stop="$emit('input', $event)" + @change.stop="$emit('change', $event)"> -
-
-
-
@@ -29,8 +25,7 @@ diff --git a/platypush/backend/http/webapp/src/components/panels/Entities/Alarm/AlarmEditor.vue b/platypush/backend/http/webapp/src/components/panels/Entities/Alarm/AlarmEditor.vue index 1a067812d6..64779e2252 100644 --- a/platypush/backend/http/webapp/src/components/panels/Entities/Alarm/AlarmEditor.vue +++ b/platypush/backend/http/webapp/src/components/panels/Entities/Alarm/AlarmEditor.vue @@ -148,7 +148,7 @@
+ @change="onVolumeChange" />
diff --git a/platypush/backend/http/webapp/src/components/panels/Entities/Dimmer.vue b/platypush/backend/http/webapp/src/components/panels/Entities/Dimmer.vue index 8cde6576a4..24a3a4c87b 100644 --- a/platypush/backend/http/webapp/src/components/panels/Entities/Dimmer.vue +++ b/platypush/backend/http/webapp/src/components/panels/Entities/Dimmer.vue @@ -25,7 +25,7 @@
+ :value="value.value" @change="setValue" />
diff --git a/platypush/backend/http/webapp/src/components/panels/Entities/Light.vue b/platypush/backend/http/webapp/src/components/panels/Entities/Light.vue index bda034b2a1..062297cc0f 100644 --- a/platypush/backend/http/webapp/src/components/panels/Entities/Light.vue +++ b/platypush/backend/http/webapp/src/components/panels/Entities/Light.vue @@ -41,7 +41,7 @@
+ :value="value.brightness" @change="setLight({brightness: $event.target.value})" />
@@ -51,7 +51,7 @@
+ :value="value.saturation" @change="setLight({saturation: $event.target.value})" />
@@ -61,7 +61,7 @@
+ :value="value.temperature" @change="setLight({temperature: $event.target.value})"/>
diff --git a/platypush/backend/http/webapp/src/components/panels/MusicSnapcast/Client.vue b/platypush/backend/http/webapp/src/components/panels/MusicSnapcast/Client.vue index 7d46b6f14d..090c444472 100644 --- a/platypush/backend/http/webapp/src/components/panels/MusicSnapcast/Client.vue +++ b/platypush/backend/http/webapp/src/components/panels/MusicSnapcast/Client.vue @@ -7,7 +7,7 @@
+ @change="$emit('volume-change', {host: server.name, client: id, volume: $event.target.value})" />
diff --git a/platypush/backend/http/webapp/src/components/widgets/Component/components/Slider.vue b/platypush/backend/http/webapp/src/components/widgets/Component/components/Slider.vue index f59d4cc56c..7ae9e0e56f 100644 --- a/platypush/backend/http/webapp/src/components/widgets/Component/components/Slider.vue +++ b/platypush/backend/http/webapp/src/components/widgets/Component/components/Slider.vue @@ -7,7 +7,7 @@
- +