Open source personal finance application
refactor: update filter component structure and improve UI elements
Ilya Komichev29c8b56d4118
diff --git a/app/components/stat/date/Navigation.vue b/app/components/stat/date/Navigation.vueindex 5571052b..7d4ec9f1 100644--- a/app/components/stat/date/Navigation.vue+++ b/app/components/stat/date/Navigation.vue@@ -2,7 +2,6 @@import { sub } from 'date-fns'import type { StatDateProvider } from '~/components/date/types'-import type { FilterProvider } from '~/components/stat/filter/types'import { getEndOf, getStartOf } from '~/components/date/utils'@@ -83,7 +82,10 @@ function changeDate(way: 'next' | 'prev' | 'today') {@onCloseModal="statDate.modals.value.dateSelector = false"><template #trigger>- <UiTitle8 isShown class="!grow-0">+ <UiTitle8+ class="_bg-item-4 text-md !grow-0"+ isShown+ ><StatDateRange /></UiTitle8></template>diff --git a/app/components/stat/date/useGetDateRange.ts b/app/components/stat/date/useGetDateRange.tsindex 5c071629..b293d9de 100644--- a/app/components/stat/date/useGetDateRange.ts+++ b/app/components/stat/date/useGetDateRange.ts@@ -38,7 +38,7 @@ export function useGetDateRange(t: (key: string, choice?: number) => string, locfunction formatMonthRange({ duration, end, start, type }: DateFormatParams): string {if (isSameYear(start, today)) {if (isSameMonth(start, today) || duration === 1)- return type === 'start' ? formatByLocale(start, 'MMM', locale) : ''+ return type === 'start' ? formatByLocale(start, 'MMMM', locale) : ''return type === 'start' ? formatByLocale(start, 'MMM', locale) : ` - ${formatByLocale(end, 'MMM', locale)}`}diff --git a/app/components/stat/filter/Selector.vue b/app/components/stat/filter/Selector.vueindex e2d829b3..65aaa20a 100644--- a/app/components/stat/filter/Selector.vue+++ b/app/components/stat/filter/Selector.vue@@ -27,21 +27,28 @@ const modals = ref({><template #trigger><UTooltip :text="t('categories.filter')">- <UButton- :aria-label="t('categories.filter')"- class="text-muted"- color="neutral"- icon="hugeicons:folder-library"- size="lg"- square- variant="ghost"- />+ <UChip+ :show="filter?.categoriesIds.value.length > 0"+ color="secondary"+ inset+ size="xs"+ >+ <UButton+ :aria-label="t('categories.filter')"+ class="text-muted"+ color="neutral"+ icon="hugeicons:folder-library"+ size="lg"+ square+ variant="ghost"+ />+ </UChip></UTooltip></template><template #custom="{ close }">- <div class="grid grid-rows-[1fr_auto] h-full overflow-hidden max-h-[60dvh]">- <div class="overflow-y-auto scrollerBlock">+ <div class="grid h-full max-h-[60dvh] grid-rows-[1fr_auto] overflow-hidden">+ <div class="scrollerBlock overflow-y-auto"><CategoriesSelector:selectedIds="filter?.categoriesIds.value"class="min-w-80 px-3"@@ -70,20 +77,27 @@ const modals = ref({><template #trigger><UTooltip :text="t('wallets.filter')">- <UButton- :aria-label="t('wallets.filter')"- class="text-muted"- color="neutral"- icon="hugeicons:wallet-01"- size="lg"- square- variant="ghost"- />+ <UChip+ :show="filter?.walletsIds.value.length > 0"+ color="secondary"+ inset+ size="xs"+ >+ <UButton+ :aria-label="t('wallets.filter')"+ class="text-muted"+ color="neutral"+ icon="hugeicons:wallet-01"+ size="lg"+ square+ variant="ghost"+ />+ </UChip></UTooltip></template><template #custom="{ close }">- <div class="grid grid-rows-[1fr_auto] h-full overflow-hidden max-h-[60dvh]">+ <div class="grid h-full max-h-[60dvh] grid-rows-[1fr_auto] overflow-hidden"><WalletsSelector:selectedIds="filter?.walletsIds.value"class="min-w-80 px-3"