Skip to content

Open source personal finance application

ui: update

ilkomec1b07a25e553
diff --git a/assets/stylus/variables.styl b/assets/stylus/variables.styl
index 06ce6447..43fd3fda 100644
--- a/assets/stylus/variables.styl
+++ b/assets/stylus/variables.styl
@@ -1,7 +1,33 @@
-@import "variables/*"
-
+@import 'variables/*'
font-title-1()
font-size 16px
font-weight 500
font-roboto()
+
+button-base-1()
+ cursor pointer
+ display flex
+ flex 1 1 50%
+ align-items center
+ justify-content center
+ height 44px
+ max-width 420px
+ margin 0 auto
+ padding 0 $m9
+ color var(--color-text-link)
+ font-size 12px
+ text-decoration none
+ background var(--c-bg-4)
+ border 1px solid var(--c-bg-4)
+ border-radius $m6
+ anim()
+
+ +media-hover()
+ color var(--c-text-1)
+ border 1px solid var(--c-blue-1)
+
+ +media(700px)
+ height 48px
+ max-width 280px
+ border-radius $m9
diff --git a/components/categories/form/CategoryForm.vue b/components/categories/Form.vue
similarity index 98%
rename from components/categories/form/CategoryForm.vue
rename to components/categories/Form.vue
index 1b66023f..3e6ceae9 100644
--- a/components/categories/form/CategoryForm.vue
+++ b/components/categories/Form.vue
@@ -434,8 +434,8 @@ LayoutComponentWrap
<style lang="stylus">
@import '~assets/stylus/variables/media'
-.dashboard .component
- .categories__list
- @media $media-laptop
- grid-template-columns repeat(3, 1fr)
+// .dashboard .component
+// .categories__list
+// @media $media-laptop
+// grid-template-columns repeat(3, 1fr)
</style>
diff --git a/components/categories/Modal.vue b/components/categories/Modal.vue
new file mode 100644
index 00000000..91ab39df
--- /dev/null
+++ b/components/categories/Modal.vue
@@ -0,0 +1,271 @@
+<script>
+import { useContext } from '@nuxtjs/composition-api'
+import { db } from '~/services/firebaseConfig'
+
+export default {
+ setup () {
+ const { store } = useContext()
+
+ const closed = () => {
+ store.commit('categories/hideCategoryModal')
+ store.commit('categories/setCategoryModalId', null)
+ }
+
+ return {
+ closed
+ }
+ },
+
+ data () {
+ return {
+ showModalConfirm: false
+ }
+ },
+
+ computed: {
+ categoryId () {
+ return this.$store.state.categories.modal.id
+ },
+ category () {
+ return this.$store.state.categories.items[this.categoryId]
+ },
+
+ deleteInfo () {
+ if (this.trnsIds.length > 0)
+ return `It's also will delete ${this.trnsIds.length} trns in this category`
+
+ return null
+ },
+
+ childCategoriesIds () {
+ return this.$store.getters['categories/getChildCategoriesIds'](this.categoryId)
+ },
+
+ trnsIds () {
+ const trns = this.$store.state.trns.items
+ const trnsIds = []
+ for (const trnId in trns)
+ if (trns[trnId].categoryId === this.categoryId) trnsIds.push(trnId)
+
+ return trnsIds
+ }
+ },
+
+ methods: {
+ handleSetFilterCategory () {
+ this.$store.commit('categories/hideCategoryModal')
+ this.$store.dispatch('ui/setActiveTab', 'stat')
+ this.$store.commit('filter/setFilterDateNow')
+ this.$store.dispatch('filter/setFilterCategoryId', this.categoryId)
+ this.$store.commit('categories/hideCategoryModal')
+ this.$store.commit('categories/setCategoryModalId', null)
+
+ if (this.$store.state.ui.mobile) {
+ this.$store.dispatch('ui/setActiveTabViewName', 'stat')
+ this.$store.dispatch('ui/setActiveTabStat', 'details')
+ }
+ },
+
+ handleEditClick () {
+ const categoryId = this.categoryId
+ this.$store.commit('categories/hideCategoryModal')
+ this.$store.commit('categories/setCategoryModalId', null)
+ this.$store.commit('categories/setCategoryEditId', categoryId)
+ this.$store.dispatch('ui/setActiveTab', 'createCategory')
+ },
+
+ handleDeleteClick () {
+ const categories = this.$store.state.categories.items
+ const id = this.categoryId
+ let isChildCategories = false
+
+ for (const categoryId in categories) {
+ if (categories[categoryId].parentId === id) {
+ this.$notify({
+ title: '👆',
+ text: 'You can not delete category with child categories'
+ })
+ isChildCategories = true
+ break
+ }
+ }
+
+ if (!isChildCategories) this.showModalConfirm = true
+ },
+
+ handleDeleteConfirm () {
+ const trnsIds = this.trnsIds
+ const uid = this.$store.state.user.user.uid
+ const id = this.categoryId
+
+ this.showModalConfirm = false
+ this.$store.commit('categories/hideCategoryModal')
+ this.$store.commit('categories/setCategoryModalId', null)
+
+ setTimeout(async () => {
+ await this.$store.dispatch('trns/deleteTrnsByIds', trnsIds)
+ db.ref(`users/${uid}/categories/${id}`)
+ .remove()
+ // .then(() => { console.log('category deleted') })
+ }, 200)
+ }
+ }
+}
+</script>
+
+<template lang="pug">
+Portal(
+ v-if="$store.state.categories.modal.show"
+ key="categoriesModal"
+ to="modal"
+)
+ LazyBaseBottomSheet(
+ v-if="$store.state.categories.modal.id"
+ key="categoriesModal"
+ @closed="closed()"
+ )
+ template(#handler="{ close }")
+ .handler__close(@click="close")
+ svg(
+ viewBox='0 0 24 24'
+ fill='none'
+ stroke='#000'
+ stroke-linecap='round'
+ stroke-linejoin='round'
+ stroke-width='3'
+ )
+ path(d='M.75 23.249l22.5-22.5')
+ path(d='M23.25 23.249L.75.749')
+
+ template(#header)
+ .header
+ .header__category
+ .header__icon
+ Icon(
+ :icon="category.icon"
+ :background="category.color || $store.state.ui.defaultBgColor"
+ :round="true"
+ :big="true"
+ )
+ .header__title {{ category.name }}
+ .header__subCategory(v-if="category.parentId") {{ $store.state.categories.items[category.parentId].name }}
+
+ template
+ .content
+ .tools
+ .modalLinks
+ ModalButton(
+ v-if="categoryId !== 'transfer'"
+ :name="$t('base.delete')"
+ icon="mdi mdi-delete-empty-outline"
+ @onClick="handleDeleteClick"
+ )
+ ModalButton(
+ :name="$t('base.edit')"
+ icon="mdi mdi-pencil-outline"
+ @onClick="handleEditClick"
+ )
+ ModalButton(
+ :name="$t('base.filter')"
+ icon="mdi mdi-filter-outline"
+ @onClick="handleSetFilterCategory"
+ )
+
+ template(v-if="childCategoriesIds.length")
+ .categoriesTitle {{ $t('categories.title') }}
+ .categories
+ CategoriesView(
+ :borderTop="true"
+ :ids="childCategoriesIds"
+ :noPadding="true"
+ @onClick="id => $store.dispatch('categories/showCategoryModal', id)"
+ )
+
+ //- TODO: translate
+ .header__back(
+ v-if="category.parentId"
+ @click="$store.dispatch('categories/showCategoryModal', category.parentId)"
+ )
+ svg(width="24" height="24" fill="currentColor")
+ path(d="M17.171 2.937a1.5 1.5 0 0 0-2.343-1.874l2.343 1.874zM8 12l-1.171-.937a1.5 1.5 0 0 0 0 1.874L8 12zm6.829 10.937a1.5 1.5 0 0 0 2.343-1.874l-2.343 1.874zm0-21.874l-8 10 2.343 1.874 8-10-2.343-1.874zm-8 11.874l8 10 2.343-1.874-8-10-2.343 1.874z")
+
+ | Back to {{ $store.state.categories.items[category.parentId].name }}
+
+ ModalBottomConfirm(
+ :description="deleteInfo"
+ :show="showModalConfirm"
+ @onClose="showModalConfirm = false"
+ @onConfirm="handleDeleteConfirm"
+ )
+</template>
+
+<style lang="stylus" scoped>
+@import '~assets/stylus/variables'
+
+.content
+ background var(--c-bg-3)
+ +media(600px)
+ border-radius 0 0 $m7 $m7
+
+.tools
+ padding-top $m6
+
+.categoriesTitle
+ margin-bottom (- $m5)
+ padding $m8
+ padding-bottom 0
+ color var(--c-font-3)
+ font-size 10px
+ letter-spacing 1px
+ font-weight 600
+ text-transform uppercase
+
+.categories
+ padding $m6
+
+.header
+ flex-grow 1
+ position relative
+ display flex
+ align-items center
+ padding $m7
+ color var(--c-font-2)
+ fontFamilyNunito()
+ background var(--c-bg-3)
+ border-radius $m7 $m7 0 0
+
+ &__subCategory
+ padding-top $m3
+
+ &__back
+ button-base-1()
+ margin $m8 $m7 $m5 $m7
+
+ +media(700px)
+ margin $m8 auto $m5 auto
+
+ svg
+ display none
+
+ &__title
+ font-size 28px
+ font-weight 700
+ text-align center
+ flex-grow 1
+
+ &__category
+ flex-grow 1
+ display flex
+ align-items center
+ justify-content center
+ flex-flow column
+ margin-bottom -10px
+
+ &__icon
+ flex-grow 1
+ display flex
+ align-items center
+ justify-content center
+ margin-top -38px
+ padding-bottom 12px
+</style>
diff --git a/components/categories/item/CategoryItem.vue b/components/categories/item/CategoryItem.vue
index eaa5593d..b2107aac 100644
--- a/components/categories/item/CategoryItem.vue
+++ b/components/categories/item/CategoryItem.vue
@@ -32,15 +32,13 @@ export default {
methods: {
handleClick () {
- if (this.$listeners.onClick) {
+ if (this.$listeners.onClick)
this.$listeners.onClick(this.id)
- }
},
handleIconClick () {
- if (this.$listeners.onIconClick) {
+ if (this.$listeners.onIconClick)
this.$listeners.onIconClick(this.id)
- }
}
}
}
@@ -54,73 +52,89 @@ export default {
.categoryItem__active(v-if="activeItemId === id")
.categoryItem__icon
Icon(
- :icon="category.icon"
- :color="category.color || $store.state.ui.defaultBgColor"
:category="true"
+ :color="category.color || $store.state.ui.defaultBgColor"
+ :icon="category.icon"
small
@click="handleIconClick"
)
- .categoryItem__name
- .categoryItem__parent(v-if="childCategoriesIds.length > 0") {{ childCategoriesIds.length }}
+ .categoryItem__name(:class="{ _flat: ui === '_flat' }")
.categoryItem__parent(v-if="ui === '_flat' && parentCategory") {{ parentCategory.name }}
.categoryItem__child {{ category.name }}
+ .categoryItem__length(v-if="childCategoriesIds.length > 0") {{ childCategoriesIds.length }}
- .categoryItem__dots(v-if="childCategoriesIds.length > 0"): .mdi.mdi-dots-vertical
+ //- .categoryItem__dots(v-if="childCategoriesIds.length > 0"): .mdi.mdi-dots-vertical
</template>
<style lang="stylus" scoped>
-@import '~assets/stylus/variables/margins'
-@import '~assets/stylus/variables/media'
-@import '~assets/stylus/variables/fonts'
+@import '~assets/stylus/variables'
.categoryItem
overflow hidden
cursor pointer
position relative
display flex
- flex-flow column nowrap
+ flex-flow row nowrap
align-items center
justify-content center
+ min-height 48px
padding $m6
color var(--c-font-1)
background var(--color-item-bg)
border-radius $m5
+ anim()
+
+ +media-hover()
+ color var(--c-text-1)
+ border 1px solid var(--c-blue-1)
+
+ +media(700px)
+ padding $m7 $m8
&._flat
flex-flow row
align-items center
- justify-content flex-start
+ justify-content center
+ min-height inherit
flex 1 1 auto
padding $m6
- @media $media-laptop
- padding $m6 0
-
&:active
opacity .9
&__icon
- padding-bottom $m4
+ padding-right $m6
^[0]._flat &
- padding-right $m3
+ padding-right $m5
padding-bottom 0
&__name
overflow hidden
- min-height 16px
+ display flex
+ flex-grow 1
text-overflow ellipsis
- padding 0 $m4
+ padding-right 0
font-size 14px
^[0]._flat &
+ display block
flex-grow 1
min-height inherit
&:last-child
padding-bottom 0
+ &__length
+ margin-left auto
+ padding-left $m6
+ color var(--c-font-4)
+ font-size 12px
+
+ ^[0]._flat &
+ text-align left
+
&__parent
padding-bottom $m3
color var(--c-font-4)
diff --git a/components/categories/list/CategoriesView.vue b/components/categories/list/CategoriesView.vue
index cd6d16bb..73364fa4 100644
--- a/components/categories/list/CategoriesView.vue
+++ b/components/categories/list/CategoriesView.vue
@@ -65,5 +65,5 @@ export default {
padding 0
.categories__list
- grid-template-columns repeat(3, 1fr)
+ // grid-template-columns repeat(3, 1fr)
</style>
diff --git a/components/categories/list/categories.styl b/components/categories/list/categories.styl
index d5f69b3d..b564253e 100644
--- a/components/categories/list/categories.styl
+++ b/components/categories/list/categories.styl
@@ -15,13 +15,13 @@
&__list
display grid
- grid-template-columns repeat(3, 1fr)
+ grid-template-columns repeat(2, 1fr)
grid-column-gap $m6
grid-row-gap $m6
padding 0 $m7
+media(600px)
- grid-template-columns repeat(auto-fill, minmax(120px, 1fr))
+ grid-template-columns repeat(auto-fill, minmax(200px, 1fr))
grid-column-gap $m6
grid-row-gap $m6
diff --git a/components/categories/modal/CategoryModal.vue b/components/categories/modal/CategoryModal.vue
deleted file mode 100644
index dd9ef9c4..00000000
--- a/components/categories/modal/CategoryModal.vue
+++ /dev/null
@@ -1,173 +0,0 @@
-<script>
-import { db } from '~/services/firebaseConfig'
-
-export default {
- data () {
- return {
- showModalConfirm: false
- }
- },
-
- computed: {
- categoryId () {
- return this.$store.state.categories.modal.id
- },
- category () {
- return this.$store.state.categories.items[this.categoryId]
- },
-
- deleteInfo () {
- if (this.trnsIds.length > 0)
- return `It's also will delete ${this.trnsIds.length} trns in this category`
-
- return null
- },
-
- childCategoriesIds () {
- return this.$store.getters['categories/getChildCategoriesIds'](this.categoryId)
- },
-
- trnsIds () {
- const trns = this.$store.state.trns.items
- const trnsIds = []
- for (const trnId in trns)
- if (trns[trnId].categoryId === this.categoryId) trnsIds.push(trnId)
-
- return trnsIds
- }
- },
-
- methods: {
- handleSetFilterCategory () {
- this.$store.commit('categories/hideCategoryModal')
- this.$store.dispatch('ui/setActiveTab', 'stat')
- this.$store.commit('filter/setFilterDateNow')
- this.$store.dispatch('filter/setFilterCategoryId', this.categoryId)
- this.$store.commit('categories/hideCategoryModal')
- this.$store.commit('categories/setCategoryModalId', null)
-
- if (this.$store.state.ui.mobile) {
- this.$store.dispatch('ui/setActiveTabViewName', 'stat')
- this.$store.dispatch('ui/setActiveTabStat', 'details')
- }
- },
-
- handleEditClick () {
- const categoryId = this.categoryId
- this.$store.commit('categories/hideCategoryModal')
- this.$store.commit('categories/setCategoryModalId', null)
- this.$store.commit('categories/setCategoryEditId', categoryId)
- this.$store.dispatch('ui/setActiveTab', 'createCategory')
- },
-
- handleDeleteClick () {
- const categories = this.$store.state.categories.items
- const id = this.categoryId
- let isChildCategories = false
-
- for (const categoryId in categories) {
- if (categories[categoryId].parentId === id) {
- this.$notify({
- title: '👆',
- text: 'You can not delete category with child categories'
- })
- isChildCategories = true
- break
- }
- }
-
- if (!isChildCategories) this.showModalConfirm = true
- },
-
- handleDeleteConfirm () {
- const trnsIds = this.trnsIds
- const uid = this.$store.state.user.user.uid
- const id = this.categoryId
-
- this.showModalConfirm = false
- this.$store.commit('categories/hideCategoryModal')
- this.$store.commit('categories/setCategoryModalId', null)
-
- setTimeout(async () => {
- await this.$store.dispatch('trns/deleteTrnsByIds', trnsIds)
- db.ref(`users/${uid}/categories/${id}`)
- .remove()
- // .then(() => { console.log('category deleted') })
- }, 200)
- }
- }
-}
-</script>
-
-<template lang="pug">
-Portal(
- v-if="$store.state.categories.modal.show"
- to="modal"
-)
- ModalBottom(
- :key="$store.state.categories.modal.id"
- @onClose="$store.commit('categories/hideCategoryModal')"
- @afterClose="$store.commit('categories/setCategoryModalId', null)"
- )
- template(slot="header")
- .categoryWrap
- .categoryIcon
- Icon(
- :icon="category.icon"
- :background="category.color || $store.state.ui.defaultBgColor"
- :round="true"
- :big="true"
- )
- .modalBottom__header__title {{ category.name }}
-
- template(slot="btns")
- ModalButton(
- v-if="categoryId !== 'transfer'"
- :name="$t('base.delete')"
- icon="mdi mdi-delete-empty-outline"
- @onClick="handleDeleteClick"
- )
- ModalButton(
- :name="$t('base.edit')"
- icon="mdi mdi-pencil-outline"
- @onClick="handleEditClick"
- )
- ModalButton(
- :name="$t('base.filter')"
- icon="mdi mdi-filter-outline"
- @onClick="handleSetFilterCategory"
- )
-
- template(v-if="childCategoriesIds.length")
- CategoriesView(
- :borderTop="true"
- :ids="childCategoriesIds"
- :noPadding="true"
- @onClick="id => $store.dispatch('categories/showCategoryModal', id)"
- )
-
- ModalBottomConfirm(
- :description="deleteInfo"
- :show="showModalConfirm"
- @onClose="showModalConfirm = false"
- @onConfirm="handleDeleteConfirm"
- )
-</template>
-
-<style lang="stylus" scoped>
-.categoryWrap
- flex-grow 1
- display flex
- align-items center
- justify-content center
- flex-flow column
- margin-bottom -10px
-
-.categoryIcon
- flex-grow 1
- display flex
- align-items center
- justify-content center
- margin-top -38px
- padding-bottom 12px
-</style>
diff --git a/components/filter/FilterItem.vue b/components/filter/FilterItem.vue
index 2ec411fe..e53b2f96 100644
--- a/components/filter/FilterItem.vue
+++ b/components/filter/FilterItem.vue
@@ -97,11 +97,12 @@ export default {
justify-content center
flex-grow 0
margin 0 $m4
- padding $m5 $m7
+ padding $m6 $m7
color var(--c-font-1)
+ font-size 12px
white-space nowrap
background var(--c-bg-5)
- border-radius $m5
+ border-radius $m6
+media(600px)
margin-right $m5
diff --git a/components/layout/Base.vue b/components/layout/Base.vue
index ecf173a2..0b859f0e 100644
--- a/components/layout/Base.vue
+++ b/components/layout/Base.vue
@@ -122,7 +122,7 @@ export default {
//- Modals
//-----------------------------------
- CategoriesModalCategoryModal
+ CategoriesModal
CurrenciesCurrencyModal
BaseBottomSheet(
@@ -140,15 +140,15 @@ export default {
stroke='#000'
stroke-linecap='round'
stroke-linejoin='round'
- stroke-width='1.5'
+ stroke-width='3'
)
path(d='M.75 23.249l22.5-22.5')
path(d='M23.25 23.249L.75.749')
TrnForm(:show="$store.getters['wallets/hasWallets'] && $store.getters['categories/hasCategories'] && $store.state.trnForm.show")
- TrnsModalTrnModal
- WalletsModalWalletModal
+ TrnsModal
+ WalletsModal
//- Base Menu
LazyLayoutMobileMenuModal(v-if="activeTab === 'menu'")
@@ -162,7 +162,7 @@ export default {
key="createCategory"
@onClose="$store.dispatch('ui/setActiveTab', 'stat')"
)
- CategoriesFormCategoryForm
+ CategoriesForm
//- Settings
Portal(
diff --git a/components/layout/index/Categories.vue b/components/layout/index/Categories.vue
index 3cbf97c7..245f366f 100644
--- a/components/layout/index/Categories.vue
+++ b/components/layout/index/Categories.vue
@@ -6,24 +6,36 @@ export default {
<template lang="pug">
LayoutComponentWrap(:contentPadding="false")
- template(slot="headerLeft") {{ $t('categories.name') }}
-
template(slot="content")
+ .header {{ $t('categories.name') }}
CategoriesList(
- :style="{ paddingTop: '16px' }"
+ :style="{ paddingTop: '0' }"
@onClick="(id) => $store.dispatch('categories/showCategoryModal', id)"
)
template(slot="bottom")
- .flex
- .col
- SharedButton(
- :title="$t('categories.new')"
- className="_inline _small"
- @onClick="$store.dispatch('ui/setActiveTab', 'createCategory')"
- )
+ .buttons
+ .button(@click="$store.dispatch('ui/setActiveTab', 'createCategory')") {{ $t('categories.new') }}
</template>
<style lang="stylus" scoped>
-//
+@import '~assets/stylus/variables'
+
+.header
+ padding 60px 0
+ font-h1()
+ font-size 22px
+ font-weight 600
+ text-align center
+
+ +media-laptop()
+ font-size 28px
+
+.buttons
+ display flex
+ gap $m8
+
+.button
+ button-base-1()
+ margin-top $m7
</style>
diff --git a/components/layout/mobile/BottomMenu.vue b/components/layout/mobile/BottomMenu.vue
index 491c51f3..72d669c1 100644
--- a/components/layout/mobile/BottomMenu.vue
+++ b/components/layout/mobile/BottomMenu.vue
@@ -47,6 +47,7 @@ export default {
store.dispatch('ui/setActiveTab', 'menu')
return
}
+ store.dispatch('ui/setActiveTab', tabName)
store.dispatch('ui/setActiveTabViewName', tabName)
}
diff --git a/components/modal/ModalButton.vue b/components/modal/ModalButton.vue
index 1b55fa78..708f1cc2 100644
--- a/components/modal/ModalButton.vue
+++ b/components/modal/ModalButton.vue
@@ -22,7 +22,13 @@ export default {
:class="{ _active: isActive }"
@click="$emit('onClick')"
)
- .button-link__icon: div(:class="icon")
+
+ .button-link__icon(v-if="$slots.icon")
+ slot(name="icon")
+
+ template(v-if="!$slots.icon")
+ .button-link__icon: div(:class="icon")
+
.button-link__name {{ name }}
</template>
@@ -34,13 +40,15 @@ export default {
width auto
max-width 100%
padding $m6 $m6
- white-space nowrap
text-align center
- border-radius $m5
+ border-radius $m6
anim()
&__icon
opacity .8
+ display flex
+ align-items center
+ justify-content center
padding-bottom $m6
color var(--c-font-2)
font-size 32px
@@ -57,4 +65,5 @@ export default {
&__name
color var(--c-font-3)
font-size 12px
+ line-height 16px
</style>
diff --git a/components/modal/styles/modalLinks.styl b/components/modal/styles/modalLinks.styl
index 212cf61a..cea3e612 100644
--- a/components/modal/styles/modalLinks.styl
+++ b/components/modal/styles/modalLinks.styl
@@ -1,8 +1,8 @@
.modalLinks
display grid
- grid-template-columns repeat(3, 1fr)
+ grid-template-columns repeat(3, 30%)
grid-column-gap $m7
- grid-row-gap $m7
+ grid-row-gap $m9
padding 0 $m7
padding-bottom $m5
diff --git a/components/shared/button/Button.vue b/components/shared/button/Button.vue
index 0710b0c9..03784c79 100644
--- a/components/shared/button/Button.vue
+++ b/components/shared/button/Button.vue
@@ -200,7 +200,7 @@ export default {
font-size 12px
background var(--c-bg-3)
border 1px solid var(--c-bg-7)
- border-radius $m5
+ border-radius $m6
^[0]:active &
color var(--c-font-3)
diff --git a/components/stat/Dashboard.vue b/components/stat/Dashboard.vue
index 6ed6f29a..3ea0c185 100644
--- a/components/stat/Dashboard.vue
+++ b/components/stat/Dashboard.vue
@@ -118,6 +118,10 @@ export default {
store.dispatch('ui/setActiveTabStat', 'details')
}
+ function toogleView (name) {
+ setUI({ name, value: !ui[name] })
+ }
+
return {
isShowChart,
@@ -142,7 +146,9 @@ export default {
isEmptyStat,
- onClickTitle
+ onClickTitle,
+
+ toogleView
}
}
}
@@ -156,9 +162,6 @@ export default {
DateMobileSelector
StatDashboardMenu
- .baseBox._filter(v-if="isShowFilter")
- LazyFilterRow(v-if="isShowFilter")
-
template
//- Total
.baseBox._total
@@ -182,9 +185,9 @@ export default {
)
template(v-if="activeTabStat === 'incomes' || activeTabStat === 'expenses'")
- .sumBox(@click="onClickTitle()")
+ .sumBox
.baseBox__title {{ $t(`money.${activeTabStat}`) }}
- .boxSummary2
+ .boxSummary2(@click="onClickTitle()")
.boxSummary2__item
Amount(
:currency="$store.state.currencies.base"
@@ -204,6 +207,28 @@ export default {
:amount="statToday[activeTabStat].total"
:title="$t('dates.day.today')"
)
+
+ .total__custom(v-if="statCurrentPeriod[activeTabStat].total !== 0")
+ .periodItem(
+ :class="{ _active: ui.showPieChart }"
+ @click="toogleView('showPieChart')"
+ ): .mdi.mdi-chart-pie
+
+ .periodItem(
+ :class="{ _active: ui.showCatsVerticalChart }"
+ @click="toogleView('showCatsVerticalChart')"
+ ): .mdi.mdi-poll
+
+ .periodItem(
+ :class="{ _active: ui.showRoundCats }"
+ @click="toogleView('showRoundCats')"
+ ): .mdi.mdi-chart-bubble
+
+ .periodItem(
+ :class="{ _active: ui.showCatsHorizontalList }"
+ @click="toogleView('showCatsHorizontalList')"
+ ): .mdi.mdi-chart-timeline
+
div
.baseBox._chart(v-if="ui.showMainChart && isShowChart")
LazyChartTotal(v-if="ui.showMainChart && isShowChart")
@@ -211,6 +236,9 @@ export default {
.baseBox._date
ChartPeriods
+ .baseBox._filter(v-if="isShowFilter")
+ LazyFilterRow(v-if="isShowFilter")
+
.noStat(v-if="isEmptyStat")
.noStat__title {{ $t('stat.empty') }}
.noStat__desc {{ $t('stat.emptyDesc') }}
@@ -224,10 +252,10 @@ export default {
template(v-if="statCurrentPeriod[item.id].total > 0 || (statAverage && statAverage[item.id] !== 0) || $store.state.filter.period === 'all'")
.baseBox._noBdMedia._mw
template(v-if="activeTabStat === 'details' && (statAverage.incomes !== 0 && statAverage.expenses !== 0)")
- .sumBox(@click="onClickTitle(item.type)")
+ .sumBox
.baseBox__title {{ $t(`money.${item.id}`) }}
.boxSummary2
- .boxSummary2__item
+ .boxSummary2__item(@click="onClickTitle(item.type)")
Amount(
:currency="$store.state.currencies.base"
:type="item.type"
@@ -247,14 +275,26 @@ export default {
:title="$t('dates.day.today')"
)
- .statChartLines(v-if="filter.categoryId")
- LazyChartStatChartLines(
- v-if="filter.categoryId && $store.getters['trns/hasTrns']"
- :categoryId="filter.categoryId"
- :chartColor="$store.state.categories.items[filter.categoryId].color"
- :isShowExpenses="item.type === 0"
- :isShowIncomes="item.type === 1"
- )
+ .total__custom(v-if="statCurrentPeriod[item.id].total !== 0")
+ .periodItem(
+ :class="{ _active: ui.showPieChart }"
+ @click="toogleView('showPieChart')"
+ ): .mdi.mdi-chart-pie
+
+ .periodItem(
+ :class="{ _active: ui.showCatsVerticalChart }"
+ @click="toogleView('showCatsVerticalChart')"
+ ): .mdi.mdi-poll
+
+ .periodItem(
+ :class="{ _active: ui.showRoundCats }"
+ @click="toogleView('showRoundCats')"
+ ): .mdi.mdi-chart-bubble
+
+ .periodItem(
+ :class="{ _active: ui.showCatsHorizontalList }"
+ @click="toogleView('showCatsHorizontalList')"
+ ): .mdi.mdi-chart-timeline
.boxEmpty(v-if="statCurrentPeriod[item.id].categoriesIds.length === 0") {{ $t('stat.empty') }}
@@ -310,15 +350,15 @@ export default {
:type="item.type"
)
- template(v-if="(statAverage && (statAverage.incomes === 0 || statAverage.expenses === 0)) || (activeTabStat === 'incomes' || activeTabStat === 'expenses')")
- .baseBox._mw(v-if="$store.getters['trns/selectedTrnsIdsWithDate'].length > 0")
- .baseBox__title {{ $t('trns.history') }}
- .baseBox__content
- TrnsList3(
- :incomes="activeTabStat === 'incomes'"
- :expenses="activeTabStat === 'expenses'"
- :size="12"
- )
+ template(v-if="(statAverage && (statAverage.incomes === 0 || statAverage.expenses === 0)) || (activeTabStat === 'incomes' && statAverage.incomes !== 0 || activeTabStat === 'expenses' && statAverage.expenses !== 0)")
+ .baseBox._mw(v-if="$store.getters['trns/selectedTrnsIdsWithDate'].length > 0")
+ .baseBox__title {{ $t('trns.history') }}
+ .baseBox__content
+ TrnsList3(
+ :incomes="activeTabStat === 'incomes'"
+ :expenses="activeTabStat === 'expenses'"
+ :size="12"
+ )
//- history
.history(v-if="activeTabStat === 'history' || statAverage && (statAverage.incomes !== 0 && statAverage.expenses !== 0) && ui.showHistory && $store.getters['trns/selectedTrnsIdsWithDate'].length > 0 && (activeTabStat !== 'incomes' && activeTabStat !== 'expenses')")
@@ -341,17 +381,27 @@ export default {
+media(700px)
padding $m8 $m8
+ .baseBox__title
+ margin-bottom (- $m8)
+ +media(600px)
+ margin-bottom 0
+
.trnsList__content
+ .trnsList__header
+ margin 0 (- $m5)
+ +media(600px)
+ margin 0
+
+ .trnsList__trns
+ margin 0 (- $m5)
+ padding 0 0
+
.trnsList__grid
padding 0
.trnsList__day
padding-bottom 0
- // &:first-child
- // margin-top 0
- // padding-top $m5
-
.trnItem._history
margin 0
padding-right $m7 !important
@@ -361,9 +411,29 @@ export default {
<style lang="stylus" scoped>
@import '~assets/stylus/variables'
+.total__custom
+ position absolute
+ top $m5
+ right 0
+ display flex
+ margin-left (- $m6)
+
+ .periodItem
+ padding $m5
+ color var(--c-font-5)
+ border-radius $m5
+
+ &._active
+ color var(--c-font-3)
+
+ +media-hover()
+ background var(--c-bg-5)
+
.sumBox
cursor pointer
+ position relative
display inline-block
+ width 100%
.noStat
overflow hidden
@@ -401,6 +471,7 @@ export default {
+media(800px)
grid-column-gap 32px
+ padding-top $m7
.baseBox:last-child
border none
@@ -428,6 +499,7 @@ export default {
border-bottom 1px solid var(--c-bg-5)
&._mw
+ overflow initial
max-width 400px
margin-top 0
diff --git a/components/stat/StatChartPie.vue b/components/stat/StatChartPie.vue
index 26a08903..49f9077b 100644
--- a/components/stat/StatChartPie.vue
+++ b/components/stat/StatChartPie.vue
@@ -52,11 +52,11 @@ export default {
chart: {
...chartOptions.chart,
spacing: [0, 0, 0, 0],
- height: '100',
+ height: '280',
events: {
click (e) {
- // console.log(e)
+ console.log(e)
// const value = this.series[0].searchPoint(e, true) || this.series[1].searchPoint(e, true)
// vm.$store.dispatch('filter/setDate', parseInt(value.date))
}
diff --git a/components/stat/StatItemChildCatsItem.vue b/components/stat/StatItemChildCatsItem.vue
index 5d2d0127..87118abe 100644
--- a/components/stat/StatItemChildCatsItem.vue
+++ b/components/stat/StatItemChildCatsItem.vue
@@ -59,9 +59,10 @@ export default {
@click.stop="() => $store.dispatch('filter/handleSetFilterCategory', categoryId)"
)
Icon(
- :color="$store.state.ui.pc ? category.color : null"
- :background="$store.state.ui.mobile ? category.color : null"
+ :color="category.color"
:icon="category.icon"
+ background="var(--c-bg-6)"
+ round
)
.statItemChild__name {{ category.name }}
@@ -153,6 +154,9 @@ export default {
align-self center
&__trns
+ padding-right $m6
+ padding-left $m6
+
^[0]._active &
padding-bottom $m6
</style>
diff --git a/components/stat/SummaryRowItemView.vue b/components/stat/SummaryRowItemView.vue
index a552bad8..09383c4f 100644
--- a/components/stat/SummaryRowItemView.vue
+++ b/components/stat/SummaryRowItemView.vue
@@ -62,6 +62,7 @@ export default {
padding-bottom $m4
color var(--c-font-4)
font-size 10px
+ white-space nowrap
&__line
position absolute
diff --git a/components/stat/cats/PeriodCatsChart.vue b/components/stat/cats/PeriodCatsChart.vue
index 4dd55242..7b9b65db 100644
--- a/components/stat/cats/PeriodCatsChart.vue
+++ b/components/stat/cats/PeriodCatsChart.vue
@@ -37,7 +37,7 @@ export default {
methods: {
handleActiveCategoryChange ({ categoryId, offset }) {
- if (offset) { this.offset = offset }
+ if (offset) this.offset = offset
categoryId
? this.activeCategoryId = categoryId
: this.activeCategoryId = null
@@ -60,7 +60,6 @@ export default {
)
.cats-chart__popup(
- v-if="$store.state.ui.pc"
v-show="activeCategoryId"
)
@@ -72,10 +71,7 @@ export default {
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables/animations"
-@import "~assets/stylus/variables/margins"
-@import "~assets/stylus/variables/media"
-@import "~assets/stylus/variables/scroll"
+@import '~assets/stylus/variables'
.cats-chart
position relative
@@ -100,7 +96,7 @@ export default {
padding 10px 10px
&:after
- content ""
+ content ''
min-width $m7
@media $media-laptop
diff --git a/components/stat/cats/PeriodCatsChartItem.vue b/components/stat/cats/PeriodCatsChartItem.vue
index 78215ef2..4d57d548 100644
--- a/components/stat/cats/PeriodCatsChartItem.vue
+++ b/components/stat/cats/PeriodCatsChartItem.vue
@@ -27,15 +27,12 @@ export default {
}
},
amount () {
- if (this.total >= 1000000) {
+ if (this.total >= 1000000)
return (this.total / 1000000).toFixed(2) + 'm'
- }
- else if (this.total >= 10000) {
+ else if (this.total >= 10000)
return (this.total / 1000).toFixed() + 'k'
- }
- else if (this.total > 999) {
+ else if (this.total > 999)
return (this.total / 1000).toFixed(1) + 'k'
- }
return this.total.toFixed()
}
@@ -54,9 +51,8 @@ export default {
},
handleMouseLeave (e) {
- if (this.$store.state.ui.pc) {
+ if (this.$store.state.ui.pc)
this.$emit('onActiveCategoryChange', { categoryId: null })
- }
}
}
}
@@ -77,8 +73,7 @@ export default {
</template>
<style lang="stylus" scoped>
-@import '~assets/stylus/variables/margins'
-@import '~assets/stylus/variables/media'
+@import '~assets/stylus/variables'
.statCatsItem
cursor pointer
@@ -88,14 +83,13 @@ export default {
border-radius $m4
&:hover
- @media $media-laptop
- @media (hover hover)
- margin -20px 0px -20px -10px
- padding 32px 10px 20px 10px
- background var(--c-bg-6)
+ @media (hover hover)
+ margin -20px 0px -20px -10px
+ padding 32px 10px 20px 10px
+ background var(--c-bg-6)
- /.light-mode &
- background var(--c-bg-1)
+ /.light-mode &
+ background var(--c-bg-1)
&__graph
position relative
diff --git a/components/stat/cats/PeriodCatsChartMobile.vue b/components/stat/cats/PeriodCatsChartMobile.vue
deleted file mode 100644
index 4d1e430b..00000000
--- a/components/stat/cats/PeriodCatsChartMobile.vue
+++ /dev/null
@@ -1,74 +0,0 @@
-<script>
-export default {
- name: 'StatCatsPeriodCatsChartMobile',
-
- props: {
- type: {
- type: String,
- required: true,
- validator (value) {
- return value === 'incomes' || value === 'expenses'
- }
- }
- },
-
- data () {
- return {
- activeCategoryId: null,
- offset: 0
- }
- },
-
- computed: {
- className () {
- return {
- _incomes: this.type === 'incomes',
- _expenses: this.type === 'expenses'
- }
- },
- biggestAmount () {
- return this.$store.getters['stat/statCurrentPeriod'][this.type].biggest
- },
- categories () {
- return this.$store.state.categories.items
- },
- statCurrentPeriod () {
- return this.$store.getters['stat/statCurrentPeriod']
- }
- },
-
- methods: {
- handleActiveCategoryChange ({ categoryId, offset }) {
- if (offset) { this.offset = offset }
- categoryId
- ? this.activeCategoryId = categoryId
- : this.activeCategoryId = null
- }
- }
-}
-</script>
-
-<template lang="pug">
-.statLineCategories(
- v-if="statCurrentPeriod[type].categoriesIds.length > 0"
- :class="className"
-)
- StatCatsPeriodCatsChartItem2(
- v-for="categoryId in statCurrentPeriod[type].categoriesIds"
- :biggest="biggestAmount"
- :category="categories[categoryId]"
- :categoryId="categoryId"
- :key="`charts-${categoryId}`"
- :total="statCurrentPeriod.categories[categoryId][type]"
- @onActiveCategoryChange="handleActiveCategoryChange"
- )
-</template>
-
-<style lang="stylus" scoped>
-@import '~assets/stylus/variables'
-
-.statLineCategories
- overflow hidden
- display flex
- border-radius $m4
-</style>
diff --git a/components/stat/cats/PeriodCatsChartPopup.vue b/components/stat/cats/PeriodCatsChartPopup.vue
index 0de246c9..cf34cd46 100644
--- a/components/stat/cats/PeriodCatsChartPopup.vue
+++ b/components/stat/cats/PeriodCatsChartPopup.vue
@@ -17,16 +17,16 @@ export default {
computed: {
amount () {
- if (this.$store.getters['stat/statCurrentPeriod'].categories[this.categoryId]) {
+ if (this.$store.getters['stat/statCurrentPeriod'].categories[this.categoryId])
return this.$store.getters['stat/statCurrentPeriod'].categories[this.categoryId][this.type]
- }
+
return null
},
categoryName () {
- if (this.$store.state.categories.items[this.categoryId]) {
+ if (this.$store.state.categories.items[this.categoryId])
return this.$store.state.categories.items[this.categoryId].name
- }
+
return null
}
}
@@ -48,10 +48,7 @@ export default {
</template>
<style lang="stylus" scoped>
-@import '~assets/stylus/variables/margins'
-@import '~assets/stylus/variables/fonts'
-@import '~assets/stylus/variables/media'
-@import '~assets/stylus/variables/scroll'
+@import '~assets/stylus/variables'
.chart-popup
z-index 2
@@ -59,8 +56,8 @@ export default {
bottom 0px
display block
padding $m6 $m8
- background var(--c-bg-6)
- border-radius $m4
+ background var(--c-bg-5)
+ border-radius $m5
transform translate(-50%, calc(100% + 40px))
white-space nowrap
@@ -76,7 +73,7 @@ export default {
content ''
border-left 8px solid transparent
border-right 8px solid transparent
- border-bottom 8px solid var(--c-bg-6)
+ border-bottom 8px solid var(--c-bg-5)
/.light-mode &
border-bottom-color var(--c-bg-5)
diff --git a/components/stat/chartOptions.js b/components/stat/chartOptions.js
index a9323ae7..cc885974 100644
--- a/components/stat/chartOptions.js
+++ b/components/stat/chartOptions.js
@@ -52,7 +52,7 @@ export default {
pie: {
dataLabels: {
- enabled: false,
+ enabled: true,
distance: -30,
format: '<b>{point.name}</b><br>{point.y}',
filter: {
diff --git a/components/trnForm/TrnForm.vue b/components/trnForm/TrnForm.vue
index 274c5dfe..7fd2666d 100644
--- a/components/trnForm/TrnForm.vue
+++ b/components/trnForm/TrnForm.vue
@@ -273,8 +273,8 @@ export default {
<style lang="stylus">
@import '~assets/stylus/variables'
-.trnFormWalletsList .walllets__grid
-.trnForm .walllets__grid
+.trnFormWalletsList .wallets__grid
+.trnForm .wallets__grid
grid-template-columns repeat(2, 1fr) !important
grid-column-gap $m6 !important
grid-row-gap $m6 !important
diff --git a/components/trnForm/TrnFormCategories.vue b/components/trnForm/TrnFormCategories.vue
index a4747142..ab0c1858 100644
--- a/components/trnForm/TrnFormCategories.vue
+++ b/components/trnForm/TrnFormCategories.vue
@@ -50,6 +50,7 @@ export default {
.scrollBlock.scrollerBlock(
v-if="$store.getters['categories/lastUsedCategoriesIdsByDate'] && $store.getters['categories/lastUsedCategoriesIdsByDate'].length > 0"
)
+ .header {{ $t('categories.lastUsedTitle') }} {{ $t('categories.title') }}
.pb_base
CategoriesView(
:activeItemId="$store.state.trnForm.values.categoryId"
@@ -61,6 +62,7 @@ export default {
.swiper-slide
.scrollBlock.scrollerBlock
+ .header {{ $t('categories.title') }}
.pb_base
CategoriesView(
:ids="$store.getters['categories/categoriesRootIds']"
@@ -72,6 +74,7 @@ export default {
.scrollBlock.scrollerBlock(
v-if="$store.getters['categories/quickSelectorCategoriesIds'] && $store.getters['categories/quickSelectorCategoriesIds'].length"
)
+ .header {{ $t('categories.favoriteTitle') }} {{ $t('categories.title') }}
.pb_base
CategoriesView(
:activeItemId="$store.state.trnForm.values.categoryId"
@@ -106,7 +109,7 @@ export default {
overflow hidden
position relative
display grid
- grid-template-rows 1fr auto
+ grid-template-rows auto
height 100%
&__box
@@ -133,6 +136,7 @@ export default {
align-items center
justify-content center
padding $m6
+ padding-bottom 0
.menuItem
cursor pointer
@@ -153,4 +157,15 @@ export default {
&._active
cursor default
color var(--c-blue-1)
+
+.header
+ padding 40px 0
+ padding-bottom 60px
+ font-h1()
+ font-size 22px
+ font-weight 600
+ text-align center
+
+ +media-laptop()
+ font-size 28px
</style>
diff --git a/components/trnForm/modal/TrnFormModalCats.vue b/components/trnForm/modal/TrnFormModalCats.vue
index 1184f871..7b8757c3 100644
--- a/components/trnForm/modal/TrnFormModalCats.vue
+++ b/components/trnForm/modal/TrnFormModalCats.vue
@@ -12,9 +12,6 @@ export default {
<template lang="pug">
TrnFormModal(@closed="afterClose")
- template(#header)
- template {{ $t('categories.title') }}
-
template(#default="{ close }")
TrnFormCategories(@closeModal="close")
</template>
diff --git a/components/trnForm/modal/TrnFormModalWallets.vue b/components/trnForm/modal/TrnFormModalWallets.vue
index df3a85bd..e011731b 100644
--- a/components/trnForm/modal/TrnFormModalWallets.vue
+++ b/components/trnForm/modal/TrnFormModalWallets.vue
@@ -37,11 +37,9 @@ TrnFormModal(@closed="afterClose")
overflow hidden
overflow-y auto
height 100%
- padding-bottom 16px
- .walletsList__toogle
- margin 0
- padding-bottom 0
- text-align center
- border-top 0
+ .wallets__toogle
+ button-base-1()
+ margin-top $m7
+ margin-bottom $m5
</style>
diff --git a/components/trns/modal/TrnModal.vue b/components/trns/Modal.vue
similarity index 53%
rename from components/trns/modal/TrnModal.vue
rename to components/trns/Modal.vue
index a3def48a..07f39bf2 100644
--- a/components/trns/modal/TrnModal.vue
+++ b/components/trns/Modal.vue
@@ -1,9 +1,28 @@
<script>
+import { useContext } from '@nuxtjs/composition-api'
+import useFilter from '~/modules/filter/useFilter'
import useCalculator from '~/components/trnForm/calculator/useCalculator'
export default {
name: 'TrnModal',
+ setup () {
+ const { store } = useContext()
+ const { setCategoryFilter, setWalletFilter } = useFilter()
+
+ const closed = () => {
+ store.commit('trns/hideTrnModal')
+ store.commit('trns/setTrnModalId', null)
+ }
+
+ return {
+ setCategoryFilter,
+ setWalletFilter,
+
+ closed
+ }
+ },
+
data () {
return {
showModalConfirm: false,
@@ -30,20 +49,19 @@ export default {
},
methods: {
- handleSetFilterCategory (id) {
+ handleSetFilterCategory () {
+ this.setCategoryFilter(this.$store.state.trns.items[this.trnId].categoryId)
this.$store.commit('filter/setFilterDateNow')
- this.$store.dispatch('filter/setFilterCategoryId', this.$store.state.trns.items[this.trnId].categoryId)
this.$store.commit('trns/hideTrnModal')
this.$store.commit('trns/setTrnModalId', null)
this.$store.commit('stat/setCategoryModal', { id: null, type: null })
this.$store.dispatch('ui/setActiveTab', 'stat')
},
- handleSetFilterWallet (id) {
- this.$store.commit('filter/setFilterDateNow')
- this.$store.dispatch('filter/setFilterWalletId', this.$store.state.trns.items[this.trnId].walletId)
+ handleSetFilterWallet () {
+ this.setWalletFilter(this.$store.state.trns.items[this.trnId].walletId)
this.$store.commit('trns/hideTrnModal')
this.$store.commit('trns/setTrnModalId', null)
- this.$store.commit('stat/setCategoryModal', { id: null, type: null })
+ this.$store.commit('filter/setFilterDateNow')
this.$store.dispatch('ui/setActiveTab', 'stat')
},
handleDublicateTrn () {
@@ -85,67 +103,88 @@ export default {
<template lang="pug">
Portal(
- v-if="$store.getters['trns/hasTrns'] && $store.state.trns.modal.show"
+ key="trnsModal"
+ v-if="$store.state.trns.modal.show"
to="modal"
)
- ModalBottom(
- :key="trnId"
- @onClose="$store.commit('trns/hideTrnModal')"
- @afterClose="$store.commit('trns/setTrnModalId', null)"
+ LazyBaseBottomSheet(
+ v-if="$store.state.trns.modal.show"
+ key="trnsModal"
+ @closed="closed()"
)
- template(v-if="trnId")
- template(slot="header")
- //- trn
- TrnsItemTrnItem(
- :category="category"
- :trn="$store.state.trns.items[trnId]"
- :trnId="trnId"
- :wallet="wallet"
- ui="detailed"
+ template(#handler="{ close }")
+ .handler__close(@click="close")
+ svg(
+ viewBox='0 0 24 24'
+ fill='none'
+ stroke='#000'
+ stroke-linecap='round'
+ stroke-linejoin='round'
+ stroke-width='3'
)
+ path(d='M.75 23.249l22.5-22.5')
+ path(d='M23.25 23.249L.75.749')
- //- btns
- template(slot="btns")
- ModalButton(
- :name="$t('base.delete')"
- icon="mdi mdi-delete-empty-outline"
- @onClick="handleDeleteClick"
- )
+ template(#header)
+ .header
+ .header__category
+ TrnsItemTrnItem(
+ :category="category"
+ :trn="$store.state.trns.items[trnId]"
+ :trnId="trnId"
+ :wallet="wallet"
+ ui="detailed"
+ )
- ModalButton(
- :name="$t('base.edit')"
- icon="mdi mdi-pencil-outline"
- @onClick="handleEditClick"
- )
+ template
+ .content
+ .tools
+ .modalLinks
+ ModalButton(
+ :name="$t('base.delete')"
+ icon="mdi mdi-delete-empty-outline"
+ @onClick="handleDeleteClick"
+ )
- ModalButton(
- :name="$t('base.dublicate')"
- icon="mdi mdi-content-copy"
- @onClick="handleDublicateTrn"
- )
+ ModalButton(
+ :name="$t('base.edit')"
+ icon="mdi mdi-pencil-outline"
+ @onClick="handleEditClick"
+ )
- .moreActions
- SharedButton.marginBottom(
- :title="`${$t('base.setFilter')} ${this.category.name}`"
- className="_borderBottom"
- icon="mdi mdi-folder-star"
- @onClick="handleSetFilterCategory"
- )
+ ModalButton(
+ :name="$t('base.dublicate')"
+ icon="mdi mdi-content-copy"
+ @onClick="handleDublicateTrn"
+ )
- SharedButton.marginBottom(
- :title="`${$t('base.setFilter')} ${this.wallet.name}`"
- className="_borderBottom"
- icon="mdi mdi-credit-card-multiple"
- @onClick="handleSetFilterWallet"
- )
+ ModalButton(
+ :name="`${$t('base.setFilter')} ${category.name}`"
+ @onClick="handleSetFilterCategory"
+ )
+ template(#icon)
+ Icon(
+ :icon="category.icon"
+ :background="category.color || $store.state.ui.defaultBgColor"
+ round
+ )
- SharedButton(
- v-if="groups && $store.getters['user/isTester']"
- className="_borderBottom"
- icon="mdi mdi-folder-multiple-outline"
- :title="$t('groups.show')"
- @onClick="showModalGroups = true"
- )
+ ModalButton(
+ :name="`${$t('base.setFilter')} ${wallet.name}`"
+ @onClick="handleSetFilterWallet"
+ )
+ template(#icon)
+ Icon(
+ :abbr="wallet.name"
+ :background="wallet.color"
+ )
+
+ ModalButton(
+ v-if="groups && $store.getters['user/isTester']"
+ :name="$t('groups.show')"
+ icon="mdi mdi-folder-multiple-outline"
+ @onClick="showModalGroups = true"
+ )
template(v-if="groups && $store.getters['user/isTester']")
Portal(
@@ -175,8 +214,20 @@ Portal(
</template>
<style lang="stylus" scoped>
-@import "~assets/stylus/variables/margins"
-@import "~assets/stylus/variables/scroll"
+@import '~assets/stylus/variables'
+
+.header
+ flex-grow 1
+ position relative
+ display flex
+ align-items center
+ justify-content center
+ padding $m7
+ padding-bottom $m9
+ color var(--c-font-2)
+ fontFamilyNunito()
+ background var(--c-bg-3)
+ border-radius $m7 $m7 0 0
.marginBottom
margin-bottom $m7
@@ -203,4 +254,11 @@ Portal(
&__name
flex-grow 1
+
+.content
+ +media(600px)
+ border-radius 0 0 $m7 $m7
+ // padding-top $m6
+ // padding-bottom $m6
+ // background var(--c-bg-3)
</style>
diff --git a/components/trns/item/TrnItem.vue b/components/trns/item/TrnItem.vue
index 65bc071b..9d10e75f 100644
--- a/components/trns/item/TrnItem.vue
+++ b/components/trns/item/TrnItem.vue
@@ -302,6 +302,7 @@ export default {
&._history
&._stat
background var(--c-bg-5)
+ border-radius $m5
&__amount
align-self center
diff --git a/components/trns/list/TrnsList.vue b/components/trns/list/TrnsList.vue
index e783120f..c973a789 100644
--- a/components/trns/list/TrnsList.vue
+++ b/components/trns/list/TrnsList.vue
@@ -52,37 +52,33 @@ export default {
let trnsIds = this.$store.getters['trns/selectedTrnsIdsWithDate']
// from category
- if (this.categoryId) {
+ if (this.categoryId)
trnsIds = trnsIds.filter(trnId => trns[trnId].categoryId === this.categoryId)
- }
// filter type
- if (this.incomes) { trnsIds = trnsIds.filter(id => trns[id].type === 1) }
- if (this.expenses) { trnsIds = trnsIds.filter(id => trns[id].type === 0) }
+ if (this.incomes) trnsIds = trnsIds.filter(id => trns[id].type === 1)
+ if (this.expenses) trnsIds = trnsIds.filter(id => trns[id].type === 0)
// limit
- if (this.limit > 0) { return trnsIds.slice(0, this.limit) }
+ if (this.limit > 0) return trnsIds.slice(0, this.limit)
return trnsIds
},
groupedTrns () {
const trns = this.$store.state.trns.items
- const trnsIds = this.paginatedTrnsIds
const trnsList = {}
- for (const trnId of trnsIds) {
+ for (const trnId of this.paginatedTrnsIds) {
let dayDate
this.sortByEditDate
? dayDate = this.$day(trns[trnId].edited).startOf('day').valueOf()
: dayDate = this.$day(trns[trnId].date).startOf('day').valueOf()
- if (!trnsList[dayDate]) {
- trnsList[dayDate] = [trnId]
- }
- else {
- trnsList[dayDate].push(trnId)
- }
+ !trnsList[dayDate]
+ ? trnsList[dayDate] = [trnId]
+ : trnsList[dayDate].push(trnId)
}
+
return trnsList
}
},
diff --git a/components/wallets/Modal.vue b/components/wallets/Modal.vue
new file mode 100644
index 00000000..4132ebea
--- /dev/null
+++ b/components/wallets/Modal.vue
@@ -0,0 +1,237 @@
+<script>
+import { useContext } from '@nuxtjs/composition-api'
+import { db } from '~/services/firebaseConfig'
+
+export default {
+ setup () {
+ const { store } = useContext()
+
+ const closed = () => {
+ store.commit('wallets/hideWalletsModalWalletModal')
+ store.commit('wallets/setWalletsModalWalletModalId', null)
+ }
+
+ return {
+ closed
+ }
+ },
+
+ data () {
+ return {
+ showModalConfirm: false
+ }
+ },
+
+ computed: {
+ deleteInfo () {
+ if (this.trnsIds.length > 0)
+ return `It's also will delete ${this.trnsIds.length} trns in this wallet`
+
+ return null
+ },
+ walletId () {
+ return this.$store.state.wallets.modal.id
+ },
+ trnsIds () {
+ const trns = this.$store.state.trns.items
+ const trnsIds = []
+ for (const trnId in trns) {
+ if (trns[trnId].walletId === this.walletId ||
+ trns[trnId].walletFromId === this.walletId ||
+ trns[trnId].walletToId === this.walletId)
+ trnsIds.push(trnId)
+ }
+
+ return trnsIds
+ }
+ },
+
+ methods: {
+ handleSetFilterWallet () {
+ this.$store.commit('wallets/hideWalletsModalWalletModal')
+ this.$store.dispatch('ui/setActiveTab', 'stat')
+ this.$store.commit('filter/setFilterDateNow')
+ this.$store.dispatch('filter/setFilterWalletId', this.walletId)
+ this.$store.commit('wallets/setWalletsModalWalletModalId', null)
+
+ if (this.$store.state.ui.mobile) {
+ this.$store.dispatch('ui/setActiveTabViewName', 'stat')
+ this.$store.dispatch('ui/setActiveTabStat', 'details')
+ }
+ },
+
+ handleEditClick () {
+ const walletId = this.walletId
+ this.$store.commit('wallets/hideWalletsModalWalletModal')
+ this.$store.commit('wallets/setWalletsModalWalletModalId', null)
+ this.$store.commit('wallets/setWalletEditId', walletId)
+ this.$store.dispatch('ui/setActiveTab', 'createWallet')
+ },
+
+ handleDeleteClick () {
+ this.showModalConfirm = true
+ },
+
+ handleDeleteConfirm () {
+ const trnsIds = this.trnsIds
+ const uid = this.$store.state.user.user.uid
+ const id = this.walletId
+
+ this.showModalConfirm = false
+ this.$store.commit('wallets/hideWalletsModalWalletModal')
+ this.$store.commit('wallets/setWalletsModalWalletModalId', null)
+
+ setTimeout(async () => {
+ await this.$store.dispatch('trns/deleteTrnsByIds', trnsIds)
+ db.ref(`users/${uid}/accounts/${id}`)
+ .remove()
+ .then(() => console.log('wallet deleted'))
+ }, 200)
+ }
+ }
+}
+</script>
+
+<template lang="pug">
+Portal(
+ v-if="$store.state.wallets.modal.show"
+ key="walletsModal"
+ to="modal"
+)
+ LazyBaseBottomSheet(
+ v-if="$store.state.wallets.modal.id"
+ @closed="closed()"
+ )
+ template(#handler="{ close }")
+ .handler__close(@click="close")
+ svg(
+ viewBox='0 0 24 24'
+ fill='none'
+ stroke='#000'
+ stroke-linecap='round'
+ stroke-linejoin='round'
+ stroke-width='3'
+ )
+ path(d='M.75 23.249l22.5-22.5')
+ path(d='M23.25 23.249L.75.749')
+
+ template(#header)
+ template(v-if="walletId")
+ .walletWrap
+ WalletsItemWalletItem2(
+ :id="walletId"
+ vertical="center"
+ size="xl"
+ )
+
+ template
+ .content
+ template(v-if="$store.state.wallets.items[walletId].desc")
+ .info(style="padding-bottom:20px") {{ $store.state.wallets.items[walletId].desc }}
+
+ .modalLinks
+ ModalButton(
+ :name="$t('base.delete')"
+ icon="mdi mdi-delete-empty-outline"
+ @onClick="handleDeleteClick"
+ )
+ ModalButton(
+ :name="$t('base.edit')"
+ icon="mdi mdi-pencil-outline"
+ @onClick="handleEditClick"
+ )
+ ModalButton(
+ :name="$t('base.filter')"
+ icon="mdi mdi-filter-outline"
+ @onClick="handleSetFilterWallet"
+ )
+
+ ModalBottomConfirm(
+ :show="showModalConfirm"
+ :description="deleteInfo"
+ @onClose="showModalConfirm = false"
+ @onConfirm="handleDeleteConfirm"
+ )
+</template>
+
+<style lang="stylus">
+@import '~assets/stylus/variables'
+
+.container
+ .walletWrap
+ padding-bottom $m8
+ background var(--c-bg-3)
+
+ .walletItemGrid
+ width 100%
+ padding $m8
+ padding-top 0
+ padding-bottom $m6
+ border-bottom 0
+ background var(--c-bg-3)
+ border-radius $m6 $m6 0 0
+
+ &__name
+ padding-bottom $m9
+ color var(--c-font-2)
+ font-size 22px
+ text-align center
+ fontFamilyNunito()
+
+ &__line
+ height 6px
+ margin-right (- $m8)
+ margin-bottom $m8
+ margin-left (- $m8)
+</style>
+
+<style lang="stylus">
+@import '~assets/stylus/variables'
+
+.content
+ padding-top $m6
+ padding-bottom $m6
+ background var(--c-bg-3)
+ +media(600px)
+ border-radius 0 0 $m7 $m7
+
+.handler
+ z-index 2
+ position absolute
+ top 0
+ left 0
+ display flex
+ align-items center
+ justify-content center
+ width 100%
+ height 16px
+
+ &__close
+ z-index 3
+ cursor pointer
+ position absolute
+ top 4px
+ right 4px
+ display flex
+ align-items center
+ justify-content center
+ width 40px
+ height 40px
+ border-radius 50%
+ anim()
+
+ +media-hover()
+ background var(--c-blue-1)
+
+ svg
+ anim()
+ width 12px
+ height 12px
+ stroke var(--c-font-4)
+
+ +media-hover()
+ svg
+ width 12px
+ height 12px
+ stroke var(--c-font-1)
+</style>
diff --git a/components/wallets/PageMobile.vue b/components/wallets/PageMobile.vue
index 1e7474f2..2b1c98a5 100644
--- a/components/wallets/PageMobile.vue
+++ b/components/wallets/PageMobile.vue
@@ -22,21 +22,30 @@ LayoutComponentWrap(:contentPadding="false")
)
template(slot="bottom")
- .flex
- .col
- SharedButton(
- :title="$t('wallets.new')"
- className="_inline _small"
- @onClick="$store.dispatch('ui/setActiveTab', 'createWallet')"
- )
- .col
- SharedButton(
- :title="$t('base.sort')"
- className="_inline _small"
- @onClick="$store.dispatch('ui/setActiveTab', 'walletsSort')"
- )
+ .buttons
+ .button(@click="$store.dispatch('ui/setActiveTab', 'createWallet')") {{ $t('wallets.new') }}
+ //- SharedButton(
+ //- :title="$t('wallets.new')"
+ //- className="_inline _small"
+ //- @onClick="$store.dispatch('ui/setActiveTab', 'createWallet')"
+ //- )
+ .button(@click="$store.dispatch('ui/setActiveTab', 'walletsSort')") {{ $t('base.sort') }}
+ //- SharedButton(
+ //- :title="$t('base.sort')"
+ //- className="_inline _small"
+ //- @onClick="$store.dispatch('ui/setActiveTab', 'walletsSort')"
+ //- )
</template>
<style lang="stylus" scoped>
-//
+@import '~assets/stylus/variables'
+
+.buttons
+ display flex
+ align-items center
+ justify-content center
+ gap $m8
+
+.button
+ button-base-1()
</style>
diff --git a/components/wallets/list/WalletsList.vue b/components/wallets/list/WalletsList.vue
index d92b169b..e4a7a64b 100644
--- a/components/wallets/list/WalletsList.vue
+++ b/components/wallets/list/WalletsList.vue
@@ -58,7 +58,7 @@ export default {
</script>
<template lang="pug">
-.walllets
+.wallets
div(:class="className")
WalletsItemWalletItem(
v-for="walletId in walletsIds"
diff --git a/components/wallets/list/WalletsList3.vue b/components/wallets/list/WalletsList3.vue
index 2002a5c1..ba832be6 100644
--- a/components/wallets/list/WalletsList3.vue
+++ b/components/wallets/list/WalletsList3.vue
@@ -57,8 +57,8 @@ export default {
</script>
<template lang="pug">
-.walllets
- .walllets__grid
+.wallets
+ .wallets__grid
WalletsItemWalletItem2(
:activeItemId="activeItemId"
v-for="walletId in walletsIds"
@@ -68,7 +68,7 @@ export default {
v-on="$listeners"
)
- .walletsList__toogle._alt(v-if="showToogle && $store.getters['wallets/walletsSortedIds'].length > limit" @click="toogleWallets")
+ .wallets__toogle(v-if="showToogle && $store.getters['wallets/walletsSortedIds'].length > limit" @click="toogleWallets")
template(v-if="stateLimit > 0") {{ this.$t('wallets.showAll') }}
template(v-else) {{ this.$t('wallets.showOnly') }} {{ limit }}
</template>
@@ -76,22 +76,22 @@ export default {
<style lang="stylus" scoped>
@import '~assets/stylus/variables'
-.walllets
+.wallets
padding 0 $m7
-.walllets__grid
- display grid
- grid-template-columns repeat(2, 1fr)
- grid-column-gap $m7
- grid-row-gap $m7
-
- +media(600px)
- grid-template-columns repeat(auto-fill, minmax(220px, 1fr))
+ &__grid
+ display grid
+ grid-template-columns repeat(2, 1fr)
grid-column-gap $m7
grid-row-gap $m7
-.walletsList__toogle._alt
- margin-right 0
- margin-left 0
- border-top 0
+ +media(600px)
+ grid-template-columns repeat(4, minmax(220px, 1fr))
+ grid-column-gap $m7
+ grid-row-gap $m7
+
+ &__toogle
+ button-base-1()
+ margin-top $m9
+ margin-bottom $m9
</style>
diff --git a/components/wallets/modal/WalletModal.vue b/components/wallets/modal/WalletModal.vue
deleted file mode 100644
index daad58ee..00000000
--- a/components/wallets/modal/WalletModal.vue
+++ /dev/null
@@ -1,152 +0,0 @@
-<script>
-import { db } from '~/services/firebaseConfig'
-
-export default {
- data () {
- return {
- showModalConfirm: false
- }
- },
-
- computed: {
- deleteInfo () {
- if (this.trnsIds.length > 0)
- return `It's also will delete ${this.trnsIds.length} trns in this wallet`
-
- return null
- },
- walletId () {
- return this.$store.state.wallets.modal.id
- },
- trnsIds () {
- const trns = this.$store.state.trns.items
- const trnsIds = []
- for (const trnId in trns) {
- if (trns[trnId].walletId === this.walletId ||
- trns[trnId].walletFromId === this.walletId ||
- trns[trnId].walletToId === this.walletId)
- trnsIds.push(trnId)
- }
-
- return trnsIds
- }
- },
-
- methods: {
- handleSetFilterWallet () {
- this.$store.commit('wallets/hideWalletsModalWalletModal')
- this.$store.dispatch('ui/setActiveTab', 'stat')
- this.$store.commit('filter/setFilterDateNow')
- this.$store.dispatch('filter/setFilterWalletId', this.walletId)
- this.$store.commit('wallets/setWalletsModalWalletModalId', null)
-
- if (this.$store.state.ui.mobile) {
- this.$store.dispatch('ui/setActiveTabViewName', 'stat')
- this.$store.dispatch('ui/setActiveTabStat', 'details')
- }
- },
-
- handleEditClick () {
- const walletId = this.walletId
- this.$store.commit('wallets/hideWalletsModalWalletModal')
- this.$store.commit('wallets/setWalletsModalWalletModalId', null)
- this.$store.commit('wallets/setWalletEditId', walletId)
- this.$store.dispatch('ui/setActiveTab', 'createWallet')
- },
-
- handleDeleteClick () {
- this.showModalConfirm = true
- },
-
- handleDeleteConfirm () {
- const trnsIds = this.trnsIds
- const uid = this.$store.state.user.user.uid
- const id = this.walletId
-
- this.showModalConfirm = false
- this.$store.commit('wallets/hideWalletsModalWalletModal')
- this.$store.commit('wallets/setWalletsModalWalletModalId', null)
-
- setTimeout(async () => {
- await this.$store.dispatch('trns/deleteTrnsByIds', trnsIds)
- db.ref(`users/${uid}/accounts/${id}`)
- .remove()
- .then(() => console.log('wallet deleted'))
- }, 200)
- }
- }
-}
-</script>
-
-<template lang="pug">
-Portal(
- v-if="$store.state.wallets.modal.show"
- to="modal"
-)
- ModalBottom(
- @onClose="$store.commit('wallets/hideWalletsModalWalletModal')"
- @afterClose="$store.commit('wallets/setWalletsModalWalletModalId', null)"
- )
- template(v-if="walletId")
- template(slot="emptyHeader")
- WalletsItemWalletItem2(
- :id="walletId"
- vertical="center"
- size="xl"
- )
-
- template(slot="description")
- template(v-if="$store.state.wallets.items[walletId].desc")
- div(style="padding-bottom:20px") {{ $store.state.wallets.items[walletId].desc }}
-
- template(slot="btns")
- ModalButton(
- :name="$t('base.delete')"
- icon="mdi mdi-delete-empty-outline"
- @onClick="handleDeleteClick"
- )
- ModalButton(
- :name="$t('base.edit')"
- icon="mdi mdi-pencil-outline"
- @onClick="handleEditClick"
- )
- ModalButton(
- :name="$t('base.filter')"
- icon="mdi mdi-filter-outline"
- @onClick="handleSetFilterWallet"
- )
-
- ModalBottomConfirm(
- :show="showModalConfirm"
- :description="deleteInfo"
- @onClose="showModalConfirm = false"
- @onConfirm="handleDeleteConfirm"
- )
-</template>
-
-<style lang="stylus">
-@import "~assets/stylus/variables"
-
-.modalBottom
- .walletItemGrid
- width 100%
- padding $m8
- padding-top 0
- padding-bottom $m6
- background var(--c-bg-3)
- border-bottom 0
- border-radius $m6 $m6 0 0
-
- &__name
- padding-bottom $m7
- color var(--c-font-2)
- font-size 22px
- text-align center
- fontFamilyNunito()
-
- &__line
- height 6px
- margin-right (- $m8)
- margin-bottom $m8
- margin-left (- $m8)
-</style>>
diff --git a/locales/en-US.js b/locales/en-US.js
index f15c9e9d..94277f7d 100644
--- a/locales/en-US.js
+++ b/locales/en-US.js
@@ -89,7 +89,7 @@ export default {
save: 'Save',
cancel: 'Cancel',
dublicate: 'Dublicate',
- setFilter: 'Set filter by',
+ setFilter: 'Filter by',
on: 'On',
ok: 'Ok',
off: 'Off',
@@ -143,8 +143,8 @@ export default {
title: 'Wallets',
name: 'Wallets',
new: 'New wallet',
- showAll: 'show all wallets',
- showOnly: 'show only',
+ showAll: 'Show all wallets',
+ showOnly: 'Show only',
sortTitle: 'Sort wallets',
createNewTitle: 'Create new wallet',
editTitle: 'Edit wallet',
diff --git a/locales/ru-RU.js b/locales/ru-RU.js
index 5e63d385..de62b182 100644
--- a/locales/ru-RU.js
+++ b/locales/ru-RU.js
@@ -93,7 +93,7 @@ export default {
ok: 'Хорошо',
on: 'Да',
dublicate: 'Дублировать',
- setFilter: 'Применить фильтр по',
+ setFilter: 'Фильтр',
off: 'Нет',
edit: 'Редактировать',
delete: 'Удалить',
@@ -145,8 +145,8 @@ export default {
title: 'Кошельки',
name: 'Кошельки',
new: 'Новый кошелек',
- showAll: 'показать все кошельки',
- showOnly: 'показать только',
+ showAll: 'Показать все кошельки',
+ showOnly: 'Показать только',
sortTitle: 'Сортировать кошельки',
createNewTitle: 'Создание кошелька',
editTitle: 'Редактирование кошелек',
diff --git a/nuxt.config.js b/nuxt.config.js
index a9bca136..2e5f46e1 100644
--- a/nuxt.config.js
+++ b/nuxt.config.js
@@ -71,8 +71,8 @@ export default {
// Color mode
colorMode: {
- preference: 'system', // default value of $colorMode.preference
- fallback: 'dark' // fallback value if not system preference found
+ preference: 'dark' // default value of $colorMode.preference
+ // fallback: 'dark' // fallback value if not system preference found
},
// Style resources
diff --git a/package.json b/package.json
index 3febcd76..f8de1889 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "finapp",
- "version": "3.14.0",
+ "version": "3.14.2",
"scripts": {
"dev": "cross-env NUXT_HOST=0.0.0.0 nuxt",
"build": "nuxt build",