Skip to content

Open source personal finance application

update 3.30.0

ilkome7a664b541ece
diff --git a/assets/stylus/colors-dark.styl b/assets/stylus/colors-dark.styl
index 4ca3dcfa..c184b652 100644
--- a/assets/stylus/colors-dark.styl
+++ b/assets/stylus/colors-dark.styl
@@ -27,7 +27,7 @@ html.dark
--color-text-link rgba(88,166,255,1)
--color-link-bg rgba(28,31,36,1)
- --c-item-bg-main rgba(30,30,30,1)
+ --c-item-bg-main #1e1e1e
--c-item-bd-main rgba(44,44,44,1)
--c-item-bg-hover rgba(35,35,35,1)
--c-item-bd-hover rgba(35,35,35,1)
diff --git a/components/categories/EditModal.vue b/components/categories/EditModal.vue
index cd1b9e4f..b98ddfe6 100644
--- a/components/categories/EditModal.vue
+++ b/components/categories/EditModal.vue
@@ -259,20 +259,14 @@ div
@click="activeTab = 'icons'"
) {{ $t('categories.form.icons.label') }}
- .preview(v-if="activeTab !== 'data'")
- .previewIcon
- Icon(
- :icon="category.icon"
- :background="category.color"
- round
- )
- .categoryParentItem(style="width: 100%")
- .categoryParentItem__icon
- Icon(
- :icon="category.icon"
- :color="category.color"
- )
- .categoryParentItem__name {{ category.name || $t('categories.form.name.label') }}
+ .bg-main.m-3.p-2.rounded-md.items-center.gap-x-3.flex(
+ v-if="activeTab !== 'data'"
+ )
+ .text-neutral-50.text-xl.leading-none.w-8.h-8.rounded-full.justify-center.items-center.flex(
+ :style="{ background: category.color }"
+ @click.stop="handleIconClick"
+ ): div(:class="category.icon")
+ .text-sm.text-neutral-700(class="dark:text-neutral-300") {{ category.name || $t('categories.form.name.label') }}
//-
//- Content
@@ -447,13 +441,16 @@ div
CategoriesView(
:activeItemId="category.parentId"
- :noPadding="true"
:ids="$store.getters['categories/categoriesForBeParent'].filter(cId => cId !== categoryId)"
+ noPadding
@onClick="handleParenCategorySelect"
)
</template>
<style lang="stylus" scoped>
+.bg-main
+ background var(--c-item-bg-main)
+
.preview
display flex
align-items center
@@ -488,19 +485,6 @@ div
background var(--c-item-bg-hover)
border 1px solid var(--c-item-bd-hover)
- &__icon
- padding-right $m6
- +media(700px)
- padding-right $m8
-
- &__name
- overflow hidden
- display flex
- flex-grow 1
- text-overflow ellipsis
- padding-right 0
- font-size 14px
-
.menu
overflow hidden
z-index 10
diff --git a/components/categories/Form.vue b/components/categories/Form.vue
index eed943d2..c2cd1ab7 100644
--- a/components/categories/Form.vue
+++ b/components/categories/Form.vue
@@ -236,8 +236,6 @@ export default {
.inputModal__label {{ $t('categories.form.parent.label') }}
.form__btns
- pre {{ showColors }}
- pre(@click="showIcons = !showIcons") {{ showIcons }}
//- Colors
.form__btns__i.cursor-pointer
.form-line(@click="showColors = true")
diff --git a/components/categories/Modal.vue b/components/categories/Modal.vue
index 493f7137..bddb7556 100644
--- a/components/categories/Modal.vue
+++ b/components/categories/Modal.vue
@@ -137,8 +137,8 @@ Portal(
Icon(
:icon="category.icon"
:background="category.color || $store.state.ui.defaultBgColor"
- :round="true"
- :big="true"
+ big
+ round
)
.header__title {{ category.name }}
.header__subCategory(v-if="category.parentId") {{ $store.state.categories.items[category.parentId].name }}
@@ -168,9 +168,9 @@ Portal(
.categoriesTitle {{ $t('categories.title') }}
.categories
CategoriesView(
- :borderTop="true"
:ids="childCategoriesIds"
- :noPadding="true"
+ borderTop
+ noPadding
@onClick="id => $store.dispatch('categories/showCategoryModal', id)"
)
diff --git a/components/categories/item/CategoryItem.vue b/components/categories/item/CategoryItem.vue
index 04f753f4..60af757a 100644
--- a/components/categories/item/CategoryItem.vue
+++ b/components/categories/item/CategoryItem.vue
@@ -1,7 +1,8 @@
<script>
-import { computed, useNuxtApp } from '#app'
+import { computed, useNuxtApp, defineComponent } from '#app'
+import useFilter from '~/modules/filter/useFilter'
-export default {
+export default defineComponent({
props: {
activeItemId: { type: String, default: null },
category: { type: Object, required: true },
@@ -12,6 +13,8 @@ export default {
setup ({ id, category }, { listeners }) {
const { $store } = useNuxtApp()
+ const { setCategoryFilter } = useFilter()
+
const childCategoriesIds = computed(() => $store.getters['categories/getChildCategoriesIds'](id))
const parentCategory = computed(() => $store.state.categories.items[category.parentId])
@@ -21,8 +24,11 @@ export default {
}
function onClickIcon () {
- if (listeners.onIconClick)
- listeners.onIconClick(id)
+ setCategoryFilter(id)
+ $store.commit('filter/setFilterDateNow')
+ $store.commit('categories/hideCategoryModal')
+ $store.commit('categories/setCategoryModalId', null)
+ $store.dispatch('ui/setActiveTabStat', 'details')
}
return {
@@ -32,121 +38,61 @@ export default {
onClickIcon
}
}
-}
+})
</script>
<template lang="pug">
-.categoryItem(
+.categoryItem.bg-main.p-2.gap-x-3.items-center.flex.rounded-md(
v-if="category"
:class="{ [ui]: ui, _active: activeItemId === id }"
@click="onClickItem"
)
.categoryItem__active(v-if="activeItemId === id")
- .categoryItem__icon
- Icon(
- :category="true"
- :color="category.color || $store.state.ui.defaultBgColor"
- :icon="category.icon"
- small
- @click="handleIconClick"
- )
-
- .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 }}
+ .text-neutral-50.text-xl.leading-none.w-8.h-8.rounded-full.justify-center.items-center.flex(
+ :style="{ background: category.color }"
+ @click.stop="onClickIcon"
+ ): div(:class="category.icon")
+
+ .categoryItem__name.grow.truncate
+ .text-xs.text-neutral-500(
+ v-if="parentCategory"
+ class="dark:text-neutral-400"
+ ) {{ parentCategory.name }}
+
+ .leading-none.text-sm.text-neutral-700(class="dark:text-neutral-300") {{ category.name }}
+
+ .text-md.text-neutral-500(
+ v-if="childCategoriesIds.length > 0"
+ class="dark:text-neutral-400"
+ ) {{ childCategoriesIds.length }}
</template>
<style lang="stylus" scoped>
-.categoryItem
- overflow hidden
- cursor pointer
- position relative
- display flex
- flex-flow row nowrap
- align-items center
- justify-content center
- min-height 48px
- padding $m6
- color var(--c-font-1)
+.bg-main
background var(--c-item-bg-main)
- border 1px solid transparent
- border-radius $m5
- anim()
+media-hover()
- color var(--c-text-1)
background var(--c-item-bg-hover)
- border 1px solid var(--c-item-bd-hover)
&._active
background var(--c-item-bg-hover)
- border 1px solid var(--c-item-bd-hover)
-
- &._flat
- flex-flow row
- align-items center
- justify-content center
- min-height inherit
- flex 1 1 auto
- padding $m6
-
- &:active
- opacity .9
-
- &__icon
- padding-right $m6
-
- +media(700px)
- padding-right $m8
- ^[0]._flat &
- padding-right $m5
- padding-bottom 0
-
- &__name
- overflow hidden
- display flex
- flex-grow 1
- text-overflow ellipsis
- padding-right 0
- font-size 14px
-
- ^[0]._flat &
- display block
- flex-grow 1
- min-height inherit
-
- &:last-child
- padding-bottom 0
+.categoryItem
+ overflow hidden
+ cursor pointer
+ position relative
+ color var(--c-font-1)
&__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)
- font-size 12px
- text-align center
-
- ^[0]._flat &
- text-align left
&__child
color var(--c-font-1)
- font-size 14px
- text-align center
/.light-mode &
color var(--c-font-4)
- ^[0]._flat &
- text-align left
-
&__active
position absolute
top $m5
diff --git a/components/layout/Sidebar.vue b/components/layout/Sidebar.vue
index 5ad7ba2d..98aae13c 100644
--- a/components/layout/Sidebar.vue
+++ b/components/layout/Sidebar.vue
@@ -21,7 +21,9 @@ export default {
WalletsList(
:showToogle="true"
:limit="6"
- @onClick="(id) => handleShowWalletsModalWalletModal(id)")
+ ui="simple"
+ @onClick="(id) => handleShowWalletsModalWalletModal(id)"
+ )
.sidebar__trn.py-2(@click="$store.dispatch('trnForm/openTrnForm', { action: 'create' })")
.btn
diff --git a/components/stat/Index.vue b/components/stat/Index.vue
index 531b3040..3eaa5dc4 100644
--- a/components/stat/Index.vue
+++ b/components/stat/Index.vue
@@ -10,7 +10,7 @@ export default {
const { $store } = useNuxtApp()
const { statPage } = useStatPage()
const { ui } = useUIView()
- const { moneyTypes } = useStat()
+ const { moneyTypes, isEmptyStat } = useStat()
const { onWatch } = useStatChart()
onWatch()
@@ -36,7 +36,7 @@ export default {
const isShowGroupTrns = computed(() => {
const p1 = statPage.activeTab === 'incomes' || statPage.activeTab === 'expenses'
const p2 = statPage.average.total === 0
- return p1 || p2
+ return (p1 || p2) && statPage.activeTab !== 'history'
})
return {
@@ -45,6 +45,7 @@ export default {
isShowTrns,
moneyTypes,
statPage,
+ isEmptyStat,
ui
}
}
@@ -81,8 +82,17 @@ export default {
StatGroupCatsRound(:typeText="item.id")
StatGroupCatsHorizontal(:typeText="item.id")
- LazyStatGroupTrns(v-if="isShowGroupTrns")
+ LazyStatGroupTrns(v-if="isShowGroupTrns && !isEmptyStat")
- StatEmpty
- LazyStatTrns(v-if="isShowTrns")
+ template(v-if="statPage.activeTab !== 'history'")
+ StatEmpty
+ LazyStatTrns.px-3(
+ v-if="isShowTrns && !isEmptyStat"
+ )
+
+ .px-3(v-if="statPage.activeTab === 'history'")
+ TrnsListHistory(
+ :size="50"
+ isShowFilter
+ )
</template>
diff --git a/components/stat/Menu.vue b/components/stat/Menu.vue
index 9db8de5d..561093f2 100644
--- a/components/stat/Menu.vue
+++ b/components/stat/Menu.vue
@@ -39,7 +39,8 @@ export default {
) {{ $t('money.incomes') }}
.menuItem.statTitle(
- @click="$router.push('history')"
+ :class="{ _active: activeTabStat === 'history' }"
+ @click="onClickStatMenu('history')"
) {{ $t('trns.history') }}
</template>
diff --git a/components/stat/StatItem.vue b/components/stat/StatItem.vue
index 7350c39f..b98a2f91 100644
--- a/components/stat/StatItem.vue
+++ b/components/stat/StatItem.vue
@@ -89,20 +89,18 @@ export default {
:class="{ _active: isShowInside }"
@click="toogleShowInside"
)
- .z-10.ins.py-2.px-3.space-x-3.rounded-md.justify-between.items-center.flex.border(
- :class="{ _active: isShowInside, 'dark:border-neutral-800 cursor-n-resize shadow-xl': isShowInside, 'border-transparent cursor-s-resize shadow': !isShowInside }"
+ .ins.py-2.px-3.space-x-3.rounded-md.justify-between.items-center.flex.border(
+ :class="['z-[9]', { _active: isShowInside }, { 'dark:border-neutral-800 cursor-n-resize shadow-xl': isShowInside }, { 'border-transparent cursor-s-resize shadow': !isShowInside }]"
)
- .cursor-pointer.statItem__icon(@click.stop="setCategoryFilter(categoryId)")
- .text-neutral-50.text-2xl.leading-none.w-8.h-8.rounded-full.justify-center.items-center.flex(
- ): div(:class="category.icon" :style="{ color: category.color }")
+ .cursor-pointer.text-neutral-50.text-xl.leading-none.w-8.h-8.rounded-full.justify-center.items-center.flex(
+ :style="{ background: category.color }"
+ @click.stop="setCategoryFilter(categoryId)"
+ ): div(:class="category.icon")
.grow
.space-x-3.flex
.overflow-hidden.truncate.grow.space-x-2.flex.items-baseline.text-neutral-700(class="dark:text-neutral-400")
.overflow-hidden.text-sm {{ category.name }}{{ showChildCategories ? '...' : '' }}
- //- pre {{ getCatgoryName }}
- //- .overflow-hidden.space-x-2.items-baseline.flex.truncate.text-xs
- //- .text-xs(v-for="name in getCatgoryName") {{ name }}
.statItem__amount
Amount(
@@ -111,7 +109,6 @@ export default {
)
.pt-1.statItem__graph.mt-1: .statItem__graph__in(:style="styles")
- //- pre {{ $store.state.categories.items }}
//- Inside
.overflow-hidden.ins2.mx-2.rounded-b-md.border.border-t-0(
v-if="isShowInside"
diff --git a/components/stat/StatItemChildCatsItem.vue b/components/stat/StatItemChildCatsItem.vue
index 3a3eb6a5..2387240a 100644
--- a/components/stat/StatItemChildCatsItem.vue
+++ b/components/stat/StatItemChildCatsItem.vue
@@ -49,9 +49,10 @@ export default {
.ins.py-2.px-3.space-x-3.justify-between.items-center.flex.border-t(
:class="[{ _active: isShowInside }, { 'border-b-0 cursor-n-resize': isShowInside }, { 'cursor-s-resize': !isShowInside }, 'dark:border-neutral-800']"
)
- .cursor-pointer.statItem__icon(@click.stop="setCategoryFilter(categoryId)")
- .text-neutral-50.text-2xl.leading-none.w-8.h-8.rounded-full.justify-center.items-center.flex(
- ): div(:class="category.icon" :style="{ color: category.color }")
+ .text-neutral-50.text-xl.leading-none.w-8.h-8.rounded-full.justify-center.items-center.flex(
+ :style="{ background: category.color }"
+ @click.stop="setCategoryFilter(categoryId)"
+ ): div(:class="category.icon")
.grow
.space-x-3.flex
diff --git a/components/stat/StatItemRound.vue b/components/stat/StatItemRound.vue
index 05c50ccd..2aff17ed 100644
--- a/components/stat/StatItemRound.vue
+++ b/components/stat/StatItemRound.vue
@@ -47,27 +47,6 @@ export default {
// long press
const item = ref(document.createElement('div'))
- onMounted(() => {
- // Long press for delete
- // const element: HTMLElement = item.value
- // element.addEventListener('long-press', () => {
- // $store.dispatch('trnForm/openTrnForm', {
- // action: 'create'
- // })
-
- // if (isCategoryHasChildren.value) {
- // $store.commit('trnForm/showTrnFormModal', 'categories')
- // $store.commit('trnForm/showTrnFormModal', 'categoriesChild')
- // $store.commit('trnForm/setTrnFormModalCategoryId', categoryId.value)
- // }
- // else {
- // $store.commit('trnForm/setTrnFormValues', {
- // categoryId: categoryId.value
- // })
- // }
- // })
- })
-
return {
setCategoryFilter,
trnsIds,
@@ -89,12 +68,10 @@ export default {
@click="setCategoryFilter(categoryId)"
)
.statItemRound__icon
- Icon(
- :icon="category.icon"
- :color="category.color"
- background="var(--c-item-stat-bg)"
- round
- )
+ .text-neutral-50.text-xl.leading-none.w-8.h-8.rounded-full.justify-center.items-center.flex(
+ :style="{ background: category.color }"
+ @click.stop="setCategoryFilter(categoryId)"
+ ): div(:class="category.icon")
.statItemRound__name.js-getWidth(:class="{ _isCategoryHasChildren: isCategoryHasChildren }") {{ category.name }}{{ isCategoryHasChildren ? '...' : '' }}
.statItemRound__amount.js-getWidth
diff --git a/components/stat/filter/Index.vue b/components/stat/filter/Index.vue
index 2caffe49..04aa1881 100644
--- a/components/stat/filter/Index.vue
+++ b/components/stat/filter/Index.vue
@@ -12,11 +12,9 @@ export default {
const filterWallet = computed(() => $store.state.wallets.items[$store.state.filter.walletId])
const onClearCategory = () => {
- console.log('onClearCategory')
- if (filterCategory.value.parentId)
- setCategoryFilter(filterCategory.value.parentId)
- else
- setCategoryFilter(null)
+ filterCategory.value.parentId
+ ? setCategoryFilter(filterCategory.value.parentId)
+ : setCategoryFilter(null)
}
const onClearFilter = () => {
diff --git a/components/trnForm/TrnForm.vue b/components/trnForm/TrnForm.vue
index 1ed619f0..aa81a2d4 100644
--- a/components/trnForm/TrnForm.vue
+++ b/components/trnForm/TrnForm.vue
@@ -250,7 +250,6 @@ export default {
CategoriesView(
:ids="$store.getters['categories/quickSelectorCategoriesIds']"
:activeItemId="$store.state.trnForm.values.categoryId"
- ui="_flat"
:noPaddingBottom="true"
@onClick="onCategoryClick"
)
@@ -261,7 +260,6 @@ export default {
CategoriesView(
:ids="$store.getters['categories/lastUsedCategoriesIdsByDate']"
:activeItemId="$store.state.trnForm.values.categoryId"
- ui="_flat"
:noPaddingBottom="true"
@onClick="onCategoryClick"
)
diff --git a/components/trnForm/TrnFormCalendar.vue b/components/trnForm/TrnFormCalendar.vue
index 68f3f84a..ff92b98f 100644
--- a/components/trnForm/TrnFormCalendar.vue
+++ b/components/trnForm/TrnFormCalendar.vue
@@ -32,10 +32,10 @@ export default {
<template lang="pug">
.trnFormDate
- .trnFormDate__item._arrow(@click="setPrevDay()"): .mdi.mdi-chevron-left
+ .shame1._arrow(@click="setPrevDay()"): .mdi.mdi-chevron-left
.trnFormDate__item._date(@click="$store.commit('trnForm/showTrnFormModal', 'calendar')") {{ formatedDate }}
.flex
- .trnFormDate__item._arrow(
+ .shame1._arrow(
v-if="!isToday" @click="setNextDay()"
style="marginRight: 16px"
): .mdi.mdi-chevron-right
@@ -47,6 +47,32 @@ export default {
</template>
<style lang="stylus" scoped>
+.shame1
+ cursor pointer
+ display flex
+ align-items center
+ justify-content center
+ width 44px
+ height 44px
+ padding $m7
+ color var(--c-font-3)
+ font-size 22px
+ border-bottom 0
+ border-right 0
+ background var(--c-item-bg-main)
+ border 1px solid var(--c-item-bd-main)
+ border-radius 50%
+ user-select none
+ anim(100ms)
+
+ +media(360px)
+ width 58px
+ height 58px
+
+ +media-hover()
+ background var(--c-bg-7)
+ border 1px solid var(--c-bg-8)
+
.trnFormDate
display grid
height 100%
diff --git a/components/trnForm/TrnFormCategories.vue b/components/trnForm/TrnFormCategories.vue
index b536a07b..7e6b926a 100644
--- a/components/trnForm/TrnFormCategories.vue
+++ b/components/trnForm/TrnFormCategories.vue
@@ -57,7 +57,6 @@ export default {
:ids="$store.getters['categories/lastUsedCategoriesIdsByDate']"
:noPaddingBottom="true"
@onClick="handleCategoryClick"
- ui="_flat"
)
.swiper-slide
@@ -81,7 +80,6 @@ export default {
:ids="$store.getters['categories/quickSelectorCategoriesIds']"
:noPaddingBottom="true"
@onClick="handleCategoryClick"
- ui="_flat"
)
.flex.justify-center(v-if="slider")
diff --git a/components/trnForm/TrnFormHeaderItemCategory.vue b/components/trnForm/TrnFormHeaderItemCategory.vue
index 44253951..6810bdee 100644
--- a/components/trnForm/TrnFormHeaderItemCategory.vue
+++ b/components/trnForm/TrnFormHeaderItemCategory.vue
@@ -16,22 +16,26 @@ export default {
</script>
<template lang="pug">
-.trnFormHeaderItem._category(
+.trnFormHeaderItem._category.gap-x-3.flex(
v-if="category"
- :style="{ background: category.color }"
@click="$store.commit('trnForm/showTrnFormModal', 'categories')"
)
transition(name="slide2")
- .trnFormHeaderItem__icon(
- v-show="true"
- :key="category.icon"
- )
- Icon(:icon="category.icon")
+ .text-neutral-50.text-xl.leading-none.w-8.h-8.rounded-full.justify-center.items-center.flex(
+ :style="{ background: category.color }"
+ @click.stop="handleIconClick"
+ ): div(:class="category.icon")
+
.trnFormHeaderItem__name
- .parent(v-if="parentCategory") {{ parentCategory.name }}
- .child {{ category.name }}
+ .text-xs.text-neutral-500(
+ v-if="parentCategory"
+ class="dark:text-neutral-400"
+ ) {{ parentCategory.name }}
+ .text-sm.text-neutral-700(class="dark:text-neutral-300") {{ category.name }}
- .trnFormHeaderItem__dots: .mdi.mdi-dots-vertical
+ .trnFormHeaderItem__dots.text-neutral-500(
+ class="dark:text-neutral-400"
+ ): .mdi.mdi-dots-vertical
</template>
<style lang="stylus" scoped>
@@ -43,7 +47,7 @@ export default {
display flex
align-items center
padding $m5 $m6
- background var(--c-bg-3)
+ background var(--c-item-bg-main)
.trnFormHeaderItem__icon
padding-right $m4
diff --git a/components/trnForm/TrnFormHeaderItemWallet.vue b/components/trnForm/TrnFormHeaderItemWallet.vue
index fc7ad0f5..1d7fd70c 100644
--- a/components/trnForm/TrnFormHeaderItemWallet.vue
+++ b/components/trnForm/TrnFormHeaderItemWallet.vue
@@ -20,11 +20,11 @@ export default {
WalletsItemWalletItem(
:id="$store.state.trnForm.values.walletId"
:showBase="false"
- isAltColor
- ui="tile"
)
- .trnFormHeaderItem__dots: .mdi.mdi-dots-vertical
+ .trnFormHeaderItem__dots.text-neutral-500(
+ class="dark:text-neutral-400"
+ ): .mdi.mdi-dots-vertical
</template>
<style lang="stylus" scoped>
diff --git a/components/trnForm/TrnFormHeaderTransfer.vue b/components/trnForm/TrnFormHeaderTransfer.vue
index ec5227c4..98c8a789 100644
--- a/components/trnForm/TrnFormHeaderTransfer.vue
+++ b/components/trnForm/TrnFormHeaderTransfer.vue
@@ -74,9 +74,9 @@ export default {
.trnFormHeaderSeparator
z-index 2
position absolute
- top 28px
+ top 22px
left 50%
- color var(--c-font-1)
+ color var(--c-font-3)
font-size 32px
transform translate(-50%)
@@ -85,7 +85,4 @@ export default {
margin-bottom 2px
color var(--c-font-4)
font-size 12px
-
- .walletItemGrid
- width 100%
</style>
diff --git a/components/trnForm/TrnFormTrns.vue b/components/trnForm/TrnFormTrns.vue
index 0797888c..d081ff13 100644
--- a/components/trnForm/TrnFormTrns.vue
+++ b/components/trnForm/TrnFormTrns.vue
@@ -1,9 +1,8 @@
-<script>
+<script lang="ts">
+import { useNuxtApp, defineComponent } from '#app'
import useCalculator from '~/components/trnForm/calculator/useCalculator'
-export default {
- name: 'TrnFormTrns',
-
+export default defineComponent({
props: {
categoryId: { type: String, default: null },
expenses: { type: Boolean, default: false },
@@ -15,6 +14,27 @@ export default {
ui: { type: String, default: 'history' }
},
+ setup ({ slider }) {
+ const { $store } = useNuxtApp()
+
+ const actions = trnItem => ({
+ onOpenDetails: () => {
+ event.stopPropagation()
+ event.stopPropagation()
+ const { setExpression } = useCalculator()
+ setExpression($store.state.trns.items[trnItem.id].amount)
+ slider.slideTo(1)
+ },
+
+ onOpenEdit: () => {},
+ onSetFilter: () => {}
+ })
+
+ return {
+ actions
+ }
+ },
+
data () {
return {
pageNumber: 1,
@@ -104,15 +124,9 @@ export default {
setTimeout(() => {
this.slider.slideTo(0, 0)
}, 100)
- },
-
- onClickEditTrn (amount) {
- const { setExpression } = useCalculator()
- setExpression(amount)
- this.slider.slideTo(1)
}
}
-}
+})
</script>
<template lang="pug">
@@ -121,19 +135,20 @@ export default {
.containerWrap(v-if="trnsIds.length === 0") No transactions
.scrollBlock
- .trnsList__content.pt-2
- .trnsList__day(v-for="(trnsIds, date) in groupedTrns")
- .trnsList__header: TrnsListDate(:date="date")
- .trnsList__trns
- TrnsItemTrnItem(
+ .m-3.overflow-hidden.rounded-md.bg-4(
+ v-for="(trnsIds, date) in groupedTrns"
+ :key="date"
+ )
+ .pt-4
+ .pb-2.px-3
+ TrnsListDate(:date="date")
+
+ .overflow-hidden.rounded-md
+ TrnsItemHistory.py-3.px-2.rounded-md.cursor-pointer(
v-for="trnId in trnsIds"
- :isActive="$store.state.trnForm.values.trnId === trnId"
- :category="$store.state.categories.items[$store.state.trns.items[trnId].categoryId]"
:key="trnId"
- :trn="$store.state.trns.items[trnId]"
+ :actions="actions"
:trnId="trnId"
- :wallet="$store.state.wallets.items[$store.state.trns.items[trnId].walletId]"
- @onClickEdit="onClickEditTrn($store.state.trns.items[trnId].amount)"
)
.trnsList__pages(v-if="!isShowedAllTrns")
diff --git a/components/trnForm/TrnFormTypes.vue b/components/trnForm/TrnFormTypes.vue
index 586e9507..e60e3930 100644
--- a/components/trnForm/TrnFormTypes.vue
+++ b/components/trnForm/TrnFormTypes.vue
@@ -26,17 +26,17 @@ export default {
<template lang="pug">
.flex.justify-center
.overflow-hidden.flex.items-center.bg-4.rounded-md
- .barItem.px-6.py-3.font5.text-sm(
+ .barItem.px-6.py-2.font5.text-sm(
@click="() => setAmountType(0)"
:class="{ _active: amountType === 0 }"
) {{ $t('money.expenses') }}
- .barItem.px-6.py-3.font5.text-sm(
+ .barItem.px-6.py-2.font5.text-sm(
@click="() => setAmountType(1)"
:class="{ _active: amountType === 1 }"
) {{ $t('money.incomes') }}
- .barItem.px-6.py-3.font5.text-sm(
+ .barItem.px-6.py-2.font5.text-sm(
v-if="$store.getters['wallets/walletsSortedIds'].length > 1"
@click="() => setAmountType(2)"
:class="{ _active: amountType === 2 }"
diff --git a/components/trns/item/History.vue b/components/trns/item/History.vue
index 52e241ee..115746d6 100644
--- a/components/trns/item/History.vue
+++ b/components/trns/item/History.vue
@@ -25,23 +25,21 @@ export default defineComponent({
</script>
<template lang="pug">
-.space-x-3.flex(
+.space-x-3.flex.cursor-context-menu(
class="hocus:bg-neutral-100 dark:hocus:bg-neutral-800"
@click="onOpenDetails"
)
- .text-neutral-50.text-xl.leading-none.w-8.h-8.rounded-full.justify-center.items-center.flex(
+ .cursor-pointer.text-neutral-50.text-xl.leading-none.w-8.h-8.rounded-full.justify-center.items-center.flex(
:style="{ background: trnItem.category.color }"
@click="onSetFilter"
): div(:class="trnItem.category.icon")
.grow
.items-center.flex
- .text-neutral-500.grow(
- class="dark:text-neutral-400"
- )
+ .grow.text-neutral-500(class="dark:text-neutral-400")
//- Category
- .pb-1.text-sm.space-x-2.items-baseline.flex
- .text-neutral-700(class="dark:text-neutral-300") {{ trnItem.category.name }}
+ .pb-1.space-x-2.items-baseline.flex
+ .text-sm.text-neutral-700(class="dark:text-neutral-300") {{ trnItem.category.name }}
.text-xs.space-x-2.items-baseline.flex(v-if="trnItem.category.parentId")
div •
@@ -63,13 +61,14 @@ export default defineComponent({
.text-neutral-500(class="dark:text-neutral-400") {{ trnItem.walletTo.name }}
//- Amount
- Amount2(
- :amount="trnItem.amount"
- :currency="trnItem.wallet.currency"
- :type="trnItem.type"
- colorize="incomes"
- @click="onOpenEdit"
- )
+ .cursor-pointer
+ Amount2(
+ :amount="trnItem.amount"
+ :currency="trnItem.wallet.currency"
+ :type="trnItem.type"
+ colorize="incomes"
+ @click="onOpenEdit"
+ )
//- Description
.pt-2.text-neutral-500.text-xs.leading-none(
diff --git a/components/trns/item/WithoutCat.vue b/components/trns/item/WithoutCat.vue
index 97ac7da7..8dbc3c1e 100644
--- a/components/trns/item/WithoutCat.vue
+++ b/components/trns/item/WithoutCat.vue
@@ -28,7 +28,7 @@ export default defineComponent({
</script>
<template lang="pug">
-.space-x-4.flex.text-neutral-500(
+.cursor-context-menu.space-x-4.flex.text-neutral-500(
class="dark:text-neutral-400 hocus:bg-neutral-100 dark:hocus:bg-neutral-800"
@click="onOpenDetails"
)
@@ -53,13 +53,14 @@ export default defineComponent({
.text-neutral-500(class="dark:text-neutral-400") {{ trnItem.walletTo.name }}
//- Amount
- Amount2(
- :amount="trnItem.amount"
- :currency="trnItem.wallet.currency"
- :type="trnItem.type"
- colorize="incomes"
- @click="onOpenEdit"
- )
+ .cursor-pointer
+ Amount2(
+ :amount="trnItem.amount"
+ :currency="trnItem.wallet.currency"
+ :type="trnItem.type"
+ colorize="incomes"
+ @click="onOpenEdit"
+ )
//- Description
.pt-1.text-neutral-500.text-xs(
diff --git a/components/trns/list/TrnsList.vue b/components/trns/list/TrnsList.vue
index d9b87733..5255588c 100644
--- a/components/trns/list/TrnsList.vue
+++ b/components/trns/list/TrnsList.vue
@@ -12,7 +12,7 @@ export default defineComponent({
limit: { type: Number, default: 0 },
size: { type: Number, required: false, default: 30 },
ui: { type: String, default: 'history' },
- classNames: { type: String, default: 'md:grid-cols-2 md:gap-6 lg:grid-cols-3' }
+ classNames: { type: String, default: '' }
},
setup () {
@@ -141,8 +141,9 @@ div
div(v-if="trnsIds.length > 0")
//- History view
- .grid.grid-cols-1.gap-2(
+ .grid.grid-cols-1.gap-y-5(
v-if="ui === 'history'"
+ class="md:grid-cols-2 md:gap-x-20"
:class="classNames"
)
.overflow-hidden.rounded-md.bg-4(
diff --git a/components/trns/list/TrnsListHistory.vue b/components/trns/list/TrnsListHistory.vue
index dcd5b8f6..ef70c279 100644
--- a/components/trns/list/TrnsListHistory.vue
+++ b/components/trns/list/TrnsListHistory.vue
@@ -1,11 +1,50 @@
-<script>
-export default {
+<script lang="ts">
+import { useNuxtApp, defineComponent } from '#app'
+import useCalculator from '~/components/trnForm/calculator/useCalculator'
+import useFilter from '~/modules/filter/useFilter'
+
+export default defineComponent({
props: {
isShowFilter: { type: Boolean, default: false },
limit: { type: Number, default: 0 },
size: { type: Number, required: false, default: 30 }
},
+ setup () {
+ const { $store } = useNuxtApp()
+ const { setExpression } = useCalculator()
+ const { setCategoryFilter } = useFilter()
+
+ const actions = trnItem => ({
+ onOpenDetails: () => {
+ if (!$store.state.trns.modal.show) {
+ $store.commit('categories/hideCategoryModal')
+ $store.commit('trns/showTrnModal')
+ $store.commit('trns/setTrnModalId', trnItem.id)
+ }
+ },
+
+ onOpenEdit: (event) => {
+ event.stopPropagation()
+ setExpression(trnItem.amount)
+ $store.dispatch('trnForm/openTrnForm', { action: 'edit', trnId: trnItem.id })
+ $store.commit('stat/setCategoryModal', { id: null, type: null })
+ },
+
+ onSetFilter: (event) => {
+ event.stopPropagation()
+ setCategoryFilter(trnItem.categoryId)
+ $store.commit('filter/setFilterDateNow')
+ $store.commit('trns/hideTrnModal')
+ $store.commit('trns/setTrnModalId', null)
+ $store.commit('stat/setCategoryModal', { id: null, type: null })
+ $store.dispatch('ui/setActiveTabStat', 'details')
+ }
+ })
+
+ return { actions }
+ },
+
data () {
return {
pageNumber: 1,
@@ -73,7 +112,7 @@ export default {
this.isShowTrnsWithDesc = !this.isShowTrnsWithDesc
}
}
-}
+})
</script>
<template lang="pug">
@@ -94,18 +133,18 @@ div
)
.overflow-hidden.rounded-md.bg-4(
v-for="(trnsIds, date) in groupedTrns"
+ :key="date"
)
.pt-4
.pb-2.px-3
TrnsListDate(:date="date")
- div
- TrnsItemTrnItem(
+
+ .overflow-hidden.rounded-md
+ TrnsItemHistory.py-3.px-3.cursor-pointer(
v-for="trnId in trnsIds"
:key="trnId"
- :category="$store.state.categories.items[$store.state.trns.items[trnId].categoryId]"
- :trn="$store.state.trns.items[trnId]"
+ :actions="actions"
:trnId="trnId"
- :wallet="$store.state.wallets.items[$store.state.trns.items[trnId].walletId]"
)
.py-4(v-if="!isShowedAllTrns")
diff --git a/components/wallets/Modal.vue b/components/wallets/Modal.vue
index c56ddda4..381587fd 100644
--- a/components/wallets/Modal.vue
+++ b/components/wallets/Modal.vue
@@ -1,5 +1,5 @@
<script>
-import { useNuxtApp } from '#app'
+import { computed, useNuxtApp } from '#app'
import { removeData } from '~/services/firebaseHelpers'
import useFilter from '~/modules/filter/useFilter'
@@ -13,9 +13,19 @@ export default {
$store.commit('wallets/setWalletsModalWalletModalId', null)
}
+ const wallet = computed(() => {
+ const id = $store.state.wallets.modal.id
+ if (!id) return
+ return {
+ ...$store.state.wallets.items[id],
+ total: $store.getters['wallets/walletsTotal'][id].base
+ }
+ })
+
return {
setWalletFilter,
- closed
+ closed,
+ wallet
}
},
@@ -106,12 +116,25 @@ Portal(
template(#header)
template(v-if="walletId")
- .walletWrap
- WalletsItemWalletItem2(
- :id="walletId"
- vertical="center"
- size="xl"
+ .shame1.rounded-t-2xl.pb-2
+ .gap-4.items-center.justify-center.flex-col.flex(
+ class="-translate-y-6 -mb-6"
)
+ .text-neutral-50.text-lg.leading-none.w-12.h-12.rounded-md.justify-center.items-center.flex(
+ :style="{ background: wallet.color }"
+ ) {{ wallet.name.substring(0, 2) }}
+
+ .gap-y-1.flex-col.flex
+ .text-center.text-lg.text-neutral-500(class="dark:text-neutral-400") {{ wallet.name }}
+
+ Amount(
+ alwaysShowSymbol
+ :currency="wallet.currency"
+ :showBase="showBase"
+ :value="wallet.total"
+ size="xl"
+ vertical="center"
+ )
template(#default="{ close }")
.content
@@ -148,37 +171,9 @@ Portal(
</template>
<style lang="stylus">
-.modalContainer
- .walletWrap
- padding-bottom $m8
- background var(--c-bg-3)
-
- .walletItemGrid
- cursor default
- width 100%
- padding $m8
- padding-top 0
- padding-bottom $m6
- border-bottom 0
- background var(--c-bg-3) !important
- border 1px solid transparent !important
- 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>
+.shame1
+ background var(--c-bg-3)
-<style lang="stylus">
.content
padding-top $m6
padding-bottom $m6
diff --git a/components/wallets/item/Simple.vue b/components/wallets/item/Simple.vue
new file mode 100644
index 00000000..b770c246
--- /dev/null
+++ b/components/wallets/item/Simple.vue
@@ -0,0 +1,64 @@
+<script lang="ts">
+import { defineComponent } from '#app'
+
+export default defineComponent({
+ props: {
+ id: { type: String, required: true },
+ showBase: { type: Boolean, default: true },
+ vertical: { type: String, default: 'left' },
+ size: { type: String, default: null },
+ activeItemId: { type: String, default: null }
+ },
+
+ computed: {
+ wallet () {
+ return {
+ ...this.$store.state.wallets.items[this.id],
+ total: this.$store.getters['wallets/walletsTotal'][this.id].base
+ }
+ }
+ },
+
+ methods: {
+ handleClick () {
+ if (this.$listeners.onClick)
+ this.$listeners.onClick(this.id)
+ }
+ }
+})
+</script>
+
+<template lang="pug">
+.bg-main.py-2.px-3.gap-x-3.items-center.flex(
+ :class="{ _active: activeItemId === id }"
+ @click="handleClick"
+)
+ .text-neutral-50.text-xs.leading-none.w-6.h-6.rounded-md.justify-center.items-center.flex(
+ :style="{ background: wallet.color }"
+ ) {{ wallet.name.substring(0, 2) }}
+
+ .grow
+ .py-1.items-center.flex
+ .grow.text-neutral-500(class="dark:text-neutral-400") {{ wallet.name }}
+
+ Amount(
+ :alwaysShowSymbol="true"
+ :currency="wallet.currency"
+ :showBase="showBase"
+ :size="size"
+ :value="wallet.total"
+ :vertical="vertical"
+ )
+
+ .line
+</template>
+
+<style lang="stylus">
+.bg-main
+ +media-hover()
+ background var(--c-item-bg-hover)
+
+.line
+ height 1px
+ background var(--c-bg-6);
+</style>
diff --git a/components/wallets/item/WalletItem.vue b/components/wallets/item/WalletItem.vue
index 11049099..2842b1a5 100644
--- a/components/wallets/item/WalletItem.vue
+++ b/components/wallets/item/WalletItem.vue
@@ -1,34 +1,16 @@
-<script>
-export default {
+<script lang="ts">
+import { defineComponent } from '#app'
+
+export default defineComponent({
props: {
- ui: {
- type: String,
- default: null
- },
- id: {
- type: String,
- required: true
- },
- showBase: {
- type: Boolean,
- default: true
- }
+ id: { type: String, required: true },
+ showBase: { type: Boolean, default: true },
+ vertical: { type: String, default: 'left' },
+ size: { type: String, default: null },
+ activeItemId: { type: String, default: null }
},
computed: {
- className () {
- return {
- walletItem: !this.ui,
- walletItemTile: this.ui === 'tile',
- walletItemLine: this.ui === 'line'
- }
- },
- styles () {
- return {
- background: (this.ui === 'tile' || this.ui === 'line') && (this.wallet.color || this.$store.state.ui.defaultBgColor)
- }
- },
-
wallet () {
return {
...this.$store.state.wallets.items[this.id],
@@ -41,51 +23,53 @@ export default {
handleClick () {
if (this.$listeners.onClick)
this.$listeners.onClick(this.id)
- },
-
- handleIconClick () {
- this.$store.dispatch('ui/setActiveTabStat', 'details')
- this.$store.dispatch('filter/setFilterWalletId', this.id)
}
}
-}
+})
</script>
<template lang="pug">
-div(
- :class="className"
- :style="styles"
+.walletItemGrid.p-2.rounded-md(
+ :class="{ _active: activeItemId === id }"
@click="handleClick"
)
- //- tile
- template(v-if="ui === 'tile' || ui === 'line'")
- .walletItemTile__name {{ wallet.name }}
- .walletItemTile__amount
+ .walletItemGridActive(v-if="activeItemId === id")
+ .gap-x-3.flex
+ .text-neutral-50.text-xs.leading-none.w-6.h-6.rounded-md.justify-center.items-center.flex(
+ :style="{ background: wallet.color }"
+ ) {{ wallet.name.substring(0, 2) }}
+
+ div
+ .text-sm.text-neutral-500(class="dark:text-neutral-400") {{ wallet.name }}
Amount(
+ :alwaysShowSymbol="true"
:currency="wallet.currency"
- :isAltColor="$attrs.isAltColor"
:showBase="showBase"
+ :size="size"
:value="wallet.total"
- alwaysShowSymbol
- vertical="left"
+ :vertical="vertical"
)
-
- //- list
- template(v-else)
- .walletItem__grid
- .walletItem__icon(@click.stop="handleIconClick")
- Icon(
- :abbr="wallet.name"
- :background="wallet.color || $store.state.ui.defaultBgColor"
- medium
- )
- .walletItem__name {{ wallet.name }}
- .walletItem__amount
- Amount(
- :currency="wallet.currency"
- :isAltColor="$attrs.isAltColor"
- :value="wallet.total"
- alwaysShowSymbol
- )
- .walletItem__line
</template>
+
+<style lang="stylus">
+.walletItemGrid
+ cursor pointer
+ position relative
+ background var(--c-item-bg-main)
+ anim()
+
+ +media-hover()
+ background var(--c-item-bg-hover)
+
+.walletItemGridActive
+ position absolute
+ top $m6
+ right $m5
+ display flex
+ align-items center
+ justify-content center
+ width 8px
+ height 8px
+ background var(--c-blue-1)
+ border-radius 50%
+</style>
diff --git a/components/wallets/item/WalletItem2.vue b/components/wallets/item/WalletItem2.vue
deleted file mode 100644
index 902ed710..00000000
--- a/components/wallets/item/WalletItem2.vue
+++ /dev/null
@@ -1,89 +0,0 @@
-<script>
-export default {
- name: 'WalletItem2',
-
- props: {
- id: { type: String, required: true },
- showBase: { type: Boolean, default: true },
- vertical: { type: String, default: 'left' },
- size: { type: String, default: null },
- activeItemId: { type: String, default: null }
- },
-
- computed: {
- wallet () {
- return {
- ...this.$store.state.wallets.items[this.id],
- total: this.$store.getters['wallets/walletsTotal'][this.id].base
- }
- }
- },
-
- methods: {
- handleClick () {
- if (this.$listeners.onClick)
- this.$listeners.onClick(this.id)
- }
- }
-}
-</script>
-
-<template lang="pug">
-.walletItemGrid(
- :class="{ _active: activeItemId === id }"
- @click="handleClick"
-)
- .walletItemGrid__active(v-if="activeItemId === id")
- .walletItemGrid__line(:style="{ background: wallet.color || $store.state.ui.defaultBgColor }")
- .walletItemGrid__name {{ wallet.name }}
- .walletItemGrid__amount
- Amount(
- :alwaysShowSymbol="true"
- :currency="wallet.currency"
- :showBase="showBase"
- :size="size"
- :value="wallet.total"
- :vertical="vertical"
- )
-</template>
-
-<style lang="stylus">
-.walletItemGrid
- overflow hidden
- cursor pointer
- position relative
- padding 14px $m7
- padding-top 0
- background var(--c-item-bg-main)
- border 1px solid transparent
- border-top 0
- border-radius $m6
- anim()
-
- +media-hover()
- background var(--c-item-bg-hover)
- border-color var(--c-item-bd-hover)
-
- &__line
- opacity 1
- height 4px
- margin 0 (- $m7)
- margin-bottom 14px
-
- &__name
- padding-bottom $m5
- color var(--c-font-2)
- font-size 16px
-
- &__active
- position absolute
- top $m6
- right $m5
- display flex
- align-items center
- justify-content center
- width 8px
- height 8px
- background var(--c-blue-1)
- border-radius 50%
-</style>
diff --git a/components/wallets/list/WalletsList.vue b/components/wallets/list/WalletsList.vue
index 335aee41..20b1d024 100644
--- a/components/wallets/list/WalletsList.vue
+++ b/components/wallets/list/WalletsList.vue
@@ -14,14 +14,6 @@ export default {
},
computed: {
- className () {
- return {
- walletsList: !this.ui,
- walletsTiles: this.ui === 'tile',
- walletsLine: this.ui === 'line'
- }
- },
-
walletsIds () {
const walletsIds = this.$store.getters['wallets/walletsSortedIds']
if (this.stateLimit)
@@ -47,16 +39,29 @@ export default {
<template lang="pug">
.wallets
- div(:class="className")
- WalletsItemWalletItem(
- v-for="walletId in walletsIds"
- :id="walletId"
- :key="walletId"
- :ui="ui"
- v-on="$listeners"
- )
-
- .walletsList__toogle(v-if="showToogle && $store.getters['wallets/walletsSortedIds'].length > limit" @click="toogleWallets")
+ div
+ template(v-if="ui === 'simple'")
+ WalletsItemSimple(
+ v-for="walletId in walletsIds"
+ :id="walletId"
+ :key="walletId"
+ :ui="ui"
+ v-on="$listeners"
+ )
+
+ template(v-else)
+ WalletsItemWalletItem(
+ v-for="walletId in walletsIds"
+ :id="walletId"
+ :key="walletId"
+ :ui="ui"
+ v-on="$listeners"
+ )
+
+ .walletsList__toogle(
+ v-if="showToogle && $store.getters['wallets/walletsSortedIds'].length > limit"
+ @click="toogleWallets"
+ )
template(v-if="stateLimit > 0") {{ $t('wallets.showAll') }}
template(v-else) {{ $t('wallets.showOnly') }} {{ limit }}
</template>
diff --git a/components/wallets/list/WalletsList3.vue b/components/wallets/list/WalletsList3.vue
index ee312653..480c647c 100644
--- a/components/wallets/list/WalletsList3.vue
+++ b/components/wallets/list/WalletsList3.vue
@@ -34,7 +34,7 @@ export default {
computed: {
walletsIds () {
const walletsIds = this.$store.getters['wallets/walletsSortedIds']
- if (this.stateLimit) { return walletsIds.slice(0, this.stateLimit) }
+ if (this.stateLimit) return walletsIds.slice(0, this.stateLimit)
return walletsIds
}
},
@@ -45,12 +45,10 @@ export default {
methods: {
toogleWallets () {
- if (this.stateLimit > 0) {
+ if (this.stateLimit > 0)
this.stateLimit = 0
- }
- else {
+ else
this.stateLimit = this.limit
- }
}
}
}
@@ -59,7 +57,7 @@ export default {
<template lang="pug">
.wallets
.wallets__grid
- WalletsItemWalletItem2(
+ WalletsItemWalletItem(
:activeItemId="activeItemId"
v-for="walletId in walletsIds"
:id="walletId"
@@ -75,18 +73,17 @@ export default {
<style lang="stylus" scoped>
.wallets
- padding 0 $m7
-
&__grid
display grid
grid-template-columns repeat(2, 1fr)
- grid-column-gap $m7
- grid-row-gap $m7
+ grid-column-gap $m6
+ grid-row-gap $m6
+ padding 0 $m7
+media(600px)
- grid-template-columns repeat(auto-fill, minmax(220px, 1fr))
- grid-column-gap $m7
- grid-row-gap $m7
+ grid-template-columns repeat(auto-fill, minmax(200px, 1fr))
+ grid-column-gap $m6
+ grid-row-gap $m6
&__toogle
button-base-1()
diff --git a/components/wallets/list/walletsList.styl b/components/wallets/list/walletsList.styl
index 9a12f04e..b6d6ca3d 100644
--- a/components/wallets/list/walletsList.styl
+++ b/components/wallets/list/walletsList.styl
@@ -32,14 +32,12 @@
.walletsTiles
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
-.walletsLine
- overflow hidden
- display flex
- overflow-x auto
- padding 0 $m7
- scrollbar()
+ +media(600px)
+ grid-template-columns repeat(auto-fill, minmax(200px, 1fr))
+ grid-column-gap $m6
+ grid-row-gap $m6
diff --git a/modules/filter/useFilter.ts b/modules/filter/useFilter.ts
index b23afe28..7342478c 100644
--- a/modules/filter/useFilter.ts
+++ b/modules/filter/useFilter.ts
@@ -6,7 +6,7 @@ export default function useFilter () {
const route = useRoute()
const router = useRouter()
const filterPeriodNameAllReplacedToYear = computed(() => $store.state.filter.period === 'all' ? 'year' : $store.state.filter.period)
- const isNeedToRedirect = computed(() => route.value.name !== 'index' && route.value.name !== 'history')
+ const isNeedToRedirect = computed(() => route.name !== 'index' && route.name !== 'history')
function scrollTop () {
const page = document.querySelector('.js_scroll_page')
diff --git a/package-lock.json b/package-lock.json
index 6356ec8e..05ba5dd8 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -12,7 +12,7 @@
"@simonwep/pickr": "1.8.2",
"@vueuse/core": "5.3.0",
"axios": "0.24.0",
- "core-js": "3.20.0",
+ "core-js": "3.20.2",
"currency.js": "2.0.4",
"dayjs": "1.10.7",
"firebase": "9.6.1",
@@ -31,7 +31,7 @@
"@nuxt/devalue": "^2.0.0",
"@nuxt/types": "2.15.8",
"@nuxtjs/color-mode": "2.1.1",
- "@nuxtjs/eslint-config-typescript": "6.0.1",
+ "@nuxtjs/eslint-config-typescript": "^6.0.1",
"@nuxtjs/pwa": "3.3.5",
"@nuxtjs/style-resources": "^1.2.1",
"@nuxtjs/tailwindcss": "^4.2.1",
@@ -49,9 +49,9 @@
"stylelint": "^13.13.1",
"stylelint-order": "4.1.0",
"stylelint-plugin-stylus": "0.11.0",
- "stylus": "^0.55.0",
+ "stylus": "^0.56.0",
"stylus-loader": "3.0.2",
- "tailwindcss": "^3.0.7",
+ "tailwindcss": "^3.0.9",
"typescript": "4.5.4",
"vinyl-ftp": "0.6.1"
}
@@ -10192,9 +10192,9 @@
}
},
"node_modules/core-js": {
- "version": "3.20.0",
- "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.20.0.tgz",
- "integrity": "sha512-KjbKU7UEfg4YPpskMtMXPhUKn7m/1OdTHTVjy09ScR2LVaoUXe8Jh0UdvN2EKUR6iKTJph52SJP95mAB0MnVLQ==",
+ "version": "3.20.2",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.20.2.tgz",
+ "integrity": "sha512-nuqhq11DcOAbFBV4zCbKeGbKQsUDRqTX0oqx7AttUBuqe3h20ixsE039QHelbL6P4h+9kytVqyEtyZ6gsiwEYw==",
"hasInstallScript": true,
"funding": {
"type": "opencollective",
@@ -26531,18 +26531,16 @@
}
},
"node_modules/stylus": {
- "version": "0.55.0",
- "resolved": "https://registry.npmjs.org/stylus/-/stylus-0.55.0.tgz",
- "integrity": "sha512-MuzIIVRSbc8XxHH7FjkvWqkIcr1BvoMZoR/oFuAJDlh7VSaNJzrB4uJ38GRQa+mWjLXODAMzeDe0xi9GYbGwnw==",
+ "version": "0.56.0",
+ "resolved": "https://registry.npmjs.org/stylus/-/stylus-0.56.0.tgz",
+ "integrity": "sha512-Ev3fOb4bUElwWu4F9P9WjnnaSpc8XB9OFHSFZSKMFL1CE1oM+oFXWEgAqPmmZIyhBihuqIQlFsVTypiiS9RxeA==",
"dev": true,
"dependencies": {
"css": "^3.0.0",
- "debug": "~3.1.0",
+ "debug": "^4.3.2",
"glob": "^7.1.6",
- "mkdirp": "~1.0.4",
"safer-buffer": "^2.1.2",
"sax": "~1.2.4",
- "semver": "^6.3.0",
"source-map": "^0.7.3"
},
"bin": {
@@ -26592,42 +26590,6 @@
"node": ">=4.0.0"
}
},
- "node_modules/stylus/node_modules/debug": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
- "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
- "dev": true,
- "dependencies": {
- "ms": "2.0.0"
- }
- },
- "node_modules/stylus/node_modules/mkdirp": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
- "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
- "dev": true,
- "bin": {
- "mkdirp": "bin/cmd.js"
- },
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/stylus/node_modules/ms": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
- "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
- "dev": true
- },
- "node_modules/stylus/node_modules/semver": {
- "version": "6.3.0",
- "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
- "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
- "dev": true,
- "bin": {
- "semver": "bin/semver.js"
- }
- },
"node_modules/stylus/node_modules/source-map": {
"version": "0.7.3",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
@@ -38434,9 +38396,9 @@
}
},
"core-js": {
- "version": "3.20.0",
- "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.20.0.tgz",
- "integrity": "sha512-KjbKU7UEfg4YPpskMtMXPhUKn7m/1OdTHTVjy09ScR2LVaoUXe8Jh0UdvN2EKUR6iKTJph52SJP95mAB0MnVLQ=="
+ "version": "3.20.2",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.20.2.tgz",
+ "integrity": "sha512-nuqhq11DcOAbFBV4zCbKeGbKQsUDRqTX0oqx7AttUBuqe3h20ixsE039QHelbL6P4h+9kytVqyEtyZ6gsiwEYw=="
},
"core-js-compat": {
"version": "3.20.2",
@@ -51134,48 +51096,19 @@
}
},
"stylus": {
- "version": "0.55.0",
- "resolved": "https://registry.npmjs.org/stylus/-/stylus-0.55.0.tgz",
- "integrity": "sha512-MuzIIVRSbc8XxHH7FjkvWqkIcr1BvoMZoR/oFuAJDlh7VSaNJzrB4uJ38GRQa+mWjLXODAMzeDe0xi9GYbGwnw==",
+ "version": "0.56.0",
+ "resolved": "https://registry.npmjs.org/stylus/-/stylus-0.56.0.tgz",
+ "integrity": "sha512-Ev3fOb4bUElwWu4F9P9WjnnaSpc8XB9OFHSFZSKMFL1CE1oM+oFXWEgAqPmmZIyhBihuqIQlFsVTypiiS9RxeA==",
"dev": true,
"requires": {
"css": "^3.0.0",
- "debug": "~3.1.0",
+ "debug": "^4.3.2",
"glob": "^7.1.6",
- "mkdirp": "~1.0.4",
"safer-buffer": "^2.1.2",
"sax": "~1.2.4",
- "semver": "^6.3.0",
"source-map": "^0.7.3"
},
"dependencies": {
- "debug": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
- "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
- "dev": true,
- "requires": {
- "ms": "2.0.0"
- }
- },
- "mkdirp": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
- "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
- "dev": true
- },
- "ms": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
- "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
- "dev": true
- },
- "semver": {
- "version": "6.3.0",
- "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
- "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
- "dev": true
- },
"source-map": {
"version": "0.7.3",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
diff --git a/package.json b/package.json
index 825cbf1d..45fd416a 100644
--- a/package.json
+++ b/package.json
@@ -16,7 +16,7 @@
"@simonwep/pickr": "1.8.2",
"@vueuse/core": "5.3.0",
"axios": "0.24.0",
- "core-js": "3.20.0",
+ "core-js": "3.20.2",
"currency.js": "2.0.4",
"dayjs": "1.10.7",
"firebase": "9.6.1",
@@ -35,7 +35,7 @@
"@nuxt/devalue": "^2.0.0",
"@nuxt/types": "2.15.8",
"@nuxtjs/color-mode": "2.1.1",
- "@nuxtjs/eslint-config-typescript": "6.0.1",
+ "@nuxtjs/eslint-config-typescript": "^6.0.1",
"@nuxtjs/pwa": "3.3.5",
"@nuxtjs/style-resources": "^1.2.1",
"@nuxtjs/tailwindcss": "^4.2.1",
@@ -53,9 +53,9 @@
"stylelint": "^13.13.1",
"stylelint-order": "4.1.0",
"stylelint-plugin-stylus": "0.11.0",
- "stylus": "^0.55.0",
+ "stylus": "^0.56.0",
"stylus-loader": "3.0.2",
- "tailwindcss": "^3.0.7",
+ "tailwindcss": "^3.0.9",
"typescript": "4.5.4",
"vinyl-ftp": "0.6.1"
}
diff --git a/pages/api.vue b/pages/api.vue
index bb246045..ef3d92cd 100644
--- a/pages/api.vue
+++ b/pages/api.vue
@@ -185,7 +185,6 @@ div
class="md:grid-cols-2 md:gap-0"
)
.p-3
- pre {{ selectedTrnsIds.length }}
TrnsItemHistory.py-3.px-2.rounded-md.cursor-pointer(
v-for="trnId in selectedTrnsIds"
:key="trnId"
diff --git a/pages/categories.vue b/pages/categories.vue
index 9c976800..7ea9230e 100644
--- a/pages/categories.vue
+++ b/pages/categories.vue
@@ -1,23 +1,35 @@
<script>
-export default {
- name: 'CategoriesPage',
+import { defineComponent } from '#app'
+
+export default defineComponent({
+ setup () {
+
+ },
head () {
return {
title: this.$t('categories.title')
}
}
-}
+})
</script>
<template lang="pug">
LayoutBaseWrap(:contentPadding="false")
template(slot="content")
.header {{ $t('categories.name') }}
- CategoriesList(
- :style="{ paddingTop: '0' }"
- @onClick="(id) => $store.dispatch('categories/showCategoryModal', id)"
+ CategoriesListSlot(
+ :ids="$store.getters['categories/categoriesRootIds']"
+ v-slot="{ categories }"
)
+ .shame1
+ CategoriesItemCategoryItem(
+ v-for="category in categories"
+ :category="category"
+ :id="category.id"
+ :key="category.id"
+ @onClick="$store.dispatch('categories/showCategoryModal', category.id)"
+ )
template(slot="bottom")
.buttons
@@ -25,6 +37,18 @@ LayoutBaseWrap(:contentPadding="false")
</template>
<style lang="stylus" scoped>
+.shame1
+ display grid
+ 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(200px, 1fr))
+ grid-column-gap $m6
+ grid-row-gap $m6
+
.header
header-title()
diff --git a/store/filter/actions.js b/store/filter/actions.js
index 3b274a7c..38eb9ddd 100644
--- a/store/filter/actions.js
+++ b/store/filter/actions.js
@@ -16,7 +16,6 @@ export default {
}
}
else {
- console.log(11, categoryId)
dispatch('setFilterCategoryId', categoryId)
}
},