diff --git a/src/components/calendar/CalendarTile.vue b/src/components/calendar/CalendarTile.vue index f7184e9..96f90c7 100644 --- a/src/components/calendar/CalendarTile.vue +++ b/src/components/calendar/CalendarTile.vue @@ -1,5 +1,5 @@ diff --git a/src/components/calendar/search/CalendarSearch.vue b/src/components/calendar/search/CalendarSearch.vue index 4a0a4dd..05994d4 100644 --- a/src/components/calendar/search/CalendarSearch.vue +++ b/src/components/calendar/search/CalendarSearch.vue @@ -3,15 +3,17 @@ import { Button } from '@/components/ui/button' import { Dialog, DialogContent, DialogTrigger } from '@/components/ui/dialog' import { Input } from '@/components/ui/input' import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group' +import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip' +import { isCharacter, type Character } from '@/models/Characters' +import type { LeimDateOrder } from '@/models/Date' +import { isCalendarEvent, type CalendarEvent } from '@/models/Events' import { useCharacters } from '@/stores/characters' import { useCalendarEvents } from '@/stores/events' -import { PhMagnifyingGlass } from '@phosphor-icons/vue' +import { PhCaretDoubleDown, PhCaretDoubleUp, PhMagnifyingGlass } from '@phosphor-icons/vue' import { useMagicKeys, useStorage, useTimeoutFn, whenever } from '@vueuse/core' import { computed, ref } from 'vue' import { searchUnifier, type SearchMode } from '../Search' import SearchList from './lists/SearchList.vue' -import { isCalendarEvent, type CalendarEvent } from '@/models/Events' -import { isCharacter, type Character } from '@/models/Characters' const { characters } = useCharacters() const { baseEvents } = useCalendarEvents() @@ -22,6 +24,15 @@ const searchQuery = ref('') const searchEnough = computed(() => searchQuery.value.length >= 2) const selectedEntity = useStorage('se', undefined as SearchMode) +const selectedOrder = ref('desc') + +function setOrderAsc() { + selectedOrder.value = 'asc' +} + +function setOrderDesc() { + selectedOrder.value = 'desc' +} const searchResults = computed(() => { let results: (Character | CalendarEvent)[] = [] @@ -127,14 +138,53 @@ whenever(keys.control_period, () => { - - - Évènements - - - Personnages - - +
+
+ + + Évènements + + + Personnages + + +
+
+ + + + + + +

Plus ancien

+
+
+
+ + + + + + + +

Plus récent

+
+
+
+
+

@@ -142,6 +192,7 @@ whenever(keys.control_period, () => { diff --git a/src/components/calendar/search/lists/SearchList.vue b/src/components/calendar/search/lists/SearchList.vue index 0a683b6..521265d 100644 --- a/src/components/calendar/search/lists/SearchList.vue +++ b/src/components/calendar/search/lists/SearchList.vue @@ -1,7 +1,7 @@