Skip to content

A self-hosted media server and file management system

chore: code smells

aminnausinba1243609dee
diff --git a/resources/js/components/cedar-ui/input/BasicInput.vue b/resources/js/components/cedar-ui/input/BasicInput.vue
index 15c2b31e..98dd9d12 100644
--- a/resources/js/components/cedar-ui/input/BasicInput.vue
+++ b/resources/js/components/cedar-ui/input/BasicInput.vue
@@ -3,7 +3,7 @@ import type { InputHTMLAttributes } from 'vue';
import type { InputShellProps } from '@aminnausin/cedar-ui';
import { InputShell } from '@/components/cedar-ui/input';
-import { ref } from 'vue';
+import { ref, useId } from 'vue';
import { cn } from '@aminnausin/cedar-ui';
defineOptions({ inheritAttrs: false });
@@ -21,6 +21,7 @@ defineExpose({ el });
ref="el"
v-model="model"
v-bind="$attrs"
+ :id="typeof $attrs.id === 'string' ? $attrs.id : useId()"
:class="cn(inputClass, props.class)"
:type="type"
:min="min"
diff --git a/resources/js/components/video/VideoTimeline.vue b/resources/js/components/video/VideoTimeline.vue
index 4144076c..595b3228 100644
--- a/resources/js/components/video/VideoTimeline.vue
+++ b/resources/js/components/video/VideoTimeline.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { computed, onMounted, onUnmounted, ref, useTemplateRef } from 'vue';
+import { computed, onMounted, onUnmounted, ref, useId, useTemplateRef } from 'vue';
import { getClientX, toFormattedDuration } from '@/service/util';
import { throttle } from 'lodash-es';
@@ -192,6 +192,7 @@ defineExpose({ progressTooltip });
min="0"
max="100"
value="0"
+ :id="useId()"
:step="sliderStep"
:aria-valuemin="0"
:aria-valuemax="timeDuration"
diff --git a/resources/js/components/video/slider/VideoSlider.vue b/resources/js/components/video/slider/VideoSlider.vue
index fa94809c..3ff7991e 100644
--- a/resources/js/components/video/slider/VideoSlider.vue
+++ b/resources/js/components/video/slider/VideoSlider.vue
@@ -1,5 +1,7 @@
<script setup lang="ts">
-import { useTemplateRef, watch, type Component } from 'vue';
+import type { Component } from 'vue';
+
+import { useId, useTemplateRef, watch } from 'vue';
import VideoTooltipBase from '@/components/video/tooltip/VideoTooltipBase.vue';
@@ -62,6 +64,7 @@ watch(
min="0"
max="1"
step="0.01"
+ :id="useId()"
:class="['slider animate volume h-2.5 w-full py-1 [--thumb-size:2.5] sm:h-2 sm:[--thumb-size:2]', style]"
:title="title"
/>