Open source personal finance application
refactor: consolidate stat page options into single dropdown menu
Ilya Komicheva68002ff0728
diff --git a/app/components/stat/CategoriesButtons.vue b/app/components/stat/CategoriesButtons.vuedeleted file mode 100644index 44ebd82d..00000000--- a/app/components/stat/CategoriesButtons.vue+++ /dev/null@@ -1,106 +0,0 @@-<script setup lang="ts">-import type { DeepPartial } from '~~/utils/types'--import defu from 'defu'--import type { MiniItemConfig } from '~/components/stat/useStatConfig'--import { statConfigKey } from '~/components/stat/injectionKeys'--const { t } = useI18n()-const statConfig = inject(statConfigKey)!--const viewPresets = computed(() => ({- minimal: {- props: {- catsList: {- isItemsBg: false,- isLines: false,- isOpened: false,- isRoundIcon: false,- },- },- title: t('stat.catButtons.minimal'),- },- // eslint-disable-next-line perfectionist/sort-objects- alt: {- props: {- catsList: {- isItemsBg: true,- isLines: false,- isRoundIcon: false,- },- },- title: t('stat.catButtons.alt'),- },-- standard: {- props: {- catsList: {- isItemsBg: false,- isLines: true,- isRoundIcon: true,- },- },- title: t('stat.catButtons.standard'),- },-}))--const isShowMorePresets = ref(false)--function onChangeViewOptions(newViewOptions: Pick<DeepPartial<MiniItemConfig>, 'catsList'>) {- const c = defu(newViewOptions.catsList, statConfig.config.value.catsList)- statConfig.updateConfig('catsList', c)-}-</script>--<template>- <div>- <!-- List -->- <div class="border-item-4 grid gap-3 border-b pb-2 last:border-0">- <UiTitleSection size="sm">- {{ t('stat.catButtons.listItemsOptions') }}- </UiTitleSection>- <div class="flex gap-1">- <UiChipButton- v-for="view in viewPresets"- :key="view.title"- @click="onChangeViewOptions(view.props)"- >- {{ view.title }}- </UiChipButton>-- <UiChipButton- :ariaLabel="$t('base.togglePresets')"- class="!grow-0"- @click="isShowMorePresets = !isShowMorePresets"- >- <Icon- :name="isShowMorePresets ? 'lucide:chevron-up' : 'lucide:chevron-down'"- size="18"- />- </UiChipButton>- </div>-- <div v-if="isShowMorePresets">- <StatConfigSwitch configKey="catsList" field="isItemsBg" :title="t('stat.catButtons.isItemsBg')" />- <StatConfigSwitch configKey="catsList" field="isLines" :title="t('stat.catButtons.isLines')" />- <StatConfigSwitch configKey="catsList" field="isRoundIcon" :title="t('stat.catButtons.isRoundIcon')" />- </div>- </div>-- <div- class="border-item-4 grid gap-3 border-b pt-3 pb-2 last:border-0"- >- <UiTitleSection size="sm">- {{ t('stat.catButtons.elements') }}- </UiTitleSection>- <div>- <StatConfigSwitch configKey="vertical" field="isShow" :title="t('stat.config.categories.vertical.title')" />- <StatConfigSwitch configKey="catsRound" field="isShow" :title="t('stat.config.categories.rounds.title')" />- <StatConfigSwitch configKey="catsList" field="isShow" :title="t('stat.config.categories.list.title')" />- <StatConfigSwitch configKey="trns" field="isShow" :title="t('trns.title')" />- </div>- </div>- </div>-</template>diff --git a/app/components/stat/ConfigModal.vue b/app/components/stat/ConfigModal.vueindex 15e406e0..9254948d 100644--- a/app/components/stat/ConfigModal.vue+++ b/app/components/stat/ConfigModal.vue@@ -1,7 +1,5 @@<script setup lang="ts">-import { useStatChart } from '~/components/stat/chart/useStatChart'import { statConfigKey } from '~/components/stat/injectionKeys'-import { chartViewOptions } from '~/components/stat/useStatConfig'import { useWalletsStore } from '~/components/wallets/useWalletsStore'const props = defineProps<{@@ -12,7 +10,6 @@ const props = defineProps<{const statConfig = inject(statConfigKey)!const { t } = useI18n()const walletsStore = useWalletsStore()-const { chartTypeOptions } = useStatChart()const isOpen = ref(false)</script>@@ -47,81 +44,6 @@ const isOpen = ref(false)<div class="grid gap-4 px-1 py-3 md:px-3 md:!pb-2"><BottomSheetClose @click="close" />- <!-- Chart -->- <div class="border-item-3 border-b pb-3">- <UiTitleSection size="sm" class="pb-2">- {{ t('stat.config.chartShow.title') }}- </UiTitleSection>-- <StatConfigSwitch- configKey="isChartShow"- :title="t('stat.config.chartShow.label')"- />-- <StatConfigSwitch- v-if="statConfig.config.value.isChartShow"- configKey="date"- field="isShowQuick"- :title="t('stat.config.date.quick.label')"- />-- <!-- Chart: showed -->- <div- v-if="statConfig.config.value.isChartShow"- class="grid gap-4"- >- <StatConfigSwitch- configKey="chart"- field="isShowAverage"- :title="t('stat.config.chart.average.label')"- />-- <!-- Chart: view -->- <div class="hidden gap-3 md:grid">- <UiTitleSection size="sm">- {{ t('stat.config.chartView.label') }}- </UiTitleSection>-- <UiTabsBar>- <UiTabsItemPill- v-for="view in chartViewOptions"- :key="view"- variant="outline"- :isActive="statConfig.config.value.chartView === view"- class="grow"- @click="statConfig.updateConfig('chartView', view)"- >- {{ t(`stat.config.chartView.${view}`) }}- </UiTabsItemPill>- </UiTabsBar>- </div>-- <!-- Chart: type -->- <div class="grid gap-3">- <UiTitleSection size="sm">- {{ t('stat.config.chart.type.label') }}- </UiTitleSection>-- <UiTabsBar>- <UiTabsItemPill- v-for="item in chartTypeOptions"- :key="item.value"- variant="outline"- :isActive="statConfig.config.value.chartType === item.value"- class="flex grow gap-1"- @click="statConfig.updateConfig('chartType', item.value)"- >- <Icon- :name="item.icon"- :size="16"- />- {{ item.label }}- </UiTabsItemPill>- </UiTabsBar>- </div>- </div>- </div>-<!-- Wallets --><divv-if="props.isShowWallets"@@ -178,8 +100,6 @@ const isOpen = ref(false)</div></div>- <StatCategoriesButtons />-<slot :close="close" /></div></template>diff --git a/app/components/stat/Item.vue b/app/components/stat/Item.vueindex 63e771c8..15d9d143 100644--- a/app/components/stat/Item.vue+++ b/app/components/stat/Item.vue@@ -122,6 +122,13 @@ function onClickSumItemWrap(type: SeriesSlugSelected) {isShowCategoriesisShowWallets/>++ <StatCategoriesRoundSectionMenu+ :filteredCategoriesIds+ :preCategoriesIds="props.preCategoriesIds"+ :selectedTrnsIds+ class="ml-auto"+ /></StatDateNavigation><StatSumWrapdiff --git a/app/components/stat/categories/DetailedSection.vue b/app/components/stat/categories/DetailedSection.vueindex e46c3e72..c8388407 100644--- a/app/components/stat/categories/DetailedSection.vue+++ b/app/components/stat/categories/DetailedSection.vue@@ -32,7 +32,6 @@ const isVerticalShow = computed(() => statConfig.config.value.vertical.isShow)const isVerticalGrouped = computed(() => statConfig.config.value.vertical.isGrouped)const isListShow = computed(() => catsList.value.isShow)const isListGrouped = computed(() => catsList.value.isGrouped)-const isItemsBg = computed(() => catsList.value.isItemsBg)const isLines = computed(() => catsList.value.isLines)// Categories data (lazy — each variant computed only when accessed)@@ -162,16 +161,13 @@ const {v-if="isShown":class="{'@3xl/main:max-w-md': !isListGrouped,- 'grid gap-1': isItemsBg,}"class="pt-2"><UiToggleControlledv-for="item in linesCategories":key="item.id"- :class="{- group: !isItemsBg,- }"+ class="group":isShown="isExpanded(item.id)"><template #header>@@ -192,12 +188,7 @@ const {v-if="isExpanded(item.id) && item.categories?.length"class="mt-[-2px] ml-5 -translate-x-px pb-3 pl-3">- <div- :class="{- 'mt-1': isItemsBg,- }"- class="grid"- >+ <div class="grid"><StatCategoriesLinev-for="itemInside in item.categories":key="itemInside.id"@@ -206,9 +197,6 @@ const {:maxCategoryValues="childrenMaxValues":lineWidth="isLines ? 0 : 1"class="grow"- :class="{- 'my-px': isItemsBg,- }"@click="emit('clickCategory', itemInside.id)"/></div>diff --git a/app/components/stat/categories/Line.vue b/app/components/stat/categories/Line.vueindex ccc00ba2..b00a0f6b 100644--- a/app/components/stat/categories/Line.vue+++ b/app/components/stat/categories/Line.vue@@ -30,7 +30,6 @@ const statConfig = inject(statConfigKey)!const categoriesStore = useCategoriesStore()const currenciesStore = useCurrenciesStore()-const isItemsBg = computed(() => statConfig.config.value.catsList.isItemsBg)const isLines = computed(() => statConfig.config.value.catsList.isLines)const isRoundIcon = computed(() => statConfig.config.value.catsList.isRoundIcon)@@ -56,7 +55,6 @@ const { longPressRef } = useCategoryLongPress(ref="longPressRef":class="[props.insideClass, {'-bg-item-3 ': props.isActive,- 'bg-item-2 rounded-lg': isItemsBg,}]":style="props.insideStyle"class="relative"@@ -64,7 +62,7 @@ const { longPressRef } = useCategoryLongPress(<slot name="before" /><UiElement:isActive="props.isActive"- :lineWidth="!isItemsBg ? props.lineWidth : 0"+ :lineWidth="props.lineWidth"class="relative"insideClasses="!min-h-[44px]">diff --git a/app/components/stat/categories/Round2lines.vue b/app/components/stat/categories/Round2lines.vueindex aee4c02e..cceea0ed 100644--- a/app/components/stat/categories/Round2lines.vue+++ b/app/components/stat/categories/Round2lines.vue@@ -5,6 +5,7 @@ import type { CategoryWithData } from '~/components/stat/types'import { useCategoriesStore } from '~/components/categories/useCategoriesStore'import { useCurrenciesStore } from '~/components/currencies/useCurrenciesStore'import { useCategoryLongPress } from '~/components/stat/categories/useCategoryLongPress'+import { statConfigKey } from '~/components/stat/injectionKeys'import { getTrnTypeByAmount } from '~/components/trns/types'const props = defineProps<{@@ -19,6 +20,9 @@ const emit = defineEmits<{const categoriesStore = useCategoriesStore()const currenciesStore = useCurrenciesStore()+const statConfig = inject(statConfigKey)!++const isIconBg = computed(() => statConfig.config.value.catsRound.isIconBg)const category = computed(() => categoriesStore.items[props.item.id])const parentCategory = computed(() => {@@ -37,7 +41,8 @@ const { longPressRef } = useCategoryLongPress(<divv-if="category"ref="longPressRef"- class="dark:bg-item-3 relative flex items-center gap-2 overflow-hidden rounded-2xl border border-transparent p-1 pr-3 hover:bg-(--item-5)"+ class="dark:bg-item-3 relative flex items-center overflow-hidden rounded-2xl border border-transparent p-1 pr-3 hover:bg-(--item-5)"+ :class="isIconBg ? 'gap-2' : 'gap-1'"><div:style="{ backgroundColor: category?.color }"@@ -46,12 +51,20 @@ const { longPressRef } = useCategoryLongPress(<div class="size-6"><UiIconBase+ v-if="isIconBg":name="category?.icon":color="category?.color":size="14"class="!w-6 p-1"invert/>+ <UiIconBase+ v-else+ :name="category?.icon"+ :color="category?.color"+ :size="14"+ class="!w-6 p-1"+ /></div><div>diff --git a/app/components/stat/categories/RoundSection.vue b/app/components/stat/categories/RoundSection.vueindex fb0ccaeb..8968209b 100644--- a/app/components/stat/categories/RoundSection.vue+++ b/app/components/stat/categories/RoundSection.vue@@ -18,13 +18,11 @@ const emit = defineEmits<{setCategoryFilter: [categoryId: CategoryId]}>()-const { t } = useI18n()const visibleCategoriesLimit = 12const { computeCategoriesWithData } = useStatCategories()const categoriesStore = useCategoriesStore()const statConfig = inject(statConfigKey)!-const isMenuOpen = ref(false)const isExpanded = computed(() => statConfig.config.value.catsRound.isExpanded)const isGrouped = computed(() => statConfig.config.value.catsRound.isGrouped)@@ -69,67 +67,20 @@ const filteredSet = computed(() => new Set(props.filteredCategoriesIds))</script><template>- <div class="flex items-start gap-1">- <div class="flex min-w-0 flex-1 flex-wrap justify-center gap-1 gap-y-2 @2xl/stat:justify-start">- <StatCategoriesRound2lines- v-for="item in visibleCategories"- :key="item.id"- :item="item"- :class="{- 'opacity-60': filteredSet.size > 0 && !filteredSet.has(item.id),- 'opacity-50': !filteredSet.has(item.id) && item.value === 0,- '!border-(--ui-primary)': filteredSet.has(item.id),- }"- class="transition-opacity"- isShowAmount- :isShowParent="false"- @click="emit('setCategoryFilter', item.id)"- />- </div>-- <div class="sticky top-0 shrink-0">- <UPopover- v-model:open="isMenuOpen"- :content="{- align: 'end',- side: 'bottom',- }"- >- <UiActionButton- :ariaLabel="t('base.moreOptions')"- class="aspect-square"- size="sm"- >- <Icon name="lucide:ellipsis" :size="20" />- </UiActionButton>-- <template #content>- <div class="min-w-52 p-1">- <UiSwitchItem- :checkboxValue="isGrouped"- :title="t('stat.config.categories.rounds.groupByParent')"- @click="statConfig.updateConfig('catsRound', { isGrouped: !isGrouped })"- />- <UiSwitchItem- :checkboxValue="isShowFavorites"- :title="t('stat.config.categories.rounds.showFavorites')"- @click="statConfig.updateConfig('catsRound', { isShowFavorites: !isShowFavorites })"- />- <UiSwitchItem- :checkboxValue="isShowRecent"- :title="t('stat.config.categories.rounds.showRecent')"- @click="statConfig.updateConfig('catsRound', { isShowRecent: !isShowRecent })"- />-- <UiSwitchItem- v-if="roundCategories.length > visibleCategoriesLimit"- :checkboxValue="isExpanded"- :title="t('base.toggleExpand')"- @click="statConfig.updateConfig('catsRound', { isExpanded: !isExpanded })"- />- </div>- </template>- </UPopover>- </div>+ <div class="flex min-w-0 flex-wrap justify-start gap-1 gap-y-2">+ <StatCategoriesRound2lines+ v-for="item in visibleCategories"+ :key="item.id"+ :item="item"+ :class="{+ 'opacity-60': filteredSet.size > 0 && !filteredSet.has(item.id),+ 'opacity-50': !filteredSet.has(item.id) && item.value === 0,+ '!border-(--ui-primary)': filteredSet.has(item.id),+ }"+ class="transition-opacity"+ isShowAmount+ :isShowParent="false"+ @click="emit('setCategoryFilter', item.id)"+ /></div></template>diff --git a/app/components/stat/categories/RoundSectionMenu.vue b/app/components/stat/categories/RoundSectionMenu.vuenew file mode 100644index 00000000..54fb2670--- /dev/null+++ b/app/components/stat/categories/RoundSectionMenu.vue@@ -0,0 +1,285 @@+<script setup lang="ts">+import type { CategoryId } from '~/components/categories/types'+import type { TrnId } from '~/components/trns/types'++import { useCategoriesStore } from '~/components/categories/useCategoriesStore'+import { useStatCategories } from '~/components/stat/categories/useStatCategories'+import { useStatChart } from '~/components/stat/chart/useStatChart'+import { statConfigKey } from '~/components/stat/injectionKeys'+import { chartViewOptions } from '~/components/stat/useStatConfig'++const props = defineProps<{+ filteredCategoriesIds: CategoryId[]+ preCategoriesIds?: CategoryId[]+ selectedTrnsIds?: TrnId[]+}>()++const { t } = useI18n()+const visibleCategoriesLimit = 12++const { computeCategoriesWithData } = useStatCategories()+const categoriesStore = useCategoriesStore()+const statConfig = inject(statConfigKey)!+const isMenuOpen = ref(false)+const isExpandedChartCard = ref(true)+const isExpandedRoundCard = ref(true)+const isExpandedListCard = ref(true)++const { chartTypeOptions } = useStatChart()+const isChartShow = computed(() => statConfig.config.value.isChartShow)++const isExpanded = computed(() => statConfig.config.value.catsRound.isExpanded)+const isGrouped = computed(() => statConfig.config.value.catsRound.isGrouped)+const isShowFavorites = computed(() => statConfig.config.value.catsRound.isShowFavorites)+const isShowRecent = computed(() => statConfig.config.value.catsRound.isShowRecent)++const isVerticalShow = computed(() => statConfig.config.value.vertical.isShow)+const isCatsRoundShow = computed(() => statConfig.config.value.catsRound.isShow)+const isCatsListShow = computed(() => statConfig.config.value.catsList.isShow)+const isTrnsShow = computed(() => statConfig.config.value.trns.isShow)++const mergedPreCategoriesIds = computed(() => {+ const ids: CategoryId[] = []+ const seen = new Set<CategoryId>()++ function addId(id: CategoryId) {+ if (!seen.has(id)) {+ seen.add(id)+ ids.push(id)+ }+ }++ if (props.preCategoriesIds) {+ for (const id of props.preCategoriesIds)+ addId(id)+ }++ if (isShowFavorites.value) {+ for (const id of categoriesStore.favoriteCategoriesIds)+ addId(id)+ }++ if (isShowRecent.value) {+ for (const id of categoriesStore.recentCategoriesIds)+ addId(id)+ }++ for (const id of props.filteredCategoriesIds)+ addId(id)++ return ids+})++const roundCategories = computed(() => computeCategoriesWithData(props.selectedTrnsIds ?? [], isGrouped.value, mergedPreCategoriesIds.value))++function toggleMaster(key: 'catsList' | 'catsRound' | 'trns' | 'vertical', current: boolean) {+ statConfig.updateConfig(key, { isShow: !current } as never)+}++function toggleChartShow() {+ statConfig.updateConfig('isChartShow', !isChartShow.value)+}+</script>++<template>+ <UPopover+ v-model:open="isMenuOpen"+ :content="{+ align: 'end',+ side: 'bottom',+ }"+ >+ <UiActionButton+ :ariaLabel="t('base.moreOptions')"+ class="aspect-square"+ size="sm"+ >+ <Icon name="lucide:ellipsis" :size="20" />+ </UiActionButton>++ <template #content>+ <div class="grid w-80 gap-2 overflow-y-auto p-2" style="max-height: var(--reka-popper-available-height, 80dvh)">+ <div class="grid gap-3">+ <!-- Chart -->+ <div class="overflow-hidden rounded-sm border border-(--ui-border)">+ <div class="flex items-stretch bg-(--item-4)" :class="{ 'pb-px': isExpandedChartCard }">+ <div+ class="flex grow cursor-pointer items-center gap-2 rounded-tr-sm rounded-br-sm px-3 py-2 hover:bg-(--item-3)"+ @click="isExpandedChartCard = !isExpandedChartCard"+ >+ <Icon+ :name="isExpandedChartCard ? 'lucide:chevron-down' : 'lucide:chevron-right'"+ size="18"+ />+ <div class="grow text-sm font-semibold">+ {{ t('stat.config.chartShow.title') }}+ </div>+ </div>+ <div+ class="flex shrink-0 cursor-pointer items-center rounded-tl-sm rounded-bl-sm px-3 hover:bg-(--item-3)"+ @click.stop="toggleChartShow"+ >+ <FormSwitch :value="isChartShow" />+ </div>+ </div>++ <div+ v-if="isExpandedChartCard"+ class="grid gap-2 p-2 transition-opacity"+ :class="{ 'pointer-events-none opacity-50': !isChartShow }"+ >+ <StatConfigSwitch+ configKey="date"+ field="isShowQuick"+ :title="t('stat.config.date.quick.label')"+ />+ <StatConfigSwitch+ configKey="chart"+ field="isShowAverage"+ :title="t('stat.config.chart.average.label')"+ />++ <!-- Chart: view (md+ only) -->+ <div class="hidden gap-2 md:grid">+ <UiTitleSection size="sm" class="px-1">+ {{ t('stat.config.chartView.label') }}+ </UiTitleSection>+ <UiTabsBar>+ <UiTabsItemPill+ v-for="view in chartViewOptions"+ :key="view"+ variant="outline"+ :isActive="statConfig.config.value.chartView === view"+ class="grow"+ @click="statConfig.updateConfig('chartView', view)"+ >+ {{ t(`stat.config.chartView.${view}`) }}+ </UiTabsItemPill>+ </UiTabsBar>+ </div>++ <!-- Chart: type -->+ <div class="grid gap-2">+ <UiTitleSection size="sm" class="px-1">+ {{ t('stat.config.chart.type.label') }}+ </UiTitleSection>+ <UiTabsBar>+ <UiTabsItemPill+ v-for="item in chartTypeOptions"+ :key="item.value"+ variant="outline"+ :isActive="statConfig.config.value.chartType === item.value"+ class="flex grow gap-1"+ @click="statConfig.updateConfig('chartType', item.value)"+ >+ <Icon :name="item.icon" :size="16" />+ {{ item.label }}+ </UiTabsItemPill>+ </UiTabsBar>+ </div>+ </div>+ </div>++ <!-- Round categories -->+ <div class="overflow-hidden rounded-sm border border-(--ui-border)">+ <div class="flex items-stretch bg-(--item-4)" :class="{ 'pb-px': isExpandedRoundCard }">+ <div+ class="flex grow cursor-pointer items-center gap-2 rounded-tr-sm rounded-br-sm px-3 py-2 hover:bg-(--item-3)"+ @click="isExpandedRoundCard = !isExpandedRoundCard"+ >+ <Icon+ :name="isExpandedRoundCard ? 'lucide:chevron-down' : 'lucide:chevron-right'"+ size="18"+ />+ <div class="grow text-sm font-semibold">+ {{ t('stat.config.categories.rounds.title') }}+ </div>+ </div>+ <div+ class="flex shrink-0 cursor-pointer items-center rounded-tl-sm rounded-bl-sm px-3 hover:bg-(--item-3)"+ @click.stop="toggleMaster('catsRound', isCatsRoundShow)"+ >+ <FormSwitch :value="isCatsRoundShow" />+ </div>+ </div>++ <div+ v-if="isExpandedRoundCard"+ class="grid gap-0.5 p-1 transition-opacity"+ :class="{ 'pointer-events-none opacity-50': !isCatsRoundShow }"+ >+ <UiSwitchItem+ :checkboxValue="isGrouped"+ :title="t('stat.config.categories.rounds.groupByParent')"+ @click="statConfig.updateConfig('catsRound', { isGrouped: !isGrouped })"+ />+ <UiSwitchItem+ :checkboxValue="isShowFavorites"+ :title="t('stat.config.categories.rounds.showFavorites')"+ @click="statConfig.updateConfig('catsRound', { isShowFavorites: !isShowFavorites })"+ />+ <UiSwitchItem+ :checkboxValue="isShowRecent"+ :title="t('stat.config.categories.rounds.showRecent')"+ @click="statConfig.updateConfig('catsRound', { isShowRecent: !isShowRecent })"+ />+ <StatConfigSwitch+ configKey="catsRound"+ field="isIconBg"+ :title="t('stat.catButtons.isRoundIcon')"+ />+ <UiSwitchItem+ v-if="roundCategories.length > visibleCategoriesLimit"+ :checkboxValue="isExpanded"+ :title="t('base.toggleExpand')"+ @click="statConfig.updateConfig('catsRound', { isExpanded: !isExpanded })"+ />+ </div>+ </div>++ <!-- List -->+ <div class="overflow-hidden rounded-sm border border-(--ui-border)">+ <div class="flex items-stretch bg-(--item-4)" :class="{ 'pb-px': isExpandedListCard }">+ <div+ class="flex grow cursor-pointer items-center gap-2 rounded-tr-sm rounded-br-sm px-3 py-2 hover:bg-(--item-3)"+ @click="isExpandedListCard = !isExpandedListCard"+ >+ <Icon+ :name="isExpandedListCard ? 'lucide:chevron-down' : 'lucide:chevron-right'"+ size="18"+ />+ <div class="grow text-sm font-semibold">+ {{ t('stat.config.categories.list.title') }}+ </div>+ </div>+ <div+ class="flex shrink-0 cursor-pointer items-center rounded-tl-sm rounded-bl-sm px-3 hover:bg-(--item-3)"+ @click.stop="toggleMaster('catsList', isCatsListShow)"+ >+ <FormSwitch :value="isCatsListShow" />+ </div>+ </div>++ <div+ v-if="isExpandedListCard"+ class="grid gap-0.5 p-1 transition-opacity"+ :class="{ 'pointer-events-none opacity-50': !isCatsListShow }"+ >+ <StatConfigSwitch configKey="catsList" field="isLines" :title="t('stat.catButtons.isLines')" />+ <StatConfigSwitch configKey="catsList" field="isRoundIcon" :title="t('stat.catButtons.isRoundIcon')" />+ </div>+ </div>++ </div>++ <div class="grid gap-0.5">+ <!-- Vertical -->+ <StatConfigSwitch configKey="vertical" field="isShow" :title="t('stat.config.categories.vertical.title')" />++ <!-- Transactions -->+ <StatConfigSwitch configKey="trns" field="isShow" :title="t('trns.title')" />+ </div>+ </div>+ </template>+ </UPopover>+</template>diff --git a/app/components/stat/statConfig.test.ts b/app/components/stat/statConfig.test.tsindex 73ba1bee..7551ccd4 100644--- a/app/components/stat/statConfig.test.ts+++ b/app/components/stat/statConfig.test.ts@@ -9,7 +9,6 @@ import { applyConfigUpdate } from './statConfig'const defaultConfig: MiniItemConfig = {catsList: {isGrouped: true,- isItemsBg: false,isLines: true,isRoundIcon: true,isShow: true,@@ -17,6 +16,7 @@ const defaultConfig: MiniItemConfig = {catsRound: {isExpanded: false,isGrouped: false,+ isIconBg: true,isShow: true,isShowFavorites: true,isShowRecent: true,diff --git a/app/components/stat/useStatConfig.ts b/app/components/stat/useStatConfig.tsindex 8a42c113..f20f7422 100644--- a/app/components/stat/useStatConfig.ts+++ b/app/components/stat/useStatConfig.ts@@ -12,7 +12,6 @@ export const chartViewOptions = ['half', 'full'] as constexport const ConfigSchema = z.object({catsList: z.object({isGrouped: z.boolean(),- isItemsBg: z.boolean(),isLines: z.boolean(),isRoundIcon: z.boolean(),isShow: z.boolean(),@@ -20,6 +19,7 @@ export const ConfigSchema = z.object({catsRound: z.object({isExpanded: z.boolean(),isGrouped: z.boolean(),+ isIconBg: z.boolean(),isShow: z.boolean(),isShowFavorites: z.boolean(),isShowRecent: z.boolean(),@@ -69,7 +69,6 @@ export function useStatConfig({ props, storageKey }: StatConfigParams) {const config = useStorage<MiniItemConfig>(configStorageKey.value, {catsList: {isGrouped: true,- isItemsBg: false,isLines: true,isRoundIcon: true,isShow: true,@@ -77,6 +76,7 @@ export function useStatConfig({ props, storageKey }: StatConfigParams) {catsRound: {isExpanded: true,isGrouped: false,+ isIconBg: true,isShow: true,isShowFavorites: false,isShowRecent: false,diff --git a/i18n/locales/en-US.js b/i18n/locales/en-US.jsindex ad785b4b..9d62c361 100644--- a/i18n/locales/en-US.js+++ b/i18n/locales/en-US.js@@ -280,14 +280,8 @@ export default {forLast: 'for the last periods',},catButtons: {- alt: 'Alternative',- elements: 'Elements',- isItemsBg: 'Items background',isLines: 'Amount lines',- isRoundIcon: 'rounded-sm categories',- listItemsOptions: 'List items options',- minimal: 'Minimal',- standard: 'Standard',+ isRoundIcon: 'Icons background',},config: {categories: {diff --git a/i18n/locales/ru-RU.js b/i18n/locales/ru-RU.jsindex 81640326..35c97ff5 100644--- a/i18n/locales/ru-RU.js+++ b/i18n/locales/ru-RU.js@@ -280,14 +280,8 @@ export default {forLast: 'за прошлые периоды',},catButtons: {- alt: 'Альтернативный',- elements: 'Элементы',- isItemsBg: 'Фон категорий',isLines: 'Линии сумм',- isRoundIcon: 'Скруглённые категории',- listItemsOptions: 'Настройки списка категорий',- minimal: 'Легкий',- standard: 'Стандартный',+ isRoundIcon: 'Фон иконок',},config: {categories: {