Added character list in search

This commit is contained in:
Alexis
2024-04-06 22:13:39 +02:00
parent a69396d75b
commit dd8c4727a3
28 changed files with 556 additions and 178 deletions

View File

@@ -1,8 +1,8 @@
import { computed, type Ref, type ComputedRef, ref } from 'vue'
import { defineStore } from 'pinia'
import { useUrlSearchParams } from '@vueuse/core'
import type { LeimDate, LeimPeriod, LeimPeriodShort } from '@/models/Date'
import { isDigit, isInt, isSignedInt } from '@/utils/Regex'
import { useUrlSearchParams } from '@vueuse/core'
import { defineStore } from 'pinia'
import { computed, ref, type ComputedRef, type Ref } from 'vue'
type CalendarViewType = 'month' | 'year' | 'decade' | 'century'

View File

@@ -1,13 +1,7 @@
import type { Character } from '@/models/Characters'
import { defineStore } from 'pinia'
import type { LeimDate } from '@/models/Date'
import { computed, type ComputedRef } from 'vue'
export type Character = {
name: string
birth?: LeimDate
death?: LeimDate
}
export const useCharacters = defineStore('characters', () => {
const characters: Character[] = [
// Counts of the Alliance

View File

@@ -1,24 +1,8 @@
import type { CalendarEvent } from '@/models/Events'
import { defineStore } from 'pinia'
import { computed, watch, type Ref, ref, toRaw } from 'vue'
import { useCharacters } from './characters'
import type { LeimDate } from '@/models/Date'
import { computed, ref, watch, type Ref } from 'vue'
import { useCalendar } from './calendar'
export type CalendarEvent = {
title: string
date: LeimDate
description?: string
category?: CalendarEventCategory
}
export type CalendarEventCategory =
| 'birth'
| 'death'
| 'catastrophe'
| 'legal'
| 'natural-disaster'
| 'player'
import { useCharacters } from './characters'
export const useCalendarEvents = defineStore('calendar-events', () => {
const { currentDate, currentConfig } = useCalendar()
@@ -130,5 +114,5 @@ export const useCalendarEvents = defineStore('calendar-events', () => {
return allEvents.value.filter((event) => shouldEventBeDisplayed(event))
}
return { allEvents, currentEvents }
return { baseEvents, allEvents, currentEvents }
})