frontend: run lint

Signed-off-by: Nicolas Froger <nicolas@kektus.xyz>
This commit is contained in:
Nicolas Froger 2024-07-27 02:10:59 +02:00
commit 2647ac244d
No known key found for this signature in database
61 changed files with 426 additions and 592 deletions

View file

@ -1,34 +1,34 @@
<script setup>
import { useProvideCarousel } from "./useCarousel";
import { cn } from "@/lib/utils";
import { useProvideCarousel } from './useCarousel'
import { cn } from '@/lib/utils'
const props = defineProps({
opts: { type: null, required: false },
plugins: { type: null, required: false },
orientation: { type: String, required: false, default: "horizontal" },
class: { type: null, required: false },
});
orientation: { type: String, required: false, default: 'horizontal' },
class: { type: null, required: false }
})
const emits = defineEmits(["init-api"]);
const emits = defineEmits(['init-api'])
const carouselArgs = useProvideCarousel(props, emits);
const carouselArgs = useProvideCarousel(props, emits)
defineExpose(carouselArgs);
defineExpose(carouselArgs)
function onKeyDown(event) {
const prevKey = props.orientation === "vertical" ? "ArrowUp" : "ArrowLeft";
const nextKey = props.orientation === "vertical" ? "ArrowDown" : "ArrowRight";
const prevKey = props.orientation === 'vertical' ? 'ArrowUp' : 'ArrowLeft'
const nextKey = props.orientation === 'vertical' ? 'ArrowDown' : 'ArrowRight'
if (event.key === prevKey) {
event.preventDefault();
carouselArgs.scrollPrev();
event.preventDefault()
carouselArgs.scrollPrev()
return;
return
}
if (event.key === nextKey) {
event.preventDefault();
carouselArgs.scrollNext();
event.preventDefault()
carouselArgs.scrollNext()
}
}
</script>