|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
<script lang="ts" setup> |
|
|
|
|
const { selectedDate, activeDates, calendarMetaData } = useCalendarViewStoreOrThrow() |
|
|
|
|
const { selectedDate, activeDates } = useCalendarViewStoreOrThrow() |
|
|
|
|
|
|
|
|
|
const months = computed(() => { |
|
|
|
|
const months = [] |
|
|
|
@ -9,14 +9,32 @@ const months = computed(() => {
|
|
|
|
|
return months |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const size = computed(() => calendarMetaData.value?.meta?.yearViewSize ?? 'small') |
|
|
|
|
const calendarContainer = ref<HTMLElement | null>(null) |
|
|
|
|
|
|
|
|
|
const { width } = useWindowSize() |
|
|
|
|
|
|
|
|
|
const size = ref('small') |
|
|
|
|
|
|
|
|
|
const handleResize = () => { |
|
|
|
|
if (width.value < 1608) { |
|
|
|
|
size.value = 'small' |
|
|
|
|
} else if (width.value < 2000) { |
|
|
|
|
size.value = 'medium' |
|
|
|
|
} else { |
|
|
|
|
size.value = 'large' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
|
handleResize() |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
watch(width, handleResize) |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
|
<div |
|
|
|
|
class="flex flex-wrap gap-3 py-3 items-center justify-center overflow-auto nc-scrollbar-md" |
|
|
|
|
data-testid="nc-calendar-year-view" |
|
|
|
|
> |
|
|
|
|
<div ref="calendarContainer" class="overflow-auto flex my-3 justify-center nc-scrollbar-md"> |
|
|
|
|
<div class="grid grid-cols-4 justify-items-center gap-3" data-testid="nc-calendar-year-view"> |
|
|
|
|
<NcDateWeekSelector |
|
|
|
|
v-for="(_, index) in months" |
|
|
|
|
:key="index" |
|
|
|
@ -28,6 +46,7 @@ const size = computed(() => calendarMetaData.value?.meta?.yearViewSize ?? 'small
|
|
|
|
|
disable-pagination |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped></style> |
|
|
|
|