Skip to content

Open source personal finance application

feat(stat): redesign config modal with nested panel navigation

Ilya Komichevd42eeed72020
diff --git a/app/app/components/stat/ConfigModal.vue b/app/app/components/stat/ConfigModal.vue
index 863eebb1..a3a92768 100644
--- a/app/app/components/stat/ConfigModal.vue
+++ b/app/app/components/stat/ConfigModal.vue
@@ -1,4 +1,8 @@
<script setup lang="ts">
+import type { StatConfigPanelId } from '~/components/stat/types'
+
+import { statConfigPanelKey } from '~/components/stat/injectionKeys'
+
const props = defineProps<{
labelMode?: boolean
}>()
@@ -6,6 +10,14 @@ const props = defineProps<{
const { t } = useI18n()
const isOpen = ref(false)
+const activePanel = ref<StatConfigPanelId>('root')
+
+provide(statConfigPanelKey, activePanel)
+
+function onClose() {
+ isOpen.value = false
+ activePanel.value = 'root'
+}
</script>
<template>
@@ -14,7 +26,7 @@ const isOpen = ref(false)
:isOpen
isShowCloseBtn
@openModal="isOpen = true"
- @closeModal="isOpen = false"
+ @closeModal="onClose"
>
<template #trigger>
<UiHeaderLink
@@ -36,7 +48,7 @@ const isOpen = ref(false)
<template #content="{ close }">
<div
- class="grid gap-4 overflow-y-auto px-1 py-3 md:px-3 md:!pb-2"
+ class="grid gap-4 overflow-y-auto"
style="max-height: var(--reka-popper-available-height, 80dvh)"
>
<BottomSheetClose @click="close" />
diff --git a/app/app/components/stat/ConfigPanelHeader.vue b/app/app/components/stat/ConfigPanelHeader.vue
new file mode 100644
index 00000000..306200c3
--- /dev/null
+++ b/app/app/components/stat/ConfigPanelHeader.vue
@@ -0,0 +1,26 @@
+<script setup lang="ts">
+defineProps<{
+ title: string
+}>()
+
+const emit = defineEmits<{
+ back: []
+}>()
+
+const { t } = useI18n()
+</script>
+
+<template>
+ <div
+ role="button"
+ tabindex="0"
+ :aria-label="t('base.previous')"
+ class="hover:bg-elevated/50 sticky top-0 z-10 flex w-full items-center gap-2 rounded-sm bg-(--ui-bg) px-2 py-3 text-left"
+ @click="emit('back')"
+ @keydown.enter.prevent="emit('back')"
+ @keydown.space.prevent="emit('back')"
+ >
+ <Icon name="lucide:chevron-left" class="text-muted" size="20" />
+ <span class="text-toned grow text-sm font-medium">{{ title }}</span>
+ </div>
+</template>
diff --git a/app/app/components/stat/ConfigPanelToggle.vue b/app/app/components/stat/ConfigPanelToggle.vue
new file mode 100644
index 00000000..d2a6387d
--- /dev/null
+++ b/app/app/components/stat/ConfigPanelToggle.vue
@@ -0,0 +1,36 @@
+<script setup lang="ts">
+defineProps<{
+ description?: string
+ value?: boolean
+}>()
+
+defineEmits<{
+ toggle: []
+}>()
+
+const { t } = useI18n()
+</script>
+
+<template>
+ <div
+ v-if="value !== undefined"
+ role="switch"
+ tabindex="0"
+ :aria-checked="value"
+ class="hover:bg-elevated/50 bg-elevated/30 flex w-full items-center gap-3 rounded-lg px-4 py-3"
+ @click="$emit('toggle')"
+ @keydown.enter.prevent="$emit('toggle')"
+ @keydown.space.prevent="$emit('toggle')"
+ >
+ <span class="text-toned grow text-sm font-medium">
+ {{ value ? t('base.on') : t('base.off') }}
+ </span>
+ <FormSwitch :value="value" />
+ </div>
+ <p
+ v-if="description"
+ class="text-dimmed mt-2 mb-3 px-2 text-xs leading-snug whitespace-pre-line"
+ >
+ {{ description }}
+ </p>
+</template>
diff --git a/app/app/components/stat/ConfigRow.vue b/app/app/components/stat/ConfigRow.vue
new file mode 100644
index 00000000..23d15c98
--- /dev/null
+++ b/app/app/components/stat/ConfigRow.vue
@@ -0,0 +1,62 @@
+<script setup lang="ts">
+defineProps<{
+ hasPanel?: boolean
+ hasToggle?: boolean
+ isShow?: boolean
+ subtitle?: string
+ title: string
+}>()
+
+defineEmits<{
+ activate: []
+ toggle: []
+}>()
+</script>
+
+<template>
+ <div class="hover:bg-elevated/50 flex min-h-[52px] items-stretch rounded-sm text-sm">
+ <div
+ role="button"
+ tabindex="0"
+ class="flex grow flex-col justify-center rounded-l-sm py-3 pr-2 pl-3"
+ :class="!hasToggle && 'rounded-r-sm pr-3'"
+ @click="$emit('activate')"
+ @keydown.enter.prevent="$emit('activate')"
+ @keydown.space.prevent="$emit('activate')"
+ >
+ <div class="flex items-center gap-2">
+ <span>{{ title }}</span>
+ <Icon
+ v-if="hasPanel"
+ name="lucide:chevron-right"
+ class="text-muted shrink-0"
+ size="18"
+ />
+ </div>
+ <span
+ v-if="subtitle"
+ class="text-dimmed text-xs"
+ >
+ {{ subtitle }}
+ </span>
+ </div>
+ <div
+ v-if="hasToggle && hasPanel"
+ aria-hidden="true"
+ class="bg-accented my-4 w-px shrink-0"
+ />
+ <div
+ v-if="hasToggle"
+ role="switch"
+ tabindex="0"
+ :aria-checked="isShow"
+ class="flex shrink-0 items-center rounded-r-sm pr-3 pl-4"
+ :class="hasPanel && 'hover:bg-accented'"
+ @click.stop="$emit('toggle')"
+ @keydown.enter.stop.prevent="$emit('toggle')"
+ @keydown.space.stop.prevent="$emit('toggle')"
+ >
+ <FormSwitch :value="!!isShow" />
+ </div>
+ </div>
+</template>
diff --git a/app/app/components/stat/ConfigView.vue b/app/app/components/stat/ConfigView.vue
index 42fee0af..e67c7602 100644
--- a/app/app/components/stat/ConfigView.vue
+++ b/app/app/components/stat/ConfigView.vue
@@ -1,90 +1,97 @@
<script setup lang="ts">
-import { useStorage } from '@vueuse/core'
+import { useElementSize } from '@vueuse/core'
+import { AnimatePresence, Motion } from 'motion-v'
-import type { CategoryId } from '~/components/categories/types'
-import type { GroupingMode } from '~/components/stat/useStatConfig'
+import type { StatConfigPanelId } from '~/components/stat/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, groupingModes, resolveGrouped } from '~/components/stat/useStatConfig'
-import { useWalletsStore } from '~/components/wallets/useWalletsStore'
+import { statConfigKey, statConfigPanelKey } from '~/components/stat/injectionKeys'
-const props = withDefaults(defineProps<{
- filteredCategoriesIds?: CategoryId[]
+const props = defineProps<{
isShowWallets?: boolean
- preCategoriesIds?: CategoryId[]
selectedTrnsIds?: TrnId[]
-}>(), {
- filteredCategoriesIds: () => [],
-})
+}>()
-const { t } = useI18n()
-const visibleCategoriesLimit = 12
+const activePanel = inject(statConfigPanelKey, ref<StatConfigPanelId>('root'))
-const { computeCategoriesWithData } = useStatCategories()
-const categoriesStore = useCategoriesStore()
+const { locale, t } = useI18n()
const statConfig = inject(statConfigKey)!
-const walletsStore = useWalletsStore()
-const isExpandedChartCard = useStorage('stat-config-expanded-chart', false)
-const isExpandedRoundCard = useStorage('stat-config-expanded-round', false)
-const isExpandedListCard = useStorage('stat-config-expanded-list', false)
-const isExpandedWalletsCard = useStorage('stat-config-expanded-wallets', false)
-const isExpandedStatAverageCard = useStorage('stat-config-expanded-stat-average', false)
-const isExpandedGroupingCard = useStorage('stat-config-expanded-grouping', false)
-
-const { chartTypeOptions } = useStatChart()
-const isChartShow = computed(() => statConfig.config.value.isChartShow)
-
-const grouping = computed(() => statConfig.config.value.grouping)
-const isAutoGrouping = computed(() => grouping.value === 'auto')
-
-const isExpanded = computed(() => statConfig.config.value.catsRound.isExpanded)
-const isChartGrouped = computed(() => resolveGrouped(statConfig.config.value.chart.isGrouped, grouping.value))
-const isCatsRoundGrouped = computed(() => resolveGrouped(statConfig.config.value.catsRound.isGrouped, grouping.value))
-const isShowFavorites = computed(() => statConfig.config.value.catsRound.isShowFavorites)
-const isShowRecent = computed(() => statConfig.config.value.catsRound.isShowRecent)
+const isChartShow = computed(() => statConfig.config.value.isChartShow)
const isCatsRoundShow = computed(() => statConfig.config.value.catsRound.isShow)
const isCatsListShow = computed(() => statConfig.config.value.catsList.isShow)
-const mergedPreCategoriesIds = computed(() => {
- const ids: CategoryId[] = []
- const seen = new Set<CategoryId>()
+const hasTrnsConfig = computed(() => props.selectedTrnsIds !== undefined)
- 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)
- }
+const availablePanels = computed<StatConfigPanelId[]>(() => {
+ const panels: StatConfigPanelId[] = ['root', 'statAverage']
+ if (props.isShowWallets)
+ panels.push('wallets')
+ if (hasTrnsConfig.value)
+ panels.push('grouping', 'chart', 'catsRound', 'catsList', 'vertical')
+ return panels
+})
- if (isShowFavorites.value) {
- for (const id of categoriesStore.favoriteCategoriesIds)
- addId(id)
+watch(availablePanels, (panels) => {
+ if (!panels.includes(activePanel.value))
+ activePanel.value = 'root'
+}, { immediate: true })
+
+const panelTitle = computed<string>(() => {
+ switch (activePanel.value) {
+ case 'wallets':
+ return t('stat.config.wallets.title')
+ case 'statAverage':
+ return t('stat.config.statAverage.title')
+ case 'grouping':
+ return t('stat.config.grouping.label')
+ case 'chart':
+ return t('stat.config.chartShow.title')
+ case 'catsRound':
+ return t('stat.config.categories.rounds.title')
+ case 'catsList':
+ return t('stat.config.categories.list.title')
+ case 'vertical':
+ return t('stat.config.categories.vertical.title')
+ default:
+ return ''
}
+})
- if (isShowRecent.value) {
- for (const id of categoriesStore.recentCategoriesIds)
- addId(id)
+const panelDescription = computed<string>(() => {
+ switch (activePanel.value) {
+ case 'wallets':
+ return t('stat.config.wallets.description')
+ case 'statAverage':
+ return t('stat.config.statAverage.description')
+ case 'grouping':
+ return t('stat.config.grouping.description')
+ case 'catsRound':
+ return t('stat.config.categories.rounds.description')
+ case 'catsList':
+ return t('stat.config.categories.list.description')
+ default:
+ return ''
}
+})
- for (const id of props.filteredCategoriesIds)
- addId(id)
+const direction = ref<1 | -1>(1)
- return ids
-})
+function open(panel: StatConfigPanelId) {
+ if (panel === activePanel.value)
+ return
+ direction.value = 1
+ activePanel.value = panel
+}
-const roundCategories = computed(() => computeCategoriesWithData(props.selectedTrnsIds ?? [], isCatsRoundGrouped.value, mergedPreCategoriesIds.value))
+function back() {
+ if (activePanel.value === 'root')
+ return
+ direction.value = -1
+ activePanel.value = 'root'
+}
-function toggleMaster(key: 'catsList' | 'catsRound' | 'trns' | 'vertical', current: boolean) {
+function toggleSection<K extends 'catsList' | 'catsRound' | 'statAverage' | 'vertical' | 'wallets'>(key: K, current: boolean) {
statConfig.updateConfig(key, { isShow: !current } as never)
}
@@ -92,334 +99,247 @@ function toggleChartShow() {
statConfig.updateConfig('isChartShow', !isChartShow.value)
}
-function toggleGroupedWithReset(key: 'catsList' | 'catsRound' | 'chart', currentEffective: boolean) {
- if (!isAutoGrouping.value) {
- statConfig.updateConfig('grouping', 'auto')
- return
+const panelToggleValue = computed<boolean | undefined>(() => {
+ switch (activePanel.value) {
+ case 'wallets':
+ return statConfig.config.value.wallets.isShow
+ case 'statAverage':
+ return statConfig.config.value.statAverage.isShow
+ case 'chart':
+ return isChartShow.value
+ case 'catsRound':
+ return isCatsRoundShow.value
+ case 'catsList':
+ return isCatsListShow.value
+ case 'vertical':
+ return statConfig.config.value.vertical.isShow
+ default:
+ return undefined
+ }
+})
+
+function togglePanelSection() {
+ switch (activePanel.value) {
+ case 'wallets':
+ toggleSection('wallets', statConfig.config.value.wallets.isShow)
+ break
+ case 'statAverage':
+ toggleSection('statAverage', statConfig.config.value.statAverage.isShow)
+ break
+ case 'chart':
+ toggleChartShow()
+ break
+ case 'catsRound':
+ toggleSection('catsRound', isCatsRoundShow.value)
+ break
+ case 'catsList':
+ toggleSection('catsList', isCatsListShow.value)
+ break
+ case 'vertical':
+ toggleSection('vertical', statConfig.config.value.vertical.isShow)
+ break
}
- statConfig.updateConfig(key, { isGrouped: !currentEffective } as never)
}
-function setGrouping(mode: GroupingMode) {
- statConfig.updateConfig('grouping', mode)
+const rootRef = ref<HTMLElement>()
+const { height: rootHeight } = useElementSize(rootRef)
+
+const FALLBACK_MIN_HEIGHT = 360
+const lastRootHeight = ref(FALLBACK_MIN_HEIGHT)
+
+watchEffect(() => {
+ if (rootHeight.value > 0)
+ lastRootHeight.value = rootHeight.value
+})
+
+watch(
+ [locale, () => props.isShowWallets, () => props.selectedTrnsIds],
+ () => {
+ lastRootHeight.value = FALLBACK_MIN_HEIGHT
+ },
+)
+
+const stableMinHeight = computed(() => Math.max(lastRootHeight.value, FALLBACK_MIN_HEIGHT))
+
+const SLIDE_DISTANCE = 8
+const SLIDE_DURATION = 0.12
+const SLIDE_EASING = [0.4, 0, 0.2, 1] as const
+
+const panelVariants = {
+ center: { opacity: 1, x: 0 },
+ enter: (dir: 1 | -1) => ({ opacity: 0, x: dir * SLIDE_DISTANCE }),
+ exit: (dir: 1 | -1) => ({ opacity: 0, x: dir * -SLIDE_DISTANCE }),
+}
+
+const panelTransition = {
+ duration: SLIDE_DURATION,
+ ease: SLIDE_EASING,
+}
+
+type RootRow = {
+ isShow?: boolean
+ key: string
+ panel?: Exclude<StatConfigPanelId, 'root'>
+ subtitle?: string
+ title: string
+ toggle?: () => void
+}
+
+const rows = computed<RootRow[]>(() => {
+ const list: RootRow[] = []
+
+ if (props.isShowWallets) {
+ list.push({
+ isShow: statConfig.config.value.wallets.isShow,
+ key: 'wallets',
+ panel: 'wallets',
+ subtitle: t('stat.config.wallets.subtitle', { count: statConfig.config.value.wallets.count }),
+ title: t('stat.config.wallets.title'),
+ toggle: () => toggleSection('wallets', statConfig.config.value.wallets.isShow),
+ })
+ }
+
+ list.push({
+ isShow: statConfig.config.value.statAverage.isShow,
+ key: 'statAverage',
+ panel: 'statAverage',
+ subtitle: t('stat.config.statAverage.subtitle', { count: statConfig.config.value.statAverage.count }),
+ title: t('stat.config.statAverage.title'),
+ toggle: () => toggleSection('statAverage', statConfig.config.value.statAverage.isShow),
+ })
+
+ if (hasTrnsConfig.value) {
+ list.push({
+ isShow: isChartShow.value,
+ key: 'chart',
+ panel: 'chart',
+ title: t('stat.config.chartShow.title'),
+ toggle: toggleChartShow,
+ })
+ list.push({
+ key: 'grouping',
+ panel: 'grouping',
+ subtitle: t(`stat.config.grouping.${statConfig.config.value.grouping}`),
+ title: t('stat.config.grouping.label'),
+ })
+ list.push({
+ isShow: isCatsRoundShow.value,
+ key: 'catsRound',
+ panel: 'catsRound',
+ title: t('stat.config.categories.rounds.title'),
+ toggle: () => toggleSection('catsRound', isCatsRoundShow.value),
+ })
+ list.push({
+ isShow: isCatsListShow.value,
+ key: 'catsList',
+ panel: 'catsList',
+ title: t('stat.config.categories.list.title'),
+ toggle: () => toggleSection('catsList', isCatsListShow.value),
+ })
+ list.push({
+ isShow: statConfig.config.value.vertical.isShow,
+ key: 'vertical',
+ panel: 'vertical',
+ title: t('stat.config.categories.vertical.title'),
+ toggle: () => toggleSection('vertical', statConfig.config.value.vertical.isShow),
+ })
+ list.push({
+ isShow: statConfig.config.value.trns.isShow,
+ key: 'trns',
+ title: t('trns.title'),
+ toggle: () => statConfig.updateConfig('trns', { isShow: !statConfig.config.value.trns.isShow }),
+ })
+ }
+
+ return list
+})
+
+function onRowActivate(row: RootRow) {
+ if (row.panel)
+ open(row.panel)
+ else if (row.toggle)
+ row.toggle()
}
</script>
<template>
- <div class="grid gap-4">
- <!-- Wallets -->
- <div v-if="props.isShowWallets" class="border-default overflow-hidden rounded-xl border">
- <div class="hover:bg-elevated/50 flex items-stretch" :class="{ 'pb-px': isExpandedWalletsCard }">
- <div
- class="flex grow cursor-pointer rounded-tr-sm rounded-br-sm px-3 py-2"
- @click="isExpandedWalletsCard = !isExpandedWalletsCard"
- >
- <div class="flex items-center gap-1">
- <div class="text-toned text-sm leading-none font-medium tracking-wide">
- {{ t('stat.config.wallets.title') }}
- </div>
- <Icon
- :name="isExpandedWalletsCard ? 'lucide:chevron-down' : 'lucide:chevron-right'"
- size="18"
- class="text-muted mt-px"
- />
- </div>
- </div>
- <div class="mx-1 my-1 h-auto w-px bg-[var(--ui-border)]" />
- <div class="hover:bg-muted/30 flex h-auto shrink-0 cursor-pointer items-center rounded-tl-sm rounded-bl-sm px-3" @click.stop="statConfig.updateConfig('wallets', { isShow: !statConfig.config.value.wallets.isShow })">
- <FormSwitch :value="statConfig.config.value.wallets.isShow" />
- </div>
- </div>
- <div v-if="isExpandedWalletsCard" class="p-2 transition-opacity" :class="{ 'pointer-events-none opacity-50': !statConfig.config.value.wallets.isShow }">
- <UiNumberStepper
- :modelValue="statConfig.config.value.wallets.count"
- :min="1"
- :max="walletsStore.sortedIds.length"
- @update:modelValue="value => statConfig.updateConfig('wallets', { count: value })"
- />
- </div>
- </div>
-
- <!-- Statistics -->
- <div class="border-default overflow-hidden rounded-xl border">
- <div class="hover:bg-elevated/50 flex items-stretch" :class="{ 'pb-px': isExpandedStatAverageCard }">
+ <div
+ class="statConfigPanel"
+ :style="{ minHeight: `${stableMinHeight}px` }"
+ >
+ <AnimatePresence
+ :custom="direction"
+ mode="wait"
+ :initial="false"
+ >
+ <Motion
+ :key="activePanel"
+ :custom="direction"
+ :variants="panelVariants"
+ initial="enter"
+ animate="center"
+ exit="exit"
+ :transition="panelTransition"
+ >
<div
- class="flex grow cursor-pointer rounded-tr-sm rounded-br-sm px-3 py-2"
- @click="isExpandedStatAverageCard = !isExpandedStatAverageCard"
+ v-if="activePanel === 'root'"
+ ref="rootRef"
+ class="grid"
>
- <div class="flex items-center gap-1">
- <div class="text-toned text-sm leading-none font-medium tracking-wide">
- {{ t('statistics.title') }}
- </div>
- <Icon
- :name="isExpandedStatAverageCard ? 'lucide:chevron-down' : 'lucide:chevron-right'"
- size="18"
- class="text-muted mt-px"
- />
- </div>
- </div>
- <div class="mx-1 my-1 h-auto w-px bg-[var(--ui-border)]" />
- <div class="hover:bg-muted/30 flex h-auto shrink-0 cursor-pointer items-center rounded-tl-sm rounded-bl-sm px-3" @click.stop="statConfig.updateConfig('statAverage', { isShow: !statConfig.config.value.statAverage.isShow })">
- <FormSwitch :value="statConfig.config.value.statAverage.isShow" />
- </div>
- </div>
- <div v-if="isExpandedStatAverageCard" class="p-2 transition-opacity" :class="{ 'pointer-events-none opacity-50': !statConfig.config.value.statAverage.isShow }">
- <UiNumberStepper
- :modelValue="statConfig.config.value.statAverage.count"
- :min="1"
- @update:modelValue="value => statConfig.updateConfig('statAverage', { count: value })"
- />
- </div>
- </div>
-
- <div
- v-if="props.selectedTrnsIds"
- class="grid gap-2"
- >
- <!-- Global grouping -->
- <div class="border-default overflow-hidden rounded-xl border">
- <div class="hover:bg-elevated/50 flex items-stretch">
- <div
- class="flex grow cursor-pointer rounded-tr-sm rounded-br-sm px-3 py-2"
- @click="isExpandedGroupingCard = !isExpandedGroupingCard"
+ <template
+ v-for="(row, i) in rows"
+ :key="row.key"
>
- <div class="flex items-center gap-1">
- <div class="text-toned text-sm leading-none font-medium tracking-wide">
- {{ t('stat.config.grouping.label') }}
- </div>
- <Icon
- :name="isExpandedGroupingCard ? 'lucide:chevron-down' : 'lucide:chevron-right'"
- size="18"
- class="text-muted mt-px"
- />
- </div>
- </div>
- </div>
- <div v-if="isExpandedGroupingCard" class="p-2 transition-opacity">
- <UiTabsBar>
- <UiTabsItemPill
- v-for="mode in groupingModes"
- :key="mode"
- variant="outline"
- :isActive="grouping === mode"
- class="grow"
- @click="setGrouping(mode)"
- >
- {{ t(`stat.config.grouping.${mode}`) }}
- </UiTabsItemPill>
- </UiTabsBar>
- </div>
- </div>
-
- <div class="grid gap-3">
- <!-- Chart -->
- <div class="border-default overflow-hidden rounded-xl border">
- <div class="hover:bg-elevated/50 flex items-stretch" :class="{ 'pb-px': isExpandedChartCard }">
- <div
- class="flex grow cursor-pointer rounded-tr-sm rounded-br-sm px-3 py-2"
- @click="isExpandedChartCard = !isExpandedChartCard"
- >
- <div class="flex items-center gap-1">
- <div class="text-toned text-sm leading-none font-medium tracking-wide">
- {{ t('stat.config.chartShow.title') }}
- </div>
- <Icon
- :name="isExpandedChartCard ? 'lucide:chevron-down' : 'lucide:chevron-right'"
- size="18"
- class="text-muted mt-px"
- />
- </div>
- </div>
-
- <div class="mx-1 my-1 h-auto w-px bg-[var(--ui-border)]" />
- <div
- class="hover:bg-muted/30 flex h-auto shrink-0 cursor-pointer items-center rounded-tl-sm rounded-bl-sm px-3"
- @click.stop="toggleChartShow"
- >
- <FormSwitch :value="isChartShow" />
- </div>
- </div>
-
- <div
- v-if="isExpandedChartCard"
- class="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')"
- />
- <UiSwitchItem
- :checkboxValue="statConfig.config.value.chart.mode === 'categories'"
- :title="t('stat.config.chart.byCategories')"
- @click="statConfig.updateConfig('chart', { mode: statConfig.config.value.chart.mode === 'categories' ? 'aggregated' : 'categories' })"
- />
- <UiSwitchItem
- v-if="statConfig.config.value.chart.mode === 'categories'"
- :checkboxValue="isChartGrouped"
- :title="t('stat.config.chart.groupByParent')"
- @click="toggleGroupedWithReset('chart', isChartGrouped)"
- />
-
- <!-- Chart: view (md+ only) -->
- <div class="grid gap-4 pt-4">
- <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>
- </div>
-
- <!-- Round categories -->
- <div class="border-default overflow-hidden rounded-xl border">
- <div class="hover:bg-elevated/50 flex items-stretch" :class="{ 'pb-px': isExpandedRoundCard }">
<div
- class="flex grow cursor-pointer rounded-tr-sm rounded-br-sm px-3 py-2"
- @click="isExpandedRoundCard = !isExpandedRoundCard"
- >
- <div class="flex items-center gap-1">
- <div class="text-toned text-sm leading-none font-medium tracking-wide">
- {{ t('stat.config.categories.rounds.title') }}
- </div>
- <Icon
- :name="isExpandedRoundCard ? 'lucide:chevron-down' : 'lucide:chevron-right'"
- size="18"
- class="text-muted mt-px"
- />
- </div>
- </div>
- <div
- class="mx-1 my-1 h-auto w-px bg-[var(--ui-border)]"
- />
- <div
- class="hover:bg-muted/30 flex shrink-0 cursor-pointer items-center rounded-tl-sm rounded-bl-sm px-3"
- @click.stop="toggleMaster('catsRound', isCatsRoundShow)"
- >
- <FormSwitch :value="isCatsRoundShow" />
- </div>
- </div>
-
- <div
- v-if="isExpandedRoundCard"
- class="grid gap-0.5 p-2 transition-opacity"
- :class="{ 'pointer-events-none opacity-50': !isCatsRoundShow }"
- >
- <UiSwitchItem
- :checkboxValue="isCatsRoundGrouped"
- :title="t('stat.config.categories.rounds.groupByParent')"
- @click="toggleGroupedWithReset('catsRound', isCatsRoundGrouped)"
- />
- <UiSwitchItem
- :checkboxValue="isShowFavorites"
- :title="t('stat.config.categories.rounds.showFavorites')"
- @click="statConfig.updateConfig('catsRound', { isShowFavorites: !isShowFavorites })"
+ v-if="i > 0"
+ aria-hidden="true"
+ class="bg-elevated/50 mx-2 h-px"
/>
- <UiSwitchItem
- :checkboxValue="isShowRecent"
- :title="t('stat.config.categories.rounds.showRecent')"
- @click="statConfig.updateConfig('catsRound', { isShowRecent: !isShowRecent })"
+ <StatConfigRow
+ :hasPanel="!!row.panel"
+ :hasToggle="!!row.toggle"
+ :isShow="row.isShow"
+ :subtitle="row.subtitle"
+ :title="row.title"
+ @activate="onRowActivate(row)"
+ @toggle="row.toggle?.()"
/>
- <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>
+ </template>
</div>
- <!-- List -->
- <div class="border-default overflow-hidden rounded-xl border">
- <div class="hover:bg-elevated/50 flex items-stretch" :class="{ 'pb-px': isExpandedListCard }">
- <div
- class="flex grow cursor-pointer rounded-tr-sm rounded-br-sm px-3 py-2"
- @click="isExpandedListCard = !isExpandedListCard"
- >
- <div class="flex items-center gap-1">
- <div class="text-toned text-sm leading-none font-medium tracking-wide">
- {{ t('stat.config.categories.list.title') }}
- </div>
- <Icon
- :name="isExpandedListCard ? 'lucide:chevron-down' : 'lucide:chevron-right'"
- size="18"
- class="text-muted mt-px"
- />
- </div>
- </div>
- <div
- class="mx-1 my-1 h-auto w-px bg-[var(--ui-border)]"
- />
- <div
- class="hover:bg-muted/30 flex shrink-0 cursor-pointer items-center rounded-tl-sm rounded-bl-sm px-3"
- @click.stop="toggleMaster('catsList', isCatsListShow)"
- >
- <FormSwitch :value="isCatsListShow" @click="toggleMaster('catsList', isCatsListShow)" />
- </div>
- </div>
-
- <div
- v-if="isExpandedListCard"
- class="grid gap-0.5 p-2 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 v-else>
+ <StatConfigPanelHeader
+ :title="panelTitle"
+ @back="back"
+ />
+ <StatConfigPanelToggle
+ :description="panelDescription"
+ :value="panelToggleValue"
+ @toggle="togglePanelSection"
+ />
+ <StatConfigPanelsWallets
+ v-if="activePanel === 'wallets'"
+ />
+ <StatConfigPanelsStatAverage
+ v-else-if="activePanel === 'statAverage'"
+ />
+ <StatConfigPanelsGrouping
+ v-else-if="activePanel === 'grouping'"
+ />
+ <StatConfigPanelsChart
+ v-else-if="activePanel === 'chart'"
+ />
+ <StatConfigPanelsCatsRound
+ v-else-if="activePanel === 'catsRound'"
+ />
+ <StatConfigPanelsCatsList
+ v-else-if="activePanel === 'catsList'"
+ />
+ <StatConfigPanelsVertical
+ v-else-if="activePanel === 'vertical'"
+ />
</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>
+ </Motion>
+ </AnimatePresence>
</div>
</template>
diff --git a/app/app/components/stat/Header.vue b/app/app/components/stat/Header.vue
index f74ca75e..d84baa51 100644
--- a/app/app/components/stat/Header.vue
+++ b/app/app/components/stat/Header.vue
@@ -75,7 +75,6 @@ function onClickWallet(walletId: WalletId) {
<StatConfigModal>
<StatConfigView
:isShowWallets="!!configWallets"
- :preCategoriesIds="props.preCategoriesIds"
:selectedTrnsIds="categoryConfigTrnsIds"
/>
</StatConfigModal>
diff --git a/app/app/components/stat/categories/RoundSection.vue b/app/app/components/stat/categories/RoundSection.vue
index 338eabc5..815084d5 100644
--- a/app/app/components/stat/categories/RoundSection.vue
+++ b/app/app/components/stat/categories/RoundSection.vue
@@ -19,13 +19,10 @@ const emit = defineEmits<{
setCategoryFilter: [categoryId: CategoryId]
}>()
-const visibleCategoriesLimit = 12
-
const { computeCategoriesWithData } = useStatCategories()
const categoriesStore = useCategoriesStore()
const statConfig = inject(statConfigKey)!
-const isExpanded = computed(() => statConfig.config.value.catsRound.isExpanded)
const isGrouped = computed(() => resolveGrouped(statConfig.config.value.catsRound.isGrouped, statConfig.config.value.grouping))
const isShowFavorites = computed(() => statConfig.config.value.catsRound.isShowFavorites)
const isShowRecent = computed(() => statConfig.config.value.catsRound.isShowRecent)
@@ -63,14 +60,13 @@ const mergedPreCategoriesIds = computed(() => {
})
const roundCategories = computed(() => computeCategoriesWithData(props.selectedTrnsIds ?? [], isGrouped.value, mergedPreCategoriesIds.value))
-const visibleCategories = computed(() => isExpanded.value ? roundCategories.value : roundCategories.value.slice(0, visibleCategoriesLimit))
const filteredSet = computed(() => new Set(props.filteredCategoriesIds))
</script>
<template>
<div class="flex min-w-0 flex-wrap justify-start gap-1 gap-y-2">
<StatCategoriesRound
- v-for="item in visibleCategories"
+ v-for="item in roundCategories"
:key="item.id"
:item="item"
:class="{
diff --git a/app/app/components/stat/configPanels/CatsList.vue b/app/app/components/stat/configPanels/CatsList.vue
new file mode 100644
index 00000000..f7a3187a
--- /dev/null
+++ b/app/app/components/stat/configPanels/CatsList.vue
@@ -0,0 +1,26 @@
+<script setup lang="ts">
+import { statConfigKey } from '~/components/stat/injectionKeys'
+
+const { t } = useI18n()
+const statConfig = inject(statConfigKey)!
+
+const isCatsListShow = computed(() => statConfig.config.value.catsList.isShow)
+</script>
+
+<template>
+ <div
+ class="grid gap-0.5 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>
+</template>
diff --git a/app/app/components/stat/configPanels/CatsRound.vue b/app/app/components/stat/configPanels/CatsRound.vue
new file mode 100644
index 00000000..989a5820
--- /dev/null
+++ b/app/app/components/stat/configPanels/CatsRound.vue
@@ -0,0 +1,50 @@
+<script setup lang="ts">
+import { statConfigKey } from '~/components/stat/injectionKeys'
+import { resolveGrouped } from '~/components/stat/useStatConfig'
+
+const { t } = useI18n()
+const statConfig = inject(statConfigKey)!
+
+const grouping = computed(() => statConfig.config.value.grouping)
+const isAutoGrouping = computed(() => grouping.value === 'auto')
+const isCatsRoundShow = computed(() => statConfig.config.value.catsRound.isShow)
+const isCatsRoundGrouped = computed(() => resolveGrouped(statConfig.config.value.catsRound.isGrouped, grouping.value))
+const isShowFavorites = computed(() => statConfig.config.value.catsRound.isShowFavorites)
+const isShowRecent = computed(() => statConfig.config.value.catsRound.isShowRecent)
+
+function toggleGroupedWithReset(currentEffective: boolean) {
+ if (!isAutoGrouping.value) {
+ statConfig.updateConfig('grouping', 'auto')
+ return
+ }
+ statConfig.updateConfig('catsRound', { isGrouped: !currentEffective })
+}
+</script>
+
+<template>
+ <div
+ class="grid gap-0.5 transition-opacity"
+ :class="{ 'pointer-events-none opacity-50': !isCatsRoundShow }"
+ >
+ <UiSwitchItem
+ :checkboxValue="isCatsRoundGrouped"
+ :title="t('stat.config.categories.rounds.groupByParent')"
+ @click="toggleGroupedWithReset(isCatsRoundGrouped)"
+ />
+ <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')"
+ />
+ </div>
+</template>
diff --git a/app/app/components/stat/configPanels/Chart.vue b/app/app/components/stat/configPanels/Chart.vue
new file mode 100644
index 00000000..d58a6bb2
--- /dev/null
+++ b/app/app/components/stat/configPanels/Chart.vue
@@ -0,0 +1,90 @@
+<script setup lang="ts">
+import { useStatChart } from '~/components/stat/chart/useStatChart'
+import { statConfigKey } from '~/components/stat/injectionKeys'
+import { chartViewOptions, resolveGrouped } from '~/components/stat/useStatConfig'
+
+const { t } = useI18n()
+const statConfig = inject(statConfigKey)!
+const { chartTypeOptions } = useStatChart()
+
+const isChartShow = computed(() => statConfig.config.value.isChartShow)
+const grouping = computed(() => statConfig.config.value.grouping)
+const isAutoGrouping = computed(() => grouping.value === 'auto')
+const isChartGrouped = computed(() => resolveGrouped(statConfig.config.value.chart.isGrouped, grouping.value))
+
+function toggleGroupedWithReset(currentEffective: boolean) {
+ if (!isAutoGrouping.value) {
+ statConfig.updateConfig('grouping', 'auto')
+ return
+ }
+ statConfig.updateConfig('chart', { isGrouped: !currentEffective })
+}
+</script>
+
+<template>
+ <div
+ class="grid gap-0.5 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')"
+ />
+ <UiSwitchItem
+ :checkboxValue="statConfig.config.value.chart.mode === 'categories'"
+ :title="t('stat.config.chart.byCategories')"
+ @click="statConfig.updateConfig('chart', { mode: statConfig.config.value.chart.mode === 'categories' ? 'aggregated' : 'categories' })"
+ />
+ <UiSwitchItem
+ v-if="statConfig.config.value.chart.mode === 'categories'"
+ :checkboxValue="isChartGrouped"
+ :title="t('stat.config.chart.groupByParent')"
+ @click="toggleGroupedWithReset(isChartGrouped)"
+ />
+
+ <div class="grid gap-4 pt-4">
+ <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>
+
+ <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>
+</template>
diff --git a/app/app/components/stat/configPanels/Grouping.vue b/app/app/components/stat/configPanels/Grouping.vue
new file mode 100644
index 00000000..8ec8b3fc
--- /dev/null
+++ b/app/app/components/stat/configPanels/Grouping.vue
@@ -0,0 +1,32 @@
+<script setup lang="ts">
+import type { GroupingMode } from '~/components/stat/useStatConfig'
+
+import { statConfigKey } from '~/components/stat/injectionKeys'
+import { groupingModes } from '~/components/stat/useStatConfig'
+
+const { t } = useI18n()
+const statConfig = inject(statConfigKey)!
+
+const grouping = computed(() => statConfig.config.value.grouping)
+
+function setGrouping(mode: GroupingMode) {
+ statConfig.updateConfig('grouping', mode)
+}
+</script>
+
+<template>
+ <div class="grid gap-3">
+ <UiTabsBar>
+ <UiTabsItemPill
+ v-for="mode in groupingModes"
+ :key="mode"
+ variant="outline"
+ :isActive="grouping === mode"
+ class="grow"
+ @click="setGrouping(mode)"
+ >
+ {{ t(`stat.config.grouping.${mode}`) }}
+ </UiTabsItemPill>
+ </UiTabsBar>
+ </div>
+</template>
diff --git a/app/app/components/stat/configPanels/StatAverage.vue b/app/app/components/stat/configPanels/StatAverage.vue
new file mode 100644
index 00000000..7d5b77ac
--- /dev/null
+++ b/app/app/components/stat/configPanels/StatAverage.vue
@@ -0,0 +1,18 @@
+<script setup lang="ts">
+import { statConfigKey } from '~/components/stat/injectionKeys'
+
+const statConfig = inject(statConfigKey)!
+</script>
+
+<template>
+ <div
+ class="grid gap-3 transition-opacity"
+ :class="{ 'pointer-events-none opacity-50': !statConfig.config.value.statAverage.isShow }"
+ >
+ <UiNumberStepper
+ :modelValue="statConfig.config.value.statAverage.count"
+ :min="1"
+ @update:modelValue="value => statConfig.updateConfig('statAverage', { count: value })"
+ />
+ </div>
+</template>
diff --git a/app/app/components/stat/configPanels/Vertical.vue b/app/app/components/stat/configPanels/Vertical.vue
new file mode 100644
index 00000000..30b13ff8
--- /dev/null
+++ b/app/app/components/stat/configPanels/Vertical.vue
@@ -0,0 +1,22 @@
+<script setup lang="ts">
+import { statConfigKey } from '~/components/stat/injectionKeys'
+
+const { t } = useI18n()
+const statConfig = inject(statConfigKey)!
+
+const isShow = computed(() => statConfig.config.value.vertical.isShow)
+const isGrouped = computed(() => statConfig.config.value.vertical.isGrouped)
+</script>
+
+<template>
+ <div
+ class="grid gap-0.5 transition-opacity"
+ :class="{ 'pointer-events-none opacity-50': !isShow }"
+ >
+ <UiSwitchItem
+ :checkboxValue="isGrouped"
+ :title="t('stat.config.categories.vertical.groupByParent')"
+ @click="statConfig.updateConfig('vertical', { isGrouped: !isGrouped })"
+ />
+ </div>
+</template>
diff --git a/app/app/components/stat/configPanels/Wallets.vue b/app/app/components/stat/configPanels/Wallets.vue
new file mode 100644
index 00000000..f1d9eccf
--- /dev/null
+++ b/app/app/components/stat/configPanels/Wallets.vue
@@ -0,0 +1,21 @@
+<script setup lang="ts">
+import { statConfigKey } from '~/components/stat/injectionKeys'
+import { useWalletsStore } from '~/components/wallets/useWalletsStore'
+
+const statConfig = inject(statConfigKey)!
+const walletsStore = useWalletsStore()
+</script>
+
+<template>
+ <div
+ class="grid gap-3 transition-opacity"
+ :class="{ 'pointer-events-none opacity-50': !statConfig.config.value.wallets.isShow }"
+ >
+ <UiNumberStepper
+ :modelValue="statConfig.config.value.wallets.count"
+ :min="1"
+ :max="walletsStore.sortedIds.length"
+ @update:modelValue="value => statConfig.updateConfig('wallets', { count: value })"
+ />
+ </div>
+</template>
diff --git a/app/app/components/stat/injectionKeys.ts b/app/app/components/stat/injectionKeys.ts
index 7d8cf480..f08f4597 100644
--- a/app/app/components/stat/injectionKeys.ts
+++ b/app/app/components/stat/injectionKeys.ts
@@ -1,9 +1,11 @@
-import type { InjectionKey } from 'vue'
+import type { InjectionKey, Ref } from 'vue'
import type { StatDateProvider } from '~/components/date/types'
import type { FilterProvider } from '~/components/stat/filter/types'
+import type { StatConfigPanelId } from '~/components/stat/types'
import type { StatConfigProvider } from '~/components/stat/useStatConfig'
export const filterKey: InjectionKey<FilterProvider> = Symbol('filter')
export const statDateKey: InjectionKey<StatDateProvider> = Symbol('statDate')
export const statConfigKey: InjectionKey<StatConfigProvider> = Symbol('statConfig')
+export const statConfigPanelKey: InjectionKey<Ref<StatConfigPanelId>> = Symbol('statConfigPanel')
diff --git a/app/app/components/stat/statConfig.test.ts b/app/app/components/stat/statConfig.test.ts
index 76f9cb44..5d675c26 100644
--- a/app/app/components/stat/statConfig.test.ts
+++ b/app/app/components/stat/statConfig.test.ts
@@ -14,7 +14,6 @@ const defaultConfig: MiniItemConfig = {
isShow: true,
},
catsRound: {
- isExpanded: false,
isGrouped: false,
isIconBg: true,
isShow: true,
diff --git a/app/app/components/stat/types.ts b/app/app/components/stat/types.ts
index 52618df9..14b831fe 100644
--- a/app/app/components/stat/types.ts
+++ b/app/app/components/stat/types.ts
@@ -10,6 +10,16 @@ export type SeriesSlug = 'income' | 'expense'
export type SeriesSlugSelected = 'income' | 'expense' | 'netIncome'
export type MoneyTypeNumber = 0 | 1 | 2
+export type StatConfigPanelId
+ = | 'root'
+ | 'wallets'
+ | 'statAverage'
+ | 'grouping'
+ | 'chart'
+ | 'catsRound'
+ | 'catsList'
+ | 'vertical'
+
type CategoryWithDataBase = {
id: CategoryId
name: CategoryItem['name']
diff --git a/app/app/components/stat/useStatConfig.ts b/app/app/components/stat/useStatConfig.ts
index 60789957..ba831d66 100644
--- a/app/app/components/stat/useStatConfig.ts
+++ b/app/app/components/stat/useStatConfig.ts
@@ -28,7 +28,6 @@ export const ConfigSchema = z.object({
isShow: z.boolean(),
}),
catsRound: z.object({
- isExpanded: z.boolean(),
isGrouped: z.boolean(),
isIconBg: z.boolean(),
isShow: z.boolean(),
@@ -88,7 +87,6 @@ export function useStatConfig({ props, storageKey }: StatConfigParams) {
isShow: true,
},
catsRound: {
- isExpanded: true,
isGrouped: false,
isIconBg: true,
isShow: true,
diff --git a/app/i18n/locales/en-US.js b/app/i18n/locales/en-US.js
index f0cdaed1..83dd1b54 100644
--- a/app/i18n/locales/en-US.js
+++ b/app/i18n/locales/en-US.js
@@ -42,6 +42,8 @@ export default {
next: 'Next',
no: 'No',
noData: 'No data',
+ off: 'Off',
+ on: 'On',
open: 'Open',
previous: 'Previous',
save: 'Save',
@@ -304,16 +306,19 @@ export default {
config: {
categories: {
list: {
- title: 'List categories',
+ description: 'Detailed list of all categories for the period with amounts, shares, and transaction counts.',
+ title: 'Categories list',
},
rounds: {
+ description: 'Strip of round category icons: favorites, recently used.',
groupByParent: 'Group by parent',
showFavorites: 'Show favorites',
showRecent: 'Show recent',
- title: 'Rounds categories',
+ title: 'Quick categories',
},
vertical: {
- title: 'Vertical chart',
+ groupByParent: 'Group by parent',
+ title: 'Comparison bars',
},
},
chart: {
@@ -328,7 +333,7 @@ export default {
},
chartShow: {
label: 'Show chart',
- title: 'Chart',
+ title: 'Main chart',
},
chartView: {
full: 'Full',
@@ -343,7 +348,8 @@ export default {
grouping: {
auto: 'Auto',
children: 'With children',
- label: 'Show categories',
+ description: 'Auto - each block uses its own setting.\nParents only - subcategory amounts roll up into the parent.\nWith children - every subcategory shown as a separate row.',
+ label: 'Categories grouping',
parents: 'Parents only',
},
menu: {
@@ -356,9 +362,14 @@ export default {
count: {
label: 'Show average values',
},
+ description: 'Arithmetic mean over the chosen number of past periods. Displayed next to the period total.',
+ subtitle: 'Average over last {count} periods',
+ title: 'Average totals',
},
wallets: {
+ description: 'Quick access to the first N wallets from the full list. Order is set on the Wallets page.',
label: 'Show wallets',
+ subtitle: 'Top {count}',
title: 'Wallets',
},
},
diff --git a/app/i18n/locales/ru-RU.js b/app/i18n/locales/ru-RU.js
index c9fa5c75..3fa43d3c 100644
--- a/app/i18n/locales/ru-RU.js
+++ b/app/i18n/locales/ru-RU.js
@@ -42,6 +42,8 @@ export default {
next: 'Вперёд',
no: 'Нет',
noData: 'Нет данных',
+ off: 'Откл.',
+ on: 'Вкл.',
open: 'Открыть',
previous: 'Назад',
save: 'Сохранить',
@@ -304,16 +306,19 @@ export default {
config: {
categories: {
list: {
+ description: 'Развёрнутый список всех категорий за период с суммами, долями и количеством транзакций.',
title: 'Список категорий',
},
rounds: {
+ description: 'Лента круглых иконок: избранные, недавно используемые.',
groupByParent: 'Группировать по родителю',
showFavorites: 'Показывать избранные',
showRecent: 'Показывать недавние',
- title: 'Круглые категории',
+ title: 'Быстрые категории',
},
vertical: {
- title: 'Вертикальный график',
+ groupByParent: 'Группировка по родителю',
+ title: 'Колонки сравнения',
},
},
chart: {
@@ -328,7 +333,7 @@ export default {
},
chartShow: {
label: 'Показывать график',
- title: 'График',
+ title: 'Основной график',
},
chartView: {
full: 'Широкий',
@@ -343,7 +348,8 @@ export default {
grouping: {
auto: 'Авто',
children: 'С вложенными',
- label: 'Показывать категории',
+ description: 'Авто - каждый блок использует собственную настройку.\nТолько родители - суммы подкатегорий добавляются к родителю.\nС вложенными - каждая подкатегория отдельной строкой.',
+ label: 'Группировка категорий',
parents: 'Только родители',
},
menu: {
@@ -356,9 +362,14 @@ export default {
count: {
label: 'Показывать средние значения',
},
+ description: 'Среднее арифметическое сумм за выбранное число прошлых периодов. Показывается рядом с итогом за период.',
+ subtitle: 'Среднее за {count} прошлых периодов',
+ title: 'Средние суммы',
},
wallets: {
+ description: 'Быстрый доступ к первым N кошелькам из общего списка. Порядок задаётся на странице «Кошельки».',
label: 'Показывать кошельки',
+ subtitle: 'Топ {count}',
title: 'Кошельки',
},
},