Skip to content

Open source personal finance application

ui(Stat): update

ilkomee2ed1ac6b660
diff --git a/components/stat/group/Trns.vue b/components/stat/group/Trns.vue
index 2894bd86..e40f1122 100644
--- a/components/stat/group/Trns.vue
+++ b/components/stat/group/Trns.vue
@@ -6,7 +6,7 @@ defineProps<{
</script>
<template lang="pug">
-.my-4(class="max-w-[420px]")
+.my-6(class="max-w-[420px]")
.pb-2.text-lg.leading-none.font-nunito.font-semibold.text-skin-item-base {{ $t('trns.inPeriodTitle') }}
TrnsList(
diff --git a/components/stat/laptop/View.vue b/components/stat/laptop/View.vue
index 2fba3d20..3ae8cbc3 100644
--- a/components/stat/laptop/View.vue
+++ b/components/stat/laptop/View.vue
@@ -110,16 +110,20 @@ onDeactivated(async () => {
template(v-if="statPage.activeTab === 'balance'")
StatGroupBudget(:typeText="item.id")
+ LazyStatGroupTrns(
+ v-if="statPage.activeTab === 'details' && statPage.current[item.id].total !== 0"
+ :isShowExpense="item.id === 'expense'"
+ :isShowIncome="item.id === 'income'"
+ )
+
LazyStatGroupTrns(
- v-if="isShowGroupTrns && !isEmptyStat"
+ v-if="isShowGroupTrns && !isEmptyStat && statPage.activeTab !== 'details'"
:isShowExpense="statPage.activeTab === 'expense'"
:isShowIncome="statPage.activeTab === 'income'"
)
.px-2
StatEmpty
- .grid.md_grid-cols-2.md_gap-x-20
- LazyStatTrns(v-if="isShowTrns && !isEmptyStat")
//- Trns
template(v-if="statPage.activeTab === 'trns'")
diff --git a/components/stat/mobile/View.vue b/components/stat/mobile/View.vue
index 0f15b1a4..3899f233 100644
--- a/components/stat/mobile/View.vue
+++ b/components/stat/mobile/View.vue
@@ -114,16 +114,8 @@ onDeactivated(async () => {
template(v-if="statPage.activeTab === 'balance'")
StatGroupBudget(:typeText="item.id")
- //- LazyStatGroupTrns(
- //- v-if="isShowGroupTrns && !isEmptyStat"
- //- :isShowExpense="statPage.activeTab === 'expense'"
- //- :isShowIncome="statPage.activeTab === 'income'"
- //- )
-
.px-2
StatEmpty
- //- .grid.md_grid-cols-2.md_gap-x-20
- //- LazyStatTrns(v-if="isShowTrns && !isEmptyStat")
//- Trns
template(v-if="statPage.activeTab === 'trns'")
diff --git a/components/stat/mobile/ViewSlider.vue b/components/stat/mobile/ViewSlider.vue
deleted file mode 100644
index cd8de16d..00000000
--- a/components/stat/mobile/ViewSlider.vue
+++ /dev/null
@@ -1,116 +0,0 @@
-<script setup lang="ts">
-import SwiperCore from 'swiper'
-import 'swiper/swiper-bundle.css'
-import useStat from '~/modules/stat/useStat'
-import useStatChart from '~/components/stat/useStatChart'
-import useStatPage from '~/components/stat/useStatPage'
-import useUIView from '~/components/layout/useUIView'
-import useWallets from '~/components/wallets/useWallets'
-
-const { walletsCurrencies } = useWallets()
-
-const { $store } = useNuxtApp()
-const { statPage } = useStatPage()
-const { ui } = useUIView()
-const { isEmptyStat } = useStat()
-
-const sliderRef = ref(null)
-const sliderObject = ref(null)
-const chartKeyDirtyFix = ref(null)
-
-onMounted(() => {
- sliderObject.value = new SwiperCore(sliderRef.value, {
- observer: true,
- slidesPerView: 1,
- touchStartPreventDefault: false,
- autoHeight: false,
- initialSlide: 1,
- shortSwipes: false,
- longSwipesRatio: 0.1,
- longSwipesMs: 60,
- })
- sliderObject.value.on('slideChangeTransitionEnd', (slider) => {
- if (slider.activeIndex === 0)
- chartKeyDirtyFix.value = `hide${sliderObject.value.activeIndex}`
- })
-})
-
-const { onWatch } = useStatChart()
-onWatch()
-
-onActivated(async () => {
- await nextTick()
- chartKeyDirtyFix.value = `hide${sliderObject.value.activeIndex}`
-})
-onDeactivated(async () => {
- await nextTick()
- chartKeyDirtyFix.value = `show${sliderObject.value.activeIndex}`
-})
-</script>
-
-<template lang="pug">
-.overflow-y-auto.h-full.js_scroll_page
- .fixed.top-0.left-0.w-full.z-20.backdrop-blur(
- class="bg-white/70 dark_bg-dark3/70"
- )
- .px-0.flex.items-center.justify-between.gap-4
- StatDate.grow(
- wrapClasses="px-0"
- dateClasses="text-base"
- )
- .cursor-pointer.py-2.px-4.text-xs.text-skin-item-base-down.rounded-md.hocus_bg-skin-item-main-hover(
- v-if="walletsCurrencies.length > 1"
- @click="$store.commit('currencies/showBaseCurrenciesModal')"
- )
- | {{ $store.state.currencies.base }}
-
- StatMobileMenu(:slider="sliderObject")
-
- .swiper-container.overflow-hidden.h-full(ref="sliderRef")
- .swiper-wrapper
- //- Summary
- StatMobileSlide
- .my-4.px-2
- StatSumGroup(typeText="income")
- StatSumGroup(typeText="expense")
- StatSumTotal
-
- .my-6.mx-2.rounded-lg.bg-skin-item-main-bg.border.dark_border-neutral-800
- LazyStatChartWrap(
- :key="chartKeyDirtyFix"
- v-if="ui.showMainChart && statPage.isHasTrns"
- )
- .sm_flex.justify-between.px-2.pb-2
- StatChartPeriods
- StatChartOptions
-
- //- Expense
- StatMobileSlide
- .px-2
- StatGroupItem(typeText="expense")
- LazyStatGroupTrns(isShowExpense)
-
- //- Income
- StatMobileSlide
- .px-2
- StatGroupItem(typeText="income")
- LazyStatGroupTrns(isShowIncome)
-
- //- Transactions
- StatMobileSlide
- .px-2
- LazyStatTrns(v-if="!isEmptyStat")
-
- //- History
- StatMobileSlide
- .px-2
- StatHistory
-</template>
-
-<style lang="stylus">
-.firefoxBackdropFix
- @supports (not (-webkit-backdrop-filter: none)) and (not (backdrop-filter: none))
- background theme('colors.dark3') !important
- /.light &
- background theme('colors.white') !important
-</style>