Add swipe
All checks were successful
Build BAB Application Deployment Artifact / build (push) Successful in 2m5s

This commit is contained in:
2024-04-29 12:22:57 -04:00
parent d9cfa4ab56
commit e1a784ef45

View File

@@ -1,10 +1,10 @@
<template> <template>
<div class="q-px-sm"> <div>
<CalendarHeaderComponent v-model="selectedDate" /> <CalendarHeaderComponent v-model="selectedDate" />
<div class="boat-schedule-table-component"> <div class="boat-schedule-table-component">
<QCalendarDay <QCalendarDay
ref="calendar" ref="calendar"
class="q-pt-xs" class="q-pa-xs"
flat flat
animated animated
dense dense
@@ -16,6 +16,7 @@
v-model="selectedDate" v-model="selectedDate"
:column-count="boats.length" :column-count="boats.length"
@change="scrollToEvent()" @change="scrollToEvent()"
v-touch-swipe.left.right="handleSwipe"
> >
<template #head-day="{ scope }"> <template #head-day="{ scope }">
<div style="text-align: center; font-weight: 800"> <div style="text-align: center; font-weight: 800">
@@ -56,6 +57,7 @@ import CalendarHeaderComponent from './CalendarHeaderComponent.vue';
import { ref, reactive, computed } from 'vue'; import { ref, reactive, computed } from 'vue';
import { useBoatStore } from 'src/stores/boat'; import { useBoatStore } from 'src/stores/boat';
import { Timeblock, useScheduleStore } from 'src/stores/schedule'; import { Timeblock, useScheduleStore } from 'src/stores/schedule';
import { TouchSwipeValue } from 'quasar';
const scheduleStore = useScheduleStore(); const scheduleStore = useScheduleStore();
const boatStore = useBoatStore(); const boatStore = useBoatStore();
@@ -69,6 +71,9 @@ const boats = boatStore.boats;
const calendar = ref<QCalendarDay | null>(null); const calendar = ref<QCalendarDay | null>(null);
function handleSwipe(event: Event) {
event.direction === 'right' ? calendar.value?.prev() : calendar.value?.next();
}
function blockStyles( function blockStyles(
block: Timeblock, block: Timeblock,
timeStartPos: (t: string) => string, timeStartPos: (t: string) => string,