fix: resolve coding guideline violations

This commit is contained in:
Csongor Czezar
2026-01-06 14:47:10 -08:00
parent 43fce00e54
commit b6ef7b8034

View File

@@ -8,7 +8,7 @@
type="single" type="single"
variant="secondary" variant="secondary"
:model-value="toggleGroupValue" :model-value="toggleGroupValue"
class="w-full mb-[-0.5rem]" class="flex justify-end w-full mb-[-0.5rem]"
@update:model-value="handleToggleGroupChange" @update:model-value="handleToggleGroupChange"
> >
<ToggleGroupItem value="off" :aria-label="`${widget.name}: ${labelOff}`"> <ToggleGroupItem value="off" :aria-label="`${widget.name}: ${labelOff}`">
@@ -48,7 +48,6 @@ import WidgetLayoutField from './layout/WidgetLayoutField.vue'
interface BooleanWidgetOptions { interface BooleanWidgetOptions {
on?: string on?: string
off?: string off?: string
[key: string]: unknown
} }
const { widget } = defineProps<{ const { widget } = defineProps<{
@@ -76,7 +75,7 @@ const toggleGroupValue = computed(() => {
return modelValue.value ? 'on' : 'off' return modelValue.value ? 'on' : 'off'
}) })
const handleToggleGroupChange = (value: unknown) => { function handleToggleGroupChange(value: unknown) {
if (value === 'on') { if (value === 'on') {
modelValue.value = true modelValue.value = true
} else if (value === 'off') { } else if (value === 'off') {
@@ -88,7 +87,7 @@ const handleToggleGroupChange = (value: unknown) => {
const widgetWithStyle = computed(() => ({ const widgetWithStyle = computed(() => ({
...widget, ...widget,
borderStyle: hasLabels.value borderStyle: hasLabels.value
? 'focus-within:!ring-0 !bg-transparent !rounded-none focus-within:!outline-none flex justify-end' ? 'focus-within:ring-0 bg-transparent rounded-none focus-within:outline-none'
: undefined : undefined
})) }))
</script> </script>