-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: rework calendar components
- Loading branch information
1 parent
886c508
commit 9ccfc70
Showing
50 changed files
with
550 additions
and
788 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,21 @@ | ||
<script setup lang="ts"> | ||
import type { JournalNoteData } from "@/types/journal.types"; | ||
import CalendarMonth from "@/components/calendar/CalendarMonth.vue"; | ||
import CalendarMonthButton from "@/components/calendar/CalendarMonthButton.vue"; | ||
import CalendarQuarterButton from "@/components/calendar/CalendarQuarterButton.vue"; | ||
import CalendarYearButton from "@/components/calendar/CalendarYearButton.vue"; | ||
import { date_from_string, today } from "@/calendar"; | ||
import { today } from "@/calendar"; | ||
import { computed } from "vue"; | ||
import NotesMonthView from "@/components/notes-calendar/NotesMonthView.vue"; | ||
const props = defineProps<{ | ||
const { noteData } = defineProps<{ | ||
noteData: JournalNoteData | null; | ||
}>(); | ||
const refDate = computed(() => { | ||
if (!props.noteData) return today().format("YYYY-MM-DD"); | ||
return props.noteData.date; | ||
}); | ||
const refDateMoment = computed(() => { | ||
return date_from_string(refDate.value); | ||
if (!noteData) return today().format("YYYY-MM-DD"); | ||
return noteData.date; | ||
}); | ||
</script> | ||
|
||
<template> | ||
<CalendarMonth :ref-date="refDate"> | ||
<template #header> | ||
<CalendarMonthButton :date="refDateMoment" /> | ||
<CalendarQuarterButton :date="refDateMoment" /> | ||
<CalendarYearButton :date="refDateMoment" /> | ||
</template> | ||
</CalendarMonth> | ||
<NotesMonthView :ref-date="refDate" :selected-date="refDate" /> | ||
</template> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script setup lang="ts"> | ||
defineProps<{ disabled?: boolean; clickable?: boolean }>(); | ||
</script> | ||
|
||
<template> | ||
<button :disabled :class="{ clickable }"> | ||
<slot /> | ||
</button> | ||
</template> | ||
|
||
<style scoped> | ||
button { | ||
background-color: transparent; | ||
box-shadow: none; | ||
} | ||
.clickable { | ||
cursor: pointer; | ||
} | ||
</style> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.