Skip to content

Open source personal finance application

update 3.5.2

ilkome2f7ea48df210
diff --git a/components/base/BottomSheetClose.vue b/components/base/BottomSheetClose.vue
index 269d3f33..1001c3aa 100644
--- a/components/base/BottomSheetClose.vue
+++ b/components/base/BottomSheetClose.vue
@@ -7,15 +7,15 @@ export default {
<template lang="pug">
.handlerClose(@click="$emit('onClick')")
svg(
- viewBox='0 0 24 24'
- fill='none'
- stroke='#000'
- stroke-linecap='round'
- stroke-linejoin='round'
- stroke-width='3'
+ 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')
+ path(d="M.75 23.249l22.5-22.5")
+ path(d="M23.25 23.249L.75.749")
</template>
<style lang="stylus" scoped>
diff --git a/components/categories/page/List.vue b/components/categories/page/List.vue
new file mode 100644
index 00000000..61d1571a
--- /dev/null
+++ b/components/categories/page/List.vue
@@ -0,0 +1,59 @@
+<script setup lang="ts">
+const { $store } = useNuxtApp()
+
+const catsIds = computed(() => $store.getters['categories/categoriesRootIds']?.sort((a, b) => {
+ if ($store.state.categories.items[a].name < $store.state.categories.items[b].name) return -1
+ if ($store.state.categories.items[a].name > $store.state.categories.items[b].name) return 1
+ return 0
+}))
+</script>
+
+<script lang="ts">
+export default defineComponent({
+ head() {
+ return {
+ title: this.$t('categories.title'),
+ }
+ },
+})
+</script>
+
+<template lang="pug">
+.h-full.overflow.overflow-x-auto.grid.max-w-3xl.h-full(
+ class="pb-[44px] md_pb-[52px] lg_pb-0 lg_grid-rows-[1fr_auto]"
+)
+ div
+ .py-6.px-3.font-nunito.text-neutral-800.dark_text-white.text-2xl.leading-none.font-semibold
+ | {{ $t('categories.name') }}
+
+ .pb-4
+ CategoriesListSlot(
+ :ids="catsIds"
+ v-slot="{ categories }"
+ )
+ .shame1.px-3
+ CategoriesItemCategoryItem(
+ v-for="category in categories"
+ :category="category"
+ :slider="() => ({})"
+ :id="category.id"
+ :key="category.id"
+ @onClick="id => $router.push(`/categories/${category.id}`)"
+ )
+
+ .pb-4.px-3.flex.gap-4.pt-4
+ .button(@click="$store.dispatch('ui/setActiveTab', 'createCategory')") {{ $t('categories.new') }}
+</template>
+
+<style lang="stylus" scoped>
+.shame1
+ display grid
+ grid-template-columns repeat(2, 1fr)
+ grid-column-gap $m6
+ grid-row-gap $m6
+
+ +media(600px)
+ grid-template-columns repeat(auto-fill, minmax(200px, 1fr))
+ grid-column-gap $m6
+ grid-row-gap $m6
+</style>
diff --git a/components/categories/pages/id/Edit.vue b/components/categories/page/id/Edit.vue
similarity index 54%
rename from components/categories/pages/id/Edit.vue
rename to components/categories/page/id/Edit.vue
index e70fbd01..70265a81 100644
--- a/components/categories/pages/id/Edit.vue
+++ b/components/categories/page/id/Edit.vue
@@ -219,221 +219,217 @@ export default defineComponent({
</script>
<template lang="pug">
-.relative.h-full.overflow.overflow-x-auto(v-if="category")
- router-link(
- v-slot='{ href, navigate }'
- :to='`/categories/${categoryId}`'
- custom
- )
- a.grow.cursor-pointer.block.py-5.pb-5.mb-3.px-3.font-nunito.hocus_bg-gray-100.dark_hocus_bg-neutral-800(
- :href='href'
- @click='navigate'
+.h-full.overflow.overflow-x-auto.max-w-3xl.h-full(
+ class="pb-[44px] md_pb-[52px] lg_pb-0"
+)
+ template(v-if="category")
+ router-link(
+ v-slot='{ href, navigate }'
+ :to='`/categories/${categoryId}`'
+ custom
)
- .pb-2.text-xs.font-medium(class="text-white/50") {{ $t('categories.editTitle') }}
-
- .flex.items-center.gap-3
- .text-neutral-800.dark_text-white.text-2xl.leading-none.font-semibold {{ category.name }}
- .w-8.h-8.rounded-full.flex-center.text-xl.text-neutral-50(
- :style="{ background: category.color }"
- )
- div(:class="category.icon")
-
- //- Menu
- //-----------------------------------
- .px-3.pb-4
- .overflow-hidden.rounded-md.scrollbar.mb-4.bg-gray-50.dark_bg-dark4.dark_shadow
- .overflow-hidden.overflow-x-auto.flex.items-center.text-sm.text-center.max-w-md
- .cursor-pointer.px-6.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
- :class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': activeTab === 'data' }"
- @click="activeTab = 'data'"
- ) {{ $t('categories.form.data.label') }}
-
- .cursor-pointer.px-6.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
- :class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': activeTab === 'colors' }"
- @click="activeTab = 'colors'"
- ) {{ $t('categories.form.colors.label') }}
-
- .cursor-pointer.px-6.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
- :class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': activeTab === 'icons' }"
- @click="activeTab = 'icons'"
- ) {{ $t('categories.form.icons.label') }}
-
- //- Content
- //-----------------------------------
- .px-3.max-w-md
- template(v-if="activeTab === 'data'")
- .form
- .inputText
- .inputText__label {{ $t('categories.form.name.label') }}
- input(
- type="text"
- :placeholder="$t('categories.form.name.placeholder')"
- v-model="category.name"
- ).inputText__value
-
- //- can not change root category if inside this category already has some categories
- div(
- v-if="$store.getters['categories/getChildCategoriesIds'](categoryId).length === 0 && $store.getters['categories/hasCategories']"
- style="paddingBottom: 8px"
- )
- .inputText__label {{ $t('categories.form.parent.label') }}
-
- div(@click="showParents = true")
- template(v-if="category.parentId !== 0")
- CategoriesItemCategoryItem(
- :category="$store.state.categories.items[category.parentId]"
- :id="category.parentId"
- )
- template(v-else)
- .categoryParentItem
- .categoryParentItem__icon
- Icon(icon="mdi mdi-folder-star")
- .categoryParentItem__name {{ $t('categories.form.parent.no') }}
-
- LazySharedContextMenuItem(
- v-if="$store.getters['categories/getChildCategoriesIds'](categoryId).length"
- :checkboxValue="applyChildColor"
- :title="$t('categories.form.childColor')"
- showCheckbox
- @onClick="applyChildColor = !applyChildColor"
- )
- LazySharedContextMenuItem(
- v-if="$store.getters['categories/getChildCategoriesIds'](categoryId).length === 0"
- :checkboxValue="category.showInLastUsed"
- :title="$t('categories.form.lastUsed')"
- showCheckbox
- @onClick="category.showInLastUsed = !category.showInLastUsed"
- )
- SharedContextMenuItem(
- :checkboxValue="category.showInQuickSelector"
- :title="$t('categories.form.quickSelector')"
- showCheckbox
- @onClick="category.showInQuickSelector = !category.showInQuickSelector"
- )
+ a.grow.cursor-pointer.block.py-5.pb-5.mb-3.px-3.font-nunito.hocus_bg-gray-100.dark_hocus_bg-neutral-800(
+ :href='href'
+ @click='navigate'
+ )
+ .pb-2.text-xs.font-medium(class="text-white/50") {{ $t('categories.editTitle') }}
- //- Colors
- //---------------------------------
- template(v-if="activeTab === 'colors'")
- .form
- .subTitle {{ $t('popularColors') }}
- .colors
- .iconItem(
- v-for="(color, idx) in popularColors"
- :key="idx"
- :class="{ _active: color === category.color }"
- :style="{ background: color === category.color ? color : 'transparent' }"
- @click="onSelectColor(color)"
+ .flex.items-center.gap-3
+ .text-neutral-800.dark_text-white.text-2xl.leading-none.font-semibold {{ category.name }}
+ .w-8.h-8.rounded-full.flex-center.text-xl.text-neutral-50(
+ :style="{ background: category.color }"
)
- template(v-if="color")
- template(v-if="findCategoryWithThisColor(color)")
- Icon(
- :icon="findCategoryWithThisColor(color)"
- :color="color === category.color ? null : color"
- big
- )
- template(v-else-if="color === category.color")
- Icon(
- :icon="category.icon"
- background="transparent"
- big
- )
- template(v-else)
- .colorPreview(:style="{ background: color }")
-
- .subTitle {{ $t('palette') }}
- .colors
- .iconItem(
- v-for="(color, idx) in allColors"
- :key="idx"
- :class="{ _active: color === category.color, _empty: !color }"
- :style="{ background: color === category.color ? color : 'transparent' }"
- @click="onSelectColor(color)"
+ div(:class="category.icon")
+
+ //- Menu
+ //-----------------------------------
+ .px-3.pb-4
+ .overflow-hidden.rounded-md.scrollbar.mb-4.bg-gray-50.dark_bg-dark4.dark_shadow
+ .overflow-hidden.overflow-x-auto.flex.items-center.text-sm.text-center.max-w-md
+ .cursor-pointer.px-6.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
+ :class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': activeTab === 'data' }"
+ @click="activeTab = 'data'"
+ ) {{ $t('categories.form.data.label') }}
+
+ .cursor-pointer.px-6.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
+ :class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': activeTab === 'colors' }"
+ @click="activeTab = 'colors'"
+ ) {{ $t('categories.form.colors.label') }}
+
+ .cursor-pointer.px-6.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
+ :class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': activeTab === 'icons' }"
+ @click="activeTab = 'icons'"
+ ) {{ $t('categories.form.icons.label') }}
+
+ //- Content
+ //-----------------------------------
+ .px-3.max-w-md
+ template(v-if="activeTab === 'data'")
+ .form
+ .inputText
+ .inputText__label {{ $t('categories.form.name.label') }}
+ input(
+ type="text"
+ :placeholder="$t('categories.form.name.placeholder')"
+ v-model="category.name"
+ ).inputText__value
+
+ //- can not change root category if inside this category already has some categories
+ div(
+ v-if="$store.getters['categories/getChildCategoriesIds'](categoryId).length === 0 && $store.getters['categories/hasCategories']"
+ style="paddingBottom: 8px"
)
+ .inputText__label {{ $t('categories.form.parent.label') }}
- template(v-if="color")
- template(v-if="findCategoryWithThisColor(color)")
- Icon(
- :icon="findCategoryWithThisColor(color)"
- :color="color === category.color ? null : color"
- big
- )
- template(v-else-if="color === category.color")
- Icon(
- :icon="category.icon"
- background="transparent"
- big
+ div(@click="showParents = true")
+ template(v-if="category.parentId !== 0")
+ CategoriesItemCategoryItem(
+ :category="$store.state.categories.items[category.parentId]"
+ :id="category.parentId"
)
template(v-else)
- .colorPreview(:style="{ background: color }")
-
- .subTitle {{ $t('categories.form.colors.custom') }}
- .customColor
- input.customColor__value(v-model="category.color" type="color")
-
- //- Icons
- //---------------------------------
- template(v-if="activeTab === 'icons'")
- .form
- .icons
- .icons__group(
- v-for="iconGroup in icons"
+ .categoryParentItem
+ .categoryParentItem__icon
+ Icon(icon="mdi mdi-folder-star")
+ .categoryParentItem__name {{ $t('categories.form.parent.no') }}
+
+ LazySharedContextMenuItem(
+ v-if="$store.getters['categories/getChildCategoriesIds'](categoryId).length"
+ :checkboxValue="applyChildColor"
+ :title="$t('categories.form.childColor')"
+ showCheckbox
+ @onClick="applyChildColor = !applyChildColor"
+ )
+ LazySharedContextMenuItem(
+ v-if="$store.getters['categories/getChildCategoriesIds'](categoryId).length === 0"
+ :checkboxValue="category.showInLastUsed"
+ :title="$t('categories.form.lastUsed')"
+ showCheckbox
+ @onClick="category.showInLastUsed = !category.showInLastUsed"
+ )
+ SharedContextMenuItem(
+ :checkboxValue="category.showInQuickSelector"
+ :title="$t('categories.form.quickSelector')"
+ showCheckbox
+ @onClick="category.showInQuickSelector = !category.showInQuickSelector"
)
+
+ //- Colors
+ //---------------------------------
+ template(v-if="activeTab === 'colors'")
+ .form
+ .subTitle {{ $t('popularColors') }}
+ .colors
.iconItem(
- v-for="icon in iconGroup"
- :class="{ _active: category.icon === icon }"
- :style="{ color: category.color }"
- @click="handleIconSelect(icon)"
+ v-for="(color, idx) in popularColors"
+ :key="idx"
+ :class="{ _active: color === category.color }"
+ :style="{ background: color === category.color ? color : 'transparent' }"
+ @click="onSelectColor(color)"
+ )
+ template(v-if="color")
+ template(v-if="findCategoryWithThisColor(color)")
+ Icon(
+ :icon="findCategoryWithThisColor(color)"
+ :color="color === category.color ? null : color"
+ big
+ )
+ template(v-else-if="color === category.color")
+ Icon(
+ :icon="category.icon"
+ background="transparent"
+ big
+ )
+ template(v-else)
+ .colorPreview(:style="{ background: color }")
+
+ .subTitle {{ $t('palette') }}
+ .colors
+ .iconItem(
+ v-for="(color, idx) in allColors"
+ :key="idx"
+ :class="{ _active: color === category.color, _empty: !color }"
+ :style="{ background: color === category.color ? color : 'transparent' }"
+ @click="onSelectColor(color)"
)
- div(:class="icon")
-
- //- Submit
- .pt-4.pb-6
- SharedButton(
- :class="['_text-center _blue2 _ml-big', { _inline: $store.state.ui.pc }]"
- :title="$t('categories.form.save')"
- @onClick="handleSubmit()"
- )
- //-
- //- Parent Modal
- //-
- Portal(to="modal")
- LazyBaseBottomSheet(
- v-if="showParents"
- @closed="showParents = false"
- )
- template(#handler="{ close }")
- BaseBottomSheetClose(@onClick="close")
-
- template()
- .content(:style="{ maxHeight: documentHeight }")
- .scrollerBlock
- .wrap
- //- Header
- .header {{ $t('categories.form.parent.label') }}
-
- .padding-bottom
- ModalButton(
- :name="$t('categories.form.parent.no')"
- icon="mdi mdi-folder-star"
- @onClick="() => handleParenCategorySelect(0)")
-
- CategoriesView(
- :activeItemId="category.parentId"
- :ids="$store.getters['categories/categoriesForBeParent'].filter(cId => cId !== categoryId)"
- noPadding
- @onClick="handleParenCategorySelect"
+ template(v-if="color")
+ template(v-if="findCategoryWithThisColor(color)")
+ Icon(
+ :icon="findCategoryWithThisColor(color)"
+ :color="color === category.color ? null : color"
+ big
+ )
+ template(v-else-if="color === category.color")
+ Icon(
+ :icon="category.icon"
+ background="transparent"
+ big
+ )
+ template(v-else)
+ .colorPreview(:style="{ background: color }")
+
+ .subTitle {{ $t('categories.form.colors.custom') }}
+ .customColor
+ input.customColor__value(v-model="category.color" type="color")
+
+ //- Icons
+ //---------------------------------
+ template(v-if="activeTab === 'icons'")
+ .form
+ .icons
+ .icons__group(
+ v-for="iconGroup in icons"
+ )
+ .iconItem(
+ v-for="icon in iconGroup"
+ :class="{ _active: category.icon === icon }"
+ :style="{ color: category.color }"
+ @click="handleIconSelect(icon)"
)
+ div(:class="icon")
+
+ //- Submit
+ .pt-4.pb-6
+ SharedButton(
+ :class="['_text-center _blue2 _ml-big', { _inline: $store.state.ui.pc }]"
+ :title="$t('categories.form.save')"
+ @onClick="handleSubmit()"
+ )
+
+ //-
+ //- Parent Modal
+ //-
+ Portal(to="modal")
+ LazyBaseBottomSheet(
+ v-if="showParents"
+ @closed="showParents = false"
+ )
+ template(#handler="{ close }")
+ BaseBottomSheetClose(@onClick="close")
+
+ template()
+ .content(:style="{ maxHeight: documentHeight }")
+ .scrollerBlock
+ .wrap
+ //- Header
+ .header {{ $t('categories.form.parent.label') }}
+
+ .padding-bottom
+ ModalButton(
+ :name="$t('categories.form.parent.no')"
+ icon="mdi mdi-folder-star"
+ @onClick="() => handleParenCategorySelect(0)")
+
+ CategoriesView(
+ :activeItemId="category.parentId"
+ :ids="$store.getters['categories/categoriesForBeParent'].filter(cId => cId !== categoryId)"
+ noPadding
+ @onClick="handleParenCategorySelect"
+ )
</template>
<style lang="stylus" scoped>
-.preview
- display flex
- align-items center
- justify-content space-between
- padding $m5 $m7
- gap $m7
-
.subTitle
padding 0 $m5
padding-bottom $m6
diff --git a/components/categories/page/id/Index.vue b/components/categories/page/id/Index.vue
new file mode 100644
index 00000000..77af2b55
--- /dev/null
+++ b/components/categories/page/id/Index.vue
@@ -0,0 +1,122 @@
+<script setup lang="ts">
+import useFilter from '~/modules/filter/useFilter'
+import { getTrnsIds } from '~/components/trns/functions/getTrns'
+
+const { $store } = useNuxtApp()
+const { setFilterCatsId } = useFilter()
+
+const route = useRoute()
+const router = useRouter()
+
+const categoryId = computed(() => route.params.id)
+const category = computed(() => $store.state.categories.items[categoryId.value])
+if (!category.value)
+ router.replace('/categories')
+
+const trnsItems = computed(() => $store.state.trns.items)
+const backLink = computed(() => category.value?.parentId ? `/categories/${category.value.parentId}` : '/categories')
+
+const filter = reactive({ trnType: null })
+
+const categoryChildIds = computed(() => category.value.childIds?.sort((a, b) => {
+ if ($store.state.categories.items[a].name < $store.state.categories.items[b].name) return -1
+ if ($store.state.categories.items[a].name > $store.state.categories.items[b].name) return 1
+ return 0
+}))
+
+const trnsIds = computed(() =>
+ getTrnsIds({
+ categoriesIds: category.value?.childIds ? category.value?.childIds : [categoryId.value],
+ trnType: filter.trnType,
+ trnsItems: trnsItems.value,
+ }))
+
+function handleSetFilterCategory() {
+ setFilterCatsId(categoryId.value)
+ $store.commit('filter/setFilterDateNow')
+ $store.dispatch('ui/setActiveTabStat', 'details')
+}
+
+function handleEditClick() {
+ router.push(`/categories/${categoryId.value}/edit`)
+}
+</script>
+
+<template lang="pug">
+.h-full.overflow.overflow-x-auto.max-w-3xl.h-full(
+ class="pb-[44px] md_pb-[52px] lg_pb-0"
+)
+ template(v-if="category")
+ router-link(
+ v-slot='{ href, navigate }'
+ :to='backLink'
+ custom
+ )
+ .flex.items-start
+ a.grow.cursor-pointer.block.py-5.mb-3.px-3.font-nunito.hocus_bg-gray-100.dark_hocus_bg-neutral-800(
+ :href='href'
+ @click='navigate'
+ )
+ .pb-2.text-xs.font-medium(class="text-white/50")
+ | {{ $t('categories.title') }}
+ template(v-if="category.parentId")
+ |
+ | • {{ $store.state.categories.items[category.parentId].name }}
+
+ .flex.items-center.gap-3
+ .text-neutral-800.dark_text-white.text-2xl.leading-none.font-semibold {{ category.name }}
+ .w-8.h-8.rounded-full.flex-center.text-xl.text-neutral-50(
+ :style="{ background: category.color }"
+ )
+ div(:class="category.icon")
+
+ .mdi.mdi-pencil-outline.cursor-pointer.rounded-full.mt-3.mr-2.w-16.h-16.flex-center.text-2xl.p-4.hocus_bg-gray-100.dark_hocus_bg-neutral-800(
+ @click="handleEditClick"
+ )
+
+ .pb-12
+ .px-3.flex
+ .cursor-pointer.p-1.px-3.flex.items-center.gap-3.bg-gray-50.dark_bg-dark4.rounded-md.hocus_bg-gray-100.dark_hocus_bg-neutral-800.shadow.hocus_shadow-lg(
+ class="dark_text-white/60"
+ @click="handleSetFilterCategory"
+ )
+ .mdi.mdi-poll.text-xl
+ .text-xs.leading-none {{ $t('statBy') }} {{ category.name }}
+ .mdi.mdi-chevron-right.opacity-70.text-lg.leading-none
+
+ //- Childs categories
+ .pb-12(v-if="category.childIds && category.childIds.length > 0")
+ .statTitle.flex.gap-2.px-3(class="!pb-3")
+ div {{ $t('categories.title') }}:
+ div {{ category.childIds.length }}
+
+ .px-3
+ CategoriesView(
+ :ids="categoryChildIds"
+ :slider="() => ({})"
+ isHideParentCategory
+ borderTop
+ noPadding
+ @onClick="id => $router.push(`/categories/${id}`)"
+ )
+
+ //- History
+ .px-3
+ TrnsHistory(
+ :trnsIds="trnsIds"
+ :trnType="filter.trnType"
+ hideTransfers
+ @setFilterTrnType="value => filter.trnType = value"
+ )
+</template>
+
+<i18n lang="json5">
+{
+ "en": {
+ "statBy": "Statistics: ",
+ },
+ "ru": {
+ "statBy": "Статистика: ",
+ },
+}
+</i18n>
diff --git a/components/categories/pages/id/Index.vue b/components/categories/pages/id/Index.vue
deleted file mode 100644
index d2288c9f..00000000
--- a/components/categories/pages/id/Index.vue
+++ /dev/null
@@ -1,119 +0,0 @@
-<script setup lang="ts">
-import useFilter from '~/modules/filter/useFilter'
-import { getTrnsIds } from '~/components/trns/functions/getTrns'
-
-const { $store } = useNuxtApp()
-const { setFilterCatsId } = useFilter()
-
-const route = useRoute()
-const router = useRouter()
-
-const categoryId = computed(() => route.params.id)
-const category = computed(() => $store.state.categories.items[categoryId.value])
-if (!category.value)
- router.replace('/categories')
-
-const trnsItems = computed(() => $store.state.trns.items)
-const backLink = computed(() => category.value?.parentId ? `/categories/${category.value.parentId}` : '/categories')
-
-const filter = reactive({ trnType: null })
-
-const categoryChildIds = computed(() => category.value.childIds?.sort((a, b) => {
- if ($store.state.categories.items[a].name < $store.state.categories.items[b].name) return -1
- if ($store.state.categories.items[a].name > $store.state.categories.items[b].name) return 1
- return 0
-}))
-
-const trnsIds = computed(() =>
- getTrnsIds({
- categoriesIds: category.value?.childIds ? category.value?.childIds : [categoryId.value],
- trnType: filter.trnType,
- trnsItems: trnsItems.value,
- }))
-
-function handleSetFilterCategory() {
- setFilterCatsId(categoryId.value)
- $store.commit('filter/setFilterDateNow')
- $store.dispatch('ui/setActiveTabStat', 'details')
-}
-
-function handleEditClick() {
- router.push(`/categories/${categoryId.value}/edit`)
-}
-</script>
-
-<template lang="pug">
-.relative.h-full.overflow.overflow-x-auto(v-if="category")
- router-link(
- v-slot='{ href, navigate }'
- :to='backLink'
- custom
- )
- .flex.items-start
- a.grow.cursor-pointer.block.py-5.mb-3.px-3.font-nunito.hocus_bg-gray-100.dark_hocus_bg-neutral-800(
- :href='href'
- @click='navigate'
- )
- .pb-2.text-xs.font-medium(class="text-white/50")
- | {{ $t('categories.title') }}
- template(v-if="category.parentId")
- |
- | • {{ $store.state.categories.items[category.parentId].name }}
-
- .flex.items-center.gap-3
- .text-neutral-800.dark_text-white.text-2xl.leading-none.font-semibold {{ category.name }}
- .w-8.h-8.rounded-full.flex-center.text-xl.text-neutral-50(
- :style="{ background: category.color }"
- )
- div(:class="category.icon")
-
- .mdi.mdi-pencil-outline.cursor-pointer.rounded-full.mt-3.mr-2.w-16.h-16.flex-center.text-2xl.p-4.hocus_bg-gray-100.dark_hocus_bg-neutral-800(
- @click="handleEditClick"
- )
-
- .pb-12
- .px-3.flex
- .cursor-pointer.p-1.px-3.flex.items-center.gap-3.bg-gray-50.dark_bg-dark4.rounded-md.hocus_bg-gray-100.dark_hocus_bg-neutral-800.shadow.hocus_shadow-lg(
- class="dark_text-white/60"
- @click="handleSetFilterCategory"
- )
- .mdi.mdi-poll.text-xl
- .text-xs.leading-none {{ $t('statBy') }} {{ category.name }}
- .mdi.mdi-chevron-right.opacity-70.text-lg.leading-none
-
- //- Childs categories
- .pb-12(v-if="category.childIds && category.childIds.length > 0")
- .statTitle.flex.gap-2.px-3(class="!pb-3")
- div {{ $t('categories.title') }}:
- div {{ category.childIds.length }}
-
- .px-3
- CategoriesView(
- :ids="categoryChildIds"
- :slider="() => ({})"
- isHideParentCategory
- borderTop
- noPadding
- @onClick="id => $router.push(`/categories/${id}`)"
- )
-
- //- History
- .px-3
- TrnsHistory(
- :trnsIds="trnsIds"
- :trnType="filter.trnType"
- hideTransfers
- @setFilterTrnType="value => filter.trnType = value"
- )
-</template>
-
-<i18n lang="json5">
-{
- "en": {
- "statBy": "Statistics: ",
- },
- "ru": {
- "statBy": "Статистика: ",
- },
-}
-</i18n>
diff --git a/components/layout/BottomMenu.vue b/components/layout/BottomMenu.vue
deleted file mode 100644
index baf7b44e..00000000
--- a/components/layout/BottomMenu.vue
+++ /dev/null
@@ -1,192 +0,0 @@
-<script>
-export default {
- props: {
- slider: { type: Object, required: true },
- stat2: { type: Boolean, default: false },
- },
-
- setup() {
- const { $store, nuxt2Context: { i18n } } = useNuxtApp()
- const route = useRoute()
- const router = useRouter()
-
- const menu = computed(() => ({
- stat: {
- icon: 'mdi mdi-poll',
- id: 'stat',
- name: i18n.t('stat.title'),
- },
- wallets: {
- icon: 'mdi mdi-credit-card-multiple',
- id: 'wallets',
- name: i18n.t('wallets.name'),
- },
- categories: {
- icon: 'mdi mdi-folder-star',
- id: 'categories',
- name: i18n.t('categories.shortTitle'),
- },
- menu: {
- icon: 'mdi mdi-menu',
- id: 'menu',
- name: i18n.t('trns.shortTitle'),
- },
- }))
-
- function handleSetActiveTab(tabName) {
- if (tabName === 'menu') {
- $store.dispatch('ui/setActiveTab', 'menu')
- return
- }
-
- router.push(`/${tabName}`)
- }
-
- function getClassName(id) {
- if (route.name.includes(id))
- return true
- else if (id === 'stat' && route.name === 'index')
- return true
- }
-
- return {
- menu,
- handleSetActiveTab,
- getClassName,
- }
- },
-}
-</script>
-
-<template lang="pug">
-.menu
- .menu__wrap
- .menu__row
- //- wallets
- .menu__item(
- :class="{ _active: getClassName(menu.wallets.id) }"
- @click="handleSetActiveTab(menu.wallets.id)"
- )
- .menu__item__icon: div(:class="menu.wallets.icon")
-
- //- categories
- .menu__item(
- :class="{ _active: getClassName(menu.categories.id) }"
- @click="handleSetActiveTab(menu.categories.id)"
- )
- .menu__item__icon: div(:class="menu.categories.icon")
-
- .openTrnForm(@click="$store.dispatch('trnForm/openTrnForm', { action: 'create' })")
- svg(
- xmlns="http://www.w3.org/2000/svg"
- viewBox="0 0 24 24"
- )
- path(d='M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z')
-
- //- stat
- .menu__item(
- :class="{ _active: getClassName(menu.stat.id) }"
- @click="handleSetActiveTab(menu.stat.id)"
- )
- .menu__item__icon: div(:class="menu.stat.icon")
-
- //- menu
- .menu__item(
- :class="{ _active: getClassName(menu.menu.id) }"
- @click="handleSetActiveTab(menu.menu.id)"
- )
- .menu__item__icon: div(:class="menu.menu.icon")
-</template>
-
-<style lang="stylus" scoped>
-@import '~assets/stylus/variables/animations'
-@import '~assets/stylus/variables/margins'
-@import '~assets/stylus/variables/media'
-
-.create-btn
- flex-grow 1
- padding-left $m7
-
-.customize
- display flex
- justify-content flex-end
- flex-grow 1
- padding-right $m7
-
-.openTrnForm
- flex-grow 1
- cursor pointer
- display flex
- align-items center
- justify-content center
- padding $m6 0
- border-radius 8px
- anim()
-
- +media-hover()
- background var(--c-blue-1)
-
- svg
- fill var(--c-font-1)
-
- +media(600px)
- padding $m8 0
-
- svg
- width 24px
- height 24px
- fill var(--c-blue-1)
- anim()
-
-.menu
- background var(--c-bg-3)
-
- &__wrap
- display grid
- max-width 680px
- margin 0 auto
-
- /.light &
- background var(--c-bg-4)
-
- &__row
- display flex
- align-items center
- justify-content center
-
- &__item
- cursor pointer
- display flex
- align-items center
- justify-content center
- flex-grow 1
- flex-flow column
- padding $m6 0
- color var(--c-font-4)
- border-radius 8px
- anim()
-
- +media(600px)
- padding $m8 0
- border-radius 8px
-
- +media-hover()
- color var(--c-font-1)
- background var(--c-blue-1)
-
- &:active
- color var(--c-font-2)
- background var(--c-blue-1)
-
- &._active
- color var(--c-font-2)
-
- /.light &
- color var(--c-font-5)
-
- &__icon
- font-size 22px
-
- +media(800px)
- font-size 28px
-</style>
diff --git a/components/layout/BottomMenuModalItems.vue b/components/layout/BottomMenuModalItems.vue
deleted file mode 100644
index ec63ad0f..00000000
--- a/components/layout/BottomMenuModalItems.vue
+++ /dev/null
@@ -1,40 +0,0 @@
-<script>
-import useMenuData from '~/modules/menu/useMenuData'
-
-export default defineComponent({
- setup() {
- const { items, onClick, checkIsActive, checkIsShow } = useMenuData()
-
- return {
- items,
- onClick,
- checkIsActive,
- checkIsShow,
- }
- },
-})
-</script>
-
-<template lang="pug">
-div
- .flex.items-center.py-3.px-6.space-x-5(
- v-for="(item, menuId) in items"
- v-if="checkIsShow(item)"
- :key="menuId"
- :class="['hocus_bg-zinc-100 dark_hocus_bg-neutral-800', { 'text-slate-900 dark_text-neutral-100': checkIsActive(menuId) }, { 'text-slate-600 dark_text-neutral-400': !checkIsActive(menuId) }]"
- @click="onClick(menuId)"
- )
- .text-xl(:class="item.icon")
- .text-sm {{ item.name }}
- .text-2xs.text-slate-600.dark_text-neutral-400(
- v-if="item.isBeta"
- class="-ml-2 -mt-2"
- ) Beta
-
- .flex.items-center.py-3.px-6.space-x-5(
- class="text-slate-600 dark_text-neutral-400 hocus_bg-zinc-100 dark_hocus_bg-neutral-800"
- @click="$store.dispatch('ui/changeTheme')"
- )
- .text-xl.mdi.mdi-palette
- .text-sm {{ $t('theme.change') }}
-</template>
diff --git a/components/layout/MenuBottom.vue b/components/layout/MenuBottom.vue
new file mode 100644
index 00000000..8b35dbab
--- /dev/null
+++ b/components/layout/MenuBottom.vue
@@ -0,0 +1,114 @@
+<script setup lang="ts">
+import useMenuData from '~/modules/menu/useMenuData'
+
+const { $store } = useNuxtApp()
+const { onClick, checkIsActive } = useMenuData()
+const activeTab = computed(() => $store.state.ui.activeTab)
+</script>
+
+<template lang="pug">
+.menu
+ LazyLayoutMenuBottomModal(v-if="activeTab === 'menu'")
+
+ .grid.mx-auto.max-w-xl
+ .menu__row
+ //- Wallets
+ .menu__item.group(
+ :class="{ _active: checkIsActive('wallets') }"
+ @click="onClick('wallets')"
+ )
+ UiIconWallet.w-6.h-6.md_w-8.md_h-8(
+ :class="{ 'text-blue3 dark_text-white': checkIsActive('wallets'), 'group-hover_text-white': !checkIsActive('wallets') }"
+ )
+
+ //- Categories
+ .menu__item.group(
+ :class="{ _active: checkIsActive('categories') }"
+ @click="onClick('categories')"
+ )
+ UiIconCategory.w-6.h-6.md_w-8.md_h-8(
+ :class="{ 'text-blue3 dark_text-white': checkIsActive('categories'), 'group-hover_text-white': !checkIsActive('categories') }"
+ )
+
+ .openTrnForm(@click="$store.dispatch('trnForm/openTrnForm', { action: 'create' })")
+ svg(
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 24 24"
+ )
+ path(d='M0,12a1.5,1.5,0,0,0,1.5,1.5h8.75a.25.25,0,0,1,.25.25V22.5a1.5,1.5,0,0,0,3,0V13.75a.25.25,0,0,1,.25-.25H22.5a1.5,1.5,0,0,0,0-3H13.75a.25.25,0,0,1-.25-.25V1.5a1.5,1.5,0,0,0-3,0v8.75a.25.25,0,0,1-.25.25H1.5A1.5,1.5,0,0,0,0,12Z')
+
+ //- Stat
+ .menu__item.group(
+ :class="{ _active: checkIsActive('index') }"
+ @click="onClick('index')"
+ )
+ UiIconStat.w-6.h-6.md_w-8.md_h-8(
+ :class="{ 'text-blue3 dark_text-white': checkIsActive('index'), 'group-hover_text-white': !checkIsActive('index') }"
+ )
+
+ //- menu
+ .menu__item.group(
+ :class="{ _active: checkIsActive('menu') }"
+ @click="handleSetActiveTab('menu')"
+ )
+ UiIconMenu.w-6.h-6.md_w-8.md_h-8.group-hover_text-white
+</template>
+
+<style lang="stylus" scoped>
+@import '~assets/stylus/variables/animations'
+@import '~assets/stylus/variables/margins'
+@import '~assets/stylus/variables/media'
+
+.menu
+ &__row
+ display flex
+ align-items center
+ justify-content center
+
+ &__item
+ display flex
+ align-items center
+ justify-content center
+ flex-grow 1
+ flex-flow column
+ padding $m6 0
+ color var(--c-font-4)
+ anim()
+
+ +media(600px)
+ border-radius 8px
+
+ +media-hover()
+ &:not(._active)
+ cursor pointer
+ color var(--c-font-1)
+ background var(--c-blue-1)
+
+ &:active
+ color var(--c-font-2)
+ background var(--c-blue-1)
+
+.openTrnForm
+ flex-grow 1
+ cursor pointer
+ display flex
+ align-items center
+ justify-content center
+ padding $m6 0
+ anim()
+
+ +media(600px)
+ border-radius 8px
+
+ +media-hover()
+ background var(--c-blue-1)
+
+ svg
+ fill var(--c-font-1)
+
+ svg
+ width 24px
+ height 24px
+ fill var(--c-blue-1)
+ anim()
+</style>
diff --git a/components/layout/BottomMenuModal.vue b/components/layout/MenuBottomModal.vue
similarity index 70%
rename from components/layout/BottomMenuModal.vue
rename to components/layout/MenuBottomModal.vue
index 21de4936..ea94b42f 100644
--- a/components/layout/BottomMenuModal.vue
+++ b/components/layout/MenuBottomModal.vue
@@ -1,14 +1,9 @@
-<script>
-export default {
- setup() {
- const { $store } = useNuxtApp()
- const activeTab = computed(() => $store.state.ui.activeTab)
+<script setup lang="ts">
+import useMenuData from '~/modules/menu/useMenuData'
- return {
- activeTab,
- }
- },
-}
+const { $store } = useNuxtApp()
+const { onClick, checkIsActive } = useMenuData()
+const activeTab = computed(() => $store.state.ui.activeTab)
</script>
<template lang="pug">
@@ -22,6 +17,7 @@ Portal(to="modal")
BaseBottomSheetClose(@onClick="close")
.content(class="!overflow-hidden !pt-8 !pb-2")
+ //- User
.mb-4.pb-4.border-b(
class="border-neutral-300 dark_border-neutral-800"
)
@@ -38,7 +34,16 @@ Portal(to="modal")
.text-xl.mdi.mdi-logout
.text-sm {{ $t('userLogout') }}
- LayoutBottomMenuModalItems
+ //- Main Menu
+ LayoutSidebarMenu
+
+ //- Theme
+ .flex.items-center.py-3.px-6.space-x-5(
+ class="text-slate-600 dark_text-neutral-400 hocus_bg-zinc-100 dark_hocus_bg-neutral-800"
+ @click="$store.dispatch('ui/changeTheme')"
+ )
+ .text-xl.mdi.mdi-palette
+ .text-sm {{ $t('theme.change') }}
</template>
<style lang="stylus" scoped>
diff --git a/components/layout/Modals.vue b/components/layout/Modals.vue
index a799367c..391a30dd 100644
--- a/components/layout/Modals.vue
+++ b/components/layout/Modals.vue
@@ -27,9 +27,6 @@ export default defineComponent({
//- trn: item
TrnsModal
- //- menu
- LazyLayoutBottomMenuModal(v-if="activeTab === 'menu'")
-
//- currencies
CurrenciesModal
diff --git a/components/layout/Sidebar.vue b/components/layout/Sidebar.vue
index c2a2b4af..edebe7ab 100644
--- a/components/layout/Sidebar.vue
+++ b/components/layout/Sidebar.vue
@@ -18,11 +18,6 @@
uiSimple
@onClick="id => $router.push(`/wallets/${id}`)"
)
-
- .absolute.left-0.bottom-0.w-full
- //- .sidebar__trn.py-4(@click="$store.dispatch('trnForm/openTrnForm', { action: 'create', isPc: true })")
- .sidebar__trn.py-4(@click="$store.dispatch('trnForm/openTrnForm', { action: 'create' })")
- .btn: .mdi.mdi-plus
</template>
<style lang="stylus" scoped>
@@ -39,27 +34,4 @@
overflow-y auto
height 100%
padding-bottom $m9
-
- &__trn
- cursor pointer
- display flex
- align-items flex-end
- justify-content center
- anim()
-
- +media-hover()
- .btn
- transform scale(1.3)
-
- .btn
- display flex
- align-items center
- justify-content center
- width 48px
- height 48px
- color var(--c-font-1)
- font-size 32px
- background var(--c-blue-1)
- border-radius 50%
- anim()
</style>
diff --git a/components/layout/SidebarMenu.vue b/components/layout/SidebarMenu.vue
index b391b7e6..4baed51d 100644
--- a/components/layout/SidebarMenu.vue
+++ b/components/layout/SidebarMenu.vue
@@ -1,4 +1,4 @@
-<script>
+<script lang="ts">
import useMenuData from '~/modules/menu/useMenuData'
export default defineComponent({
@@ -17,14 +17,22 @@ export default defineComponent({
<template lang="pug">
div
- .flex.items-center.py-2.px-6.space-x-5.cursor-pointer(
+ .flex.items-center.py-3.px-6.space-x-5.cursor-pointer(
v-for="(item, menuId) in items"
v-if="checkIsShow(item)"
:key="menuId"
:class="['hocus_bg-gray-200 dark_hocus_bg-neutral-800', { 'text-slate-900 dark_text-neutral-100': checkIsActive(menuId) }, { 'text-slate-600 dark_text-neutral-400': !checkIsActive(menuId) }]"
@click="onClick(menuId)"
)
- .text-xl(:class="item.icon")
+ Component.w-6.h-6(
+ v-if="item.component"
+ :is="item.component"
+ )
+ .text-xl(
+ v-else
+ :class="item.icon"
+ )
+
.text-sm {{ item.name }}
.text-2xs.text-slate-600.dark_text-neutral-400(
v-if="item.isBeta"
diff --git a/components/stat/Index.vue b/components/stat/Index.vue
index 27f240e2..b0924f97 100644
--- a/components/stat/Index.vue
+++ b/components/stat/Index.vue
@@ -40,52 +40,53 @@ const isShowGroupTrns = computed(() => {
<template lang="pug">
.overflow-hidden.overflow-y-auto.h-full.pb-8.js_scroll_page
- StatPeriodArrows
- StatDate
- LazyStatChart(v-if="ui.showMainChart && statPage.isHasTrns")
- .lg_flex
- StatViewConfig.lg_order-2.lg_ml-auto
- StatPeriods.lg_order-1
+ .max-w-4xl
+ StatPeriodArrows
+ StatDate
+ LazyStatChart(v-if="ui.showMainChart && statPage.isHasTrns")
+ .pb-3.lg_flex
+ StatViewConfig.lg_order-2.lg_ml-auto
+ StatPeriods.lg_order-1
- .py-8.px-3
- StatSumTotal
+ .py-6.px-3(v-if="statPage.filter.isShow")
+ LazyStatFilter
- .pb-8.px-3(v-if="statPage.filter.isShow")
- LazyStatFilter
+ .py-3.px-3
+ StatMenu
- .px-3.pb-2
- StatMenu
+ .py-3.pb-3.px-3(v-if="statPage.activeTab === 'details'")
+ StatSumTotal
- template(v-if="statPage.activeTab !== 'trns'")
- //- Loop throw incomes / expenses
- .py-2.px-3
- .grid.grid-cols-1.gap-y-5(class="md_grid-cols-2 md_gap-x-20")
- div(
- v-for="item in moneyTypes"
- v-show="isShowGroup(item.id)"
- :key="item.id"
- class="max-w-[420px]"
- )
- StatGroupSum(:typeText="item.id")
- StatGroupEmpty(:typeText="item.id")
- StatGroupCatsPie(:typeText="item.id")
- StatGroupCatsVertical(:typeText="item.id")
- StatGroupCatsRound(:typeText="item.id")
- StatGroupCatsHorizontal(:typeText="item.id")
+ template(v-if="statPage.activeTab !== 'trns'")
+ //- Loop throw incomes / expenses
+ .py-0.px-3
+ .grid.grid-cols-1.gap-y-5(class="md_grid-cols-2 md_gap-x-20")
+ div(
+ v-for="item in moneyTypes"
+ v-show="isShowGroup(item.id)"
+ :key="item.id"
+ class="max-w-[420px]"
+ )
+ StatGroupSum(:typeText="item.id")
+ StatGroupEmpty(:typeText="item.id")
+ StatGroupCatsPie(:typeText="item.id")
+ StatGroupCatsVertical(:typeText="item.id")
+ StatGroupCatsRound(:typeText="item.id")
+ StatGroupCatsHorizontal(:typeText="item.id")
- LazyStatGroupTrns(v-if="isShowGroupTrns && !isEmptyStat")
+ LazyStatGroupTrns(v-if="isShowGroupTrns && !isEmptyStat")
- .px-3
- StatEmpty
- .grid.md_grid-cols-2.md_gap-x-20
- LazyStatTrns(v-if="isShowTrns && !isEmptyStat")
+ .px-3
+ StatEmpty
+ .grid.md_grid-cols-2.md_gap-x-20
+ LazyStatTrns(v-if="isShowTrns && !isEmptyStat")
- //- Trns
- template(v-if="statPage.activeTab === 'trns'")
- .px-3
- .grid.md_grid-cols-2.md_gap-x-20
- TrnsList(
- :size="50"
- classNames="md_grid-cols-1"
- )
+ //- Trns
+ template(v-if="statPage.activeTab === 'trns'")
+ .px-3
+ .grid.md_grid-cols-2.md_gap-x-20
+ TrnsList(
+ :size="50"
+ classNames="md_grid-cols-1"
+ )
</template>
diff --git a/components/stat/StatItem.vue b/components/stat/StatItem.vue
index 5cbc4108..5ad77983 100644
--- a/components/stat/StatItem.vue
+++ b/components/stat/StatItem.vue
@@ -77,7 +77,7 @@ export default {
@click="toogleShowInside"
)
.ins.py-2.px-3.space-x-3.rounded-md.justify-between.items-center.flex.border.bg-white2(
- :class="['z-[9] dark_bg-dark4 hocus_bg-neutral-100 dark_hocus_bg-neutral-800', { _active: isShowInside }, { 'dark_border-neutral-800 cursor-n-resize shadow-xl': isShowInside }, { 'border-transparent cursor-s-resize shadow-sm': !isShowInside }]"
+ :class="['z-[9] dark_bg-dark4 hocus_bg-neutral-100 dark_hocus_bg-neutral-800', { _active: isShowInside }, { 'dark_border-neutral-800 cursor-n-resize shadow-xl rounded-b-none': isShowInside }, { 'border-transparent cursor-s-resize shadow-sm': !isShowInside }]"
)
//- Icon
.cursor-pointer.text-neutral-50.text-xl.leading-none.w-8.h-8.rounded-full.justify-center.items-center.flex(
@@ -98,7 +98,7 @@ export default {
.pt-1.statItem__graph.mt-1: .statItem__graph__in(:style="styles")
//- Inside
- .overflow-hidden.ins2.mx-2.rounded-b-md.border.border-t-0(
+ .overflow-hidden.ins2.rounded-b-md.border.border-t-0(
v-if="isShowInside"
class="mt-[-1px] dark_border-neutral-800"
@click.stop=""
diff --git a/components/stat/StatItemChildCats.vue b/components/stat/StatItemChildCats.vue
index ae984d24..c09c55c4 100644
--- a/components/stat/StatItemChildCats.vue
+++ b/components/stat/StatItemChildCats.vue
@@ -62,13 +62,13 @@ export default {
<template lang="pug">
div
- template(v-for="category in statCategories")
- StatItemChildCatsItem(
- :biggest="$store.getters['stat/statCurrentPeriod'][typeName].biggest"
- :category="$store.state.categories.items[category.categoryId]"
- :categoryId="category.categoryId"
- :key="category.categoryId"
- :type="type"
- :total="category[typeName]"
- )
+ StatItemChildCatsItem(
+ v-for="category in statCategories"
+ :key="category.categoryId"
+ :biggest="$store.getters['stat/statCurrentPeriod'][typeName].biggest"
+ :category="$store.state.categories.items[category.categoryId]"
+ :categoryId="category.categoryId"
+ :total="category[typeName]"
+ :type="type"
+ )
</template>
diff --git a/components/stat/group/Sum.vue b/components/stat/group/Sum.vue
index 121d0587..aa9951ed 100644
--- a/components/stat/group/Sum.vue
+++ b/components/stat/group/Sum.vue
@@ -24,7 +24,7 @@ export default defineComponent({
<template lang="pug">
.sticky.top-0.z-10.bg-white(class="dark_bg-dark3")
.py-3
- .statTitle.pb-2(v-if="statPage.activeTab !== typeText") {{ $t(`money.${typeText}`) }}
+ .statTitle.pb-2 {{ $t(`money.${typeText}`) }}
.overflow-hidden.overflow-x-auto.scrollbar
.flex.items-center
//- Total
diff --git a/components/stat/group/Trns.vue b/components/stat/group/Trns.vue
index 4f2aabf2..3a06abb6 100644
--- a/components/stat/group/Trns.vue
+++ b/components/stat/group/Trns.vue
@@ -13,8 +13,8 @@ export default defineComponent({
</script>
<template lang="pug">
-div(class="max-w-[420px]")
- .py-2
+.py-3(class="max-w-[420px]")
+ .pb-2
.statTitle {{ $t('trns.inPeriodTitle') }}
TrnsList(
diff --git a/components/trns/item/WithoutCat.vue b/components/trns/item/WithoutCat.vue
index 59bed63d..ad7b60aa 100644
--- a/components/trns/item/WithoutCat.vue
+++ b/components/trns/item/WithoutCat.vue
@@ -36,7 +36,7 @@ export default defineComponent({
) {{ $t(formatDate(trnItem.date, 'trnItem')) }}
.grow
- .items-center.flex
+ .flex
.grow
.space-x-2.items-baseline.flex
//- Wallet
diff --git a/components/ui/icon/Category.vue b/components/ui/icon/Category.vue
new file mode 100644
index 00000000..d276a104
--- /dev/null
+++ b/components/ui/icon/Category.vue
@@ -0,0 +1,10 @@
+<template lang="pug">
+svg(
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 20 20"
+)
+ path(
+ fill="currentColor"
+ d="M10.164 5.102a.175.175 0 0 0-.318 0L9.13 6.655a.175.175 0 0 1-.138.1l-1.699.202a.175.175 0 0 0-.098.302L8.451 8.42a.175.175 0 0 1 .053.163L8.17 10.26a.175.175 0 0 0 .257.187l1.493-.835a.175.175 0 0 1 .17 0l1.493.835c.13.073.286-.04.257-.187l-.333-1.677a.175.175 0 0 1 .053-.163l1.255-1.161a.175.175 0 0 0-.098-.302l-1.698-.202a.175.175 0 0 1-.139-.1l-.716-1.553ZM16 8a5.985 5.985 0 0 1-2 4.472V17.5a.5.5 0 0 1-.748.434L10 16.076l-3.252 1.858A.5.5 0 0 1 6 17.5v-5.028A6 6 0 1 1 16 8Zm-6 6a5.973 5.973 0 0 1-3-.803v3.442l2.752-1.573a.5.5 0 0 1 .496 0L13 16.64v-3.442A5.972 5.972 0 0 1 10 14Zm0-1a5 5 0 1 0 0-10a5 5 0 0 0 0 10Z"
+ )
+</template>
diff --git a/components/ui/icon/Menu.vue b/components/ui/icon/Menu.vue
new file mode 100644
index 00000000..adbee244
--- /dev/null
+++ b/components/ui/icon/Menu.vue
@@ -0,0 +1,14 @@
+<template lang="pug">
+svg(
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 512 512"
+)
+ path(
+ fill="none"
+ stroke="currentColor"
+ stroke-linecap="round"
+ stroke-miterlimit="10"
+ stroke-width="32"
+ d="M80 130h352M80 256h352M80 382h352"
+ )
+</template>
diff --git a/components/ui/icon/Stat.vue b/components/ui/icon/Stat.vue
new file mode 100644
index 00000000..2f05050a
--- /dev/null
+++ b/components/ui/icon/Stat.vue
@@ -0,0 +1,10 @@
+<template lang="pug">
+svg(
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 24 24"
+)
+ path(
+ fill="currentColor"
+ d="M16.749 2h4.554l.1.014l.099.028l.06.026c.08.034.153.085.219.15l.04.044l.044.057l.054.09l.039.09l.019.064l.014.064l.009.095v4.532a.75.75 0 0 1-1.493.102l-.007-.102V4.559l-6.44 6.44a.75.75 0 0 1-.976.073L13 11L9.97 8.09l-5.69 5.689a.75.75 0 0 1-1.133-.977l.073-.084l6.22-6.22a.75.75 0 0 1 .976-.072l.084.072l3.03 2.91L19.438 3.5h-2.69a.75.75 0 0 1-.742-.648l-.007-.102a.75.75 0 0 1 .648-.743L16.75 2ZM3.75 17a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5a.75.75 0 0 1 .75-.75Zm5.75-3.25a.75.75 0 0 0-1.5 0v7.5a.75.75 0 0 0 1.5 0v-7.5ZM13.75 15a.75.75 0 0 1 .75.75v5.5a.75.75 0 0 1-1.5 0v-5.5a.75.75 0 0 1 .75-.75Zm5.75-4.25a.75.75 0 0 0-1.5 0v10.5a.75.75 0 0 0 1.5 0v-10.5Z"
+ )
+</template>
diff --git a/components/ui/icon/Wallet.vue b/components/ui/icon/Wallet.vue
new file mode 100644
index 00000000..b4543b69
--- /dev/null
+++ b/components/ui/icon/Wallet.vue
@@ -0,0 +1,29 @@
+<template lang="pug">
+svg(
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 512 512"
+)
+ rect(
+ width="416"
+ height="288"
+ x="48"
+ y="144"
+ fill="none"
+ stroke="currentColor"
+ stroke-linejoin="round"
+ stroke-width="24"
+ rx="48"
+ ry="48"
+ )
+ path(
+ fill="none"
+ stroke="currentColor"
+ stroke-linejoin="round"
+ stroke-width="24"
+ d="M411.36 144v-30A50 50 0 0 0 352 64.9L88.64 109.85A50 50 0 0 0 48 159v49"
+ )
+ path(
+ fill="currentColor"
+ d="M368 300a30 30 0 1 1 30-30a30 30 0 0 1-30 30Z"
+ )
+</template>
diff --git a/components/wallets/item/Simple.vue b/components/wallets/item/Simple.vue
index bcfaa14a..67c20098 100644
--- a/components/wallets/item/Simple.vue
+++ b/components/wallets/item/Simple.vue
@@ -43,8 +43,8 @@ export default defineComponent({
</script>
<template lang="pug">
-.py-2.px-5.gap-x-3.items-center.flex.cursor-pointer(
- :class="[{ _active: activeItemId === id }, 'hocus_bg-gray-200 dark_hocus_bg-neutral-800']"
+.cursor-pointer.py-1.px-5.gap-x-3.flex.items-center.hocus_bg-gray-200.dark_hocus_bg-neutral-800.border-b.border-gray-200.dark_border-neutral-800(
+ :class="[{ _active: activeItemId === id }, 'min-h-[48px]']"
@click="handleClick"
)
//- Icon
@@ -61,12 +61,9 @@ export default defineComponent({
Amount(
:currency="wallet.currency"
- :showBase="showBase"
- :size="size"
:value="wallet.total"
- :vertical="vertical"
alwaysShowSymbol
+ showBase
+ vertical="right"
)
-
- div(class="h-[1px] bg-gray-200 dark_bg-neutral-800")
</template>
diff --git a/components/wallets/pages/List.vue b/components/wallets/page/List.vue
similarity index 69%
rename from components/wallets/pages/List.vue
rename to components/wallets/page/List.vue
index fa1ea6c8..3c60ad0f 100644
--- a/components/wallets/pages/List.vue
+++ b/components/wallets/page/List.vue
@@ -1,8 +1,7 @@
<script setup lang="ts">
import useWallets from '~/components/wallets/useWallets'
-const { walletsIdsSorted, walletsItemsSorted } = useWallets()
-console.log(walletsItemsSorted)
+const { walletsItemsSorted } = useWallets()
</script>
<script lang="ts">
@@ -16,25 +15,27 @@ export default defineComponent({
</script>
<template lang="pug">
-.h-full.overflow.overflow-x-auto
- .max-w-3xl
+.h-full.overflow.overflow-x-auto.grid.max-w-3xl.h-full(
+ class="pb-[44px] md_pb-[52px] lg_pb-0 lg_grid-rows-[1fr_auto]"
+)
+ div
.flex
.grow.py-6.px-3.font-nunito.text-neutral-800.dark_text-white.text-2xl.leading-none.font-semibold
| {{ $t('wallets.name') }}
.flex-center.gap-3.pr-3
//- Sort
- .cursor-pointer.bg.rounded-full.w-10.h-10.flex-center.hocus-text-white.hocus_bg-blue2(
+ .cursor-pointer.group.bg.rounded-full.w-10.h-10.flex-center.hocus-text-white.hocus_bg-blue2(
@click="$store.dispatch('ui/setActiveTab', 'walletsSort')"
)
- svg.w-6.h-6(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24")
+ svg.group-hover_text-white.w-6.h-6(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24")
path(fill="currentColor" d="M7 20h2V8h3L8 4L4 8h3zm13-4h-3V4h-2v12h-3l4 4z")
//- Add
- .cursor-pointer.bg.rounded-full.w-10.h-10.flex-center.hocus-text-white.hocus_bg-blue2(
+ .cursor-pointer.group.bg.rounded-full.w-10.h-10.flex-center.hocus-text-white.hocus_bg-blue2(
@click="$store.dispatch('ui/setActiveTab', 'createWallet')"
)
- svg.w-6.h-6(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12")
+ svg.group-hover_text-white.w-6.h-6(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12")
path(fill="currentColor" d="M6 1.5a.5.5 0 0 0-1 0V5H1.5a.5.5 0 0 0 0 1H5v3.5a.5.5 0 0 0 1 0V6h3.5a.5.5 0 0 0 0-1H6V1.5Z")
.pb-6.px-3
@@ -52,8 +53,10 @@ export default defineComponent({
.text-xs.leading-none Total
.mdi.mdi-chevron-right.opacity-70.text-lg.leading-none
- .pb-12.px-3.grid.gap-y-1.gap-x-6.lg_grid-cols-2
- .bg.cursor-pointer.py-3.px-3.rounded-md.hocus_bg-gray-100.dark_hocus_bg-neutral-800(
+ //- List
+ //---------------------------------
+ .pb-12.px-3.grid.gap-y-1.gap-x-6.md_grid-cols-2
+ .bg.cursor-pointer.py-2.px-3.rounded-md.hocus_bg-gray-100.dark_hocus_bg-neutral-800(
v-for="(walletItem, walletId) in walletsItemsSorted"
:key="walletId"
@click="$router.push(`/wallets/${walletId}`)"
@@ -74,11 +77,11 @@ export default defineComponent({
vertical="right"
)
- .pb-4.px-3.flex.gap-4
- //- Create
- .button(@click="$store.dispatch('ui/setActiveTab', 'createWallet')") {{ $t('wallets.new') }}
- //- Sort
- .button(@click="$store.dispatch('ui/setActiveTab', 'walletsSort')") {{ $t('base.sort') }}
+ .pb-4.px-3.flex.gap-4
+ //- Create
+ .button(@click="$store.dispatch('ui/setActiveTab', 'createWallet')") {{ $t('wallets.new') }}
+ //- Sort
+ .button(@click="$store.dispatch('ui/setActiveTab', 'walletsSort')") {{ $t('base.sort') }}
</template>
<style lang="stylus" scoped>
diff --git a/components/wallets/pages/id/Edit.vue b/components/wallets/page/id/Edit.vue
similarity index 52%
rename from components/wallets/pages/id/Edit.vue
rename to components/wallets/page/id/Edit.vue
index 6ac82680..d581a733 100644
--- a/components/wallets/pages/id/Edit.vue
+++ b/components/wallets/page/id/Edit.vue
@@ -162,158 +162,161 @@ export default defineComponent({
</script>
<template lang="pug">
-.relative.h-full.overflow.overflow-x-auto(v-if="wallet")
- router-link(
- v-slot='{ href, navigate }'
- :to='`/wallets/${walletId}`'
- custom
- )
- a.grow.cursor-pointer.block.py-5.pb-5.mb-4.px-3.font-nunito.hocus_bg-gray-100.dark_hocus_bg-neutral-800(
- :href='href'
- @click='navigate'
+.h-full.overflow.overflow-x-auto.max-w-3xl.h-full(
+ class="pb-[44px] md_pb-[52px] lg_pb-0"
+)
+ template(v-if="wallet")
+ router-link(
+ v-slot='{ href, navigate }'
+ :to='`/wallets/${walletId}`'
+ custom
)
- .pb-1.text-xs.font-medium(class="text-white/50") {{ $t('wallets.editTitle') }}
-
- .flex.items-center.gap-3
- .text-neutral-800.dark_text-white.text-2xl.font-semibold {{ wallet.name }}
- .p-1.px-1.rounded.flex-center.text-2xs.text-neutral-50(
- :style="{ background: wallet.color }"
- ) {{ wallet.currency }}
-
- //- Menu
- //-----------------------------------
- .px-3.pb-4
- .overflow-hidden.rounded-md.scrollbar.mb-4.bg-gray-50.dark_bg-dark4.dark_shadow
- .overflow-hidden.overflow-x-auto.flex.items-center.text-sm.text-center.max-w-md
- .cursor-pointer.px-6.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
- :class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': activeTab === 'data' }"
- @click="activeTab = 'data'"
- ) {{ $t('categories.form.data.label') }}
-
- .cursor-pointer.px-6.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
- :class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': activeTab === 'currencies' }"
- @click="activeTab = 'currencies'"
- ) {{ $t('wallets.form.currencies.label') }}
-
- .cursor-pointer.px-6.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
- :class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': activeTab === 'colors' }"
- @click="activeTab = 'colors'"
- ) {{ $t('categories.form.colors.label') }}
-
- //- Content
- //-----------------------------------
- .px-3.max-w-md
-
- //- Data
- //-----------------------------------
- template(v-if="activeTab === 'data'")
- .mb-4
- .inputText
- .inputText__label {{ $t('wallets.form.name.label') }}
- input(
- type="text"
- :placeholder="$t('wallets.form.name.placeholder')"
- v-model="wallet.name"
- ).inputText__value
-
- SharedContextMenuItem(
- :checkboxValue="wallet.countTotal"
- :title="$t('wallets.form.total.placeholder')"
- showCheckbox
- @onClick="wallet.countTotal = !wallet.countTotal"
+ a.grow.cursor-pointer.block.py-5.pb-5.mb-4.px-3.font-nunito.hocus_bg-gray-100.dark_hocus_bg-neutral-800(
+ :href='href'
+ @click='navigate'
)
+ .pb-1.text-xs.font-medium(class="text-white/50") {{ $t('wallets.editTitle') }}
- SharedContextMenuItem(
- :checkboxValue="wallet.isCredit"
- :title="$t('isCredit')"
- showCheckbox
- @onClick="wallet.isCredit = !wallet.isCredit"
- )
+ .flex.items-center.gap-3
+ .text-neutral-800.dark_text-white.text-2xl.font-semibold {{ wallet.name }}
+ .p-1.px-1.rounded.flex-center.text-2xs.text-neutral-50(
+ :style="{ background: wallet.color }"
+ ) {{ wallet.currency }}
- //- Currencies
+ //- Menu
+ //-----------------------------------
+ .px-3.pb-4
+ .overflow-hidden.rounded-md.scrollbar.mb-4.bg-gray-50.dark_bg-dark4.dark_shadow
+ .overflow-hidden.overflow-x-auto.flex.items-center.text-sm.text-center.max-w-md
+ .cursor-pointer.px-6.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
+ :class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': activeTab === 'data' }"
+ @click="activeTab = 'data'"
+ ) {{ $t('categories.form.data.label') }}
+
+ .cursor-pointer.px-6.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
+ :class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': activeTab === 'currencies' }"
+ @click="activeTab = 'currencies'"
+ ) {{ $t('wallets.form.currencies.label') }}
+
+ .cursor-pointer.px-6.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
+ :class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': activeTab === 'colors' }"
+ @click="activeTab = 'colors'"
+ ) {{ $t('categories.form.colors.label') }}
+
+ //- Content
//-----------------------------------
- template(v-if="activeTab === 'currencies'")
- div
- .border-b.border-gray-50.dark_border-neutral-800.p-3.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
- v-for="(item, currency) in $store.state.currencies.rates"
- :key="item"
- :class="{ '_active cursor-default text-blue3 dark_text-blue1': wallet.currency === currency }"
- @click="handleCurrencySelect(currency)"
+ .px-3.max-w-md
+
+ //- Data
+ //-----------------------------------
+ template(v-if="activeTab === 'data'")
+ .mb-4
+ .inputText
+ .inputText__label {{ $t('wallets.form.name.label') }}
+ input(
+ type="text"
+ :placeholder="$t('wallets.form.name.placeholder')"
+ v-model="wallet.name"
+ ).inputText__value
+
+ SharedContextMenuItem(
+ :checkboxValue="wallet.countTotal"
+ :title="$t('wallets.form.total.placeholder')"
+ showCheckbox
+ @onClick="wallet.countTotal = !wallet.countTotal"
)
- .flex.items-center
- template(v-if="currencies.find(c => c.code === currency)")
- .grow {{ currencies.find(c => c.code === currency).currency }}
- div {{ currency }}
-
- template(v-else)
- .grow
- div {{ currency }}
-
- //- Colors
- //---------------------------------
- template(v-if="activeTab === 'colors'")
- .form
- .subTitle {{ $t('popularColors') }}
- .colors
- .iconItem(
- v-for="(color, idx) in popularColors"
- :key="idx"
- :class="{ _active: color === wallet.color }"
- :style="{ background: color === wallet.color ? color : 'transparent' }"
- @click="onSelectColor(color)"
- )
- template(v-if="color")
- template(v-if="findWalletWithThisColor(color)")
- Icon(
- icon="mdi mdi-credit-card-multiple"
- :color="color === wallet.color ? null : color"
- big
- )
- template(v-else-if="color === wallet.color")
- Icon(
- icon="mdi mdi-credit-card-multiple"
- background="transparent"
- big
- )
- template(v-else)
- .colorPreview(:style="{ background: color }")
-
- .subTitle {{ $t('palette') }}
- .colors
- .iconItem(
- v-for="(color, idx) in allColors"
- :key="idx"
- :class="{ _active: color === wallet.color, _empty: !color }"
- :style="{ background: color === wallet.color ? color : 'transparent' }"
- @click="onSelectColor(color)"
- )
- template(v-if="color")
- template(v-if="findWalletWithThisColor(color)")
- Icon(
- icon="mdi mdi-credit-card-multiple"
- :color="color === wallet.color ? null : color"
- big
- )
- template(v-else-if="color === wallet.color")
- Icon(
- icon="mdi mdi-credit-card-multiple"
- background="transparent"
- big
- )
- template(v-else)
- .colorPreview(:style="{ background: color }")
+ SharedContextMenuItem(
+ :checkboxValue="wallet.isCredit"
+ :title="$t('isCredit')"
+ showCheckbox
+ @onClick="wallet.isCredit = !wallet.isCredit"
+ )
- .subTitle {{ $t('categories.form.colors.custom') }}
- .customColor
- input.customColor__value(v-model="wallet.color" type="color")
+ //- Currencies
+ //-----------------------------------
+ template(v-if="activeTab === 'currencies'")
+ div
+ .border-b.border-gray-50.dark_border-neutral-800.p-3.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
+ v-for="(item, currency) in $store.state.currencies.rates"
+ :key="item"
+ :class="{ '_active cursor-default text-blue3 dark_text-blue1': wallet.currency === currency }"
+ @click="handleCurrencySelect(currency)"
+ )
+ .flex.items-center
+ template(v-if="currencies.find(c => c.code === currency)")
+ .grow {{ currencies.find(c => c.code === currency).currency }}
+ div {{ currency }}
- .pt-4.pb-6
- SharedButton(
- :class="['_text-center _blue2 _ml-big', { _inline: $store.state.ui.pc }]"
- :title="$t('wallets.form.save')"
- @onClick="handleSubmit()"
- )
+ template(v-else)
+ .grow
+ div {{ currency }}
+
+ //- Colors
+ //---------------------------------
+ template(v-if="activeTab === 'colors'")
+ .form
+ .subTitle {{ $t('popularColors') }}
+ .colors
+ .iconItem(
+ v-for="(color, idx) in popularColors"
+ :key="idx"
+ :class="{ _active: color === wallet.color }"
+ :style="{ background: color === wallet.color ? color : 'transparent' }"
+ @click="onSelectColor(color)"
+ )
+ template(v-if="color")
+ template(v-if="findWalletWithThisColor(color)")
+ Icon(
+ icon="mdi mdi-credit-card-multiple"
+ :color="color === wallet.color ? null : color"
+ big
+ )
+ template(v-else-if="color === wallet.color")
+ Icon(
+ icon="mdi mdi-credit-card-multiple"
+ background="transparent"
+ big
+ )
+ template(v-else)
+ .colorPreview(:style="{ background: color }")
+
+ .subTitle {{ $t('palette') }}
+ .colors
+ .iconItem(
+ v-for="(color, idx) in allColors"
+ :key="idx"
+ :class="{ _active: color === wallet.color, _empty: !color }"
+ :style="{ background: color === wallet.color ? color : 'transparent' }"
+ @click="onSelectColor(color)"
+ )
+
+ template(v-if="color")
+ template(v-if="findWalletWithThisColor(color)")
+ Icon(
+ icon="mdi mdi-credit-card-multiple"
+ :color="color === wallet.color ? null : color"
+ big
+ )
+ template(v-else-if="color === wallet.color")
+ Icon(
+ icon="mdi mdi-credit-card-multiple"
+ background="transparent"
+ big
+ )
+ template(v-else)
+ .colorPreview(:style="{ background: color }")
+
+ .subTitle {{ $t('categories.form.colors.custom') }}
+ .customColor
+ input.customColor__value(v-model="wallet.color" type="color")
+
+ .pt-4.pb-6
+ SharedButton(
+ :class="['_text-center _blue2 _ml-big', { _inline: $store.state.ui.pc }]"
+ :title="$t('wallets.form.save')"
+ @onClick="handleSubmit()"
+ )
</template>
<style lang="stylus" scoped>
diff --git a/components/wallets/pages/id/Index.vue b/components/wallets/page/id/Index.vue
similarity index 55%
rename from components/wallets/pages/id/Index.vue
rename to components/wallets/page/id/Index.vue
index 19a48e4d..2833b10d 100644
--- a/components/wallets/pages/id/Index.vue
+++ b/components/wallets/page/id/Index.vue
@@ -75,63 +75,66 @@ export default defineComponent({
</script>
<template lang="pug">
-.relative.h-full.overflow-y-auto(v-if="wallet")
- router-link(
- v-slot='{ href, navigate }'
- to='/wallets'
- custom
- )
- .flex.items-start
- a.grow.cursor-pointer.block.py-5.mb-3.px-3.font-nunito.hocus_bg-gray-100.dark_hocus_bg-neutral-800(
- :href='href'
- @click='navigate'
- )
- .pb-2.text-xs.font-medium(class="text-white/50") {{ $t('wallets.title') }}
-
- .flex.items-center.gap-3.pb-3
- .text-neutral-800.dark_text-white.text-2xl.leading-none.font-semibold {{ wallet.name }}
- .p-1.px-1.rounded.flex-center.text-2xs.text-neutral-50(
- :style="{ background: wallet.color }"
- ) {{ wallet.currency }}
-
- .flex
- Amount(
- :currency="wallet.currency"
- :value="total"
- showBase
- size="lg"
- vertical="right"
- )
-
- .mdi.mdi-pencil-outline.cursor-pointer.rounded-full.mt-3.mr-2.w-16.h-16.flex-center.text-2xl.p-4.hocus_bg-gray-100.dark_hocus_bg-neutral-800(
- @click="handleEditClick"
- )
-
- .pb-6
- .px-3.flex
- .cursor-pointer.p-1.px-3.flex.items-center.gap-3.bg-gray-50.dark_bg-dark4.rounded-md.hocus_bg-gray-100.dark_hocus_bg-neutral-800.shadow.hocus_shadow-lg(
- class="dark_text-white/60"
- @click="handleSetFilterWallet"
- )
- .mdi.mdi-poll.text-xl
- .text-xs.leading-none {{ $t('statBy') }}: {{ wallet.name }}
- .mdi.mdi-chevron-right.opacity-70.text-lg.leading-none
-
- //- Stat
- .overflow-hidden.relative.bg-white.dark_bg-custom4.mx-3.mb-12.p-3.rounded-md
- SharedDate.text-xs.font-medium(class="-mb-1 text-white/50")
- div(class="-mb-3")
- StatGroupSum2(
- :trnsIds="filteredTrnsIds"
- )
-
- //- History
- .px-3
- TrnsHistory(
- :trnsIds="trnsIds"
- :trnType="filter.trnType"
- @setFilterTrnType="value => filter.trnType = value"
+.h-full.overflow.overflow-x-auto.max-w-3xl.h-full(
+ class="pb-[44px] md_pb-[52px] lg_pb-0"
+)
+ template(v-if="wallet")
+ router-link(
+ v-slot='{ href, navigate }'
+ to='/wallets'
+ custom
)
+ .flex.items-start
+ a.grow.cursor-pointer.block.py-5.mb-3.px-3.font-nunito.hocus_bg-gray-100.dark_hocus_bg-neutral-800(
+ :href='href'
+ @click='navigate'
+ )
+ .pb-2.text-xs.font-medium(class="text-white/50") {{ $t('wallets.title') }}
+
+ .flex.items-center.gap-3.pb-3
+ .text-neutral-800.dark_text-white.text-2xl.leading-none.font-semibold {{ wallet.name }}
+ .p-1.px-1.rounded.flex-center.text-2xs.text-neutral-50(
+ :style="{ background: wallet.color }"
+ ) {{ wallet.currency }}
+
+ .flex
+ Amount(
+ :currency="wallet.currency"
+ :value="total"
+ showBase
+ size="lg"
+ vertical="right"
+ )
+
+ .mdi.mdi-pencil-outline.cursor-pointer.rounded-full.mt-3.mr-2.w-16.h-16.flex-center.text-2xl.p-4.hocus_bg-gray-100.dark_hocus_bg-neutral-800(
+ @click="handleEditClick"
+ )
+
+ .pb-6
+ .px-3.flex
+ .cursor-pointer.p-1.px-3.flex.items-center.gap-3.bg-gray-50.dark_bg-dark4.rounded-md.hocus_bg-gray-100.dark_hocus_bg-neutral-800.shadow.hocus_shadow-lg(
+ class="dark_text-white/60"
+ @click="handleSetFilterWallet"
+ )
+ .mdi.mdi-poll.text-xl
+ .text-xs.leading-none {{ $t('statBy') }}: {{ wallet.name }}
+ .mdi.mdi-chevron-right.opacity-70.text-lg.leading-none
+
+ //- Stat
+ .overflow-hidden.relative.bg-white.dark_bg-custom4.mx-3.mb-12.p-3.rounded-md
+ SharedDate.text-xs.font-medium(class="-mb-1 text-white/50")
+ div(class="-mb-3")
+ StatGroupSum2(
+ :trnsIds="filteredTrnsIds"
+ )
+
+ //- History
+ .px-3
+ TrnsHistory(
+ :trnsIds="trnsIds"
+ :trnType="filter.trnType"
+ @setFilterTrnType="value => filter.trnType = value"
+ )
//- Delete?
ModalBottomConfirm(
diff --git a/components/wallets/total/WalletsTotalAlt.vue b/components/wallets/total/WalletsTotalAlt.vue
index 78585e98..98736db3 100644
--- a/components/wallets/total/WalletsTotalAlt.vue
+++ b/components/wallets/total/WalletsTotalAlt.vue
@@ -49,71 +49,49 @@ export default {
</script>
<template lang="pug">
-.walletsTotal(
+.grid.gap-y-1.gap-x-2.2sm_grid-cols-2.md_gap-x-6(
v-if="$store.getters['wallets/hasWallets']"
)
//- Credits
- .walletsTotal__item(v-if="isShowCredits && totalInWallets.credits !== 0")
- .walletsTotal__title {{ $t('credits') }}
- .walletsTotal__value
- Amount(
- :currency="$store.state.currencies.base"
- :value="totalInWallets.credits"
- size="lg"
- vertical="center"
- )
+ .flex.items-center.bg.py-2.px-3.rounded-md(v-if="isShowCredits && totalInWallets.credits !== 0")
+ .grow.text-sm.leading-none {{ $t('credits') }}
+ Amount(
+ :currency="$store.state.currencies.base"
+ :value="totalInWallets.credits"
+ vertical="right"
+ )
//- Savings
- .walletsTotal__item(v-if="totalInWallets.savings !== 0 && isShowSavings")
- .walletsTotal__title {{ $t('savings') }}
- .walletsTotal__value
- Amount(
- :currency="$store.state.currencies.base"
- :value="totalInWallets.savings"
- size="lg"
- vertical="center"
- )
+ .flex.items-center.bg.py-2.px-3.rounded-md(v-if="totalInWallets.savings !== 0 && isShowSavings")
+ .grow.text-sm.leading-none {{ $t('savings') }}
+ Amount(
+ :currency="$store.state.currencies.base"
+ :value="totalInWallets.savings"
+ vertical="right"
+ )
//- Total
- .walletsTotal__item
- .walletsTotal__title {{ $t('total') }}
- .walletsTotal__value
- Amount(
- :currency="$store.state.currencies.base"
- :value="totalInWallets.counted + totalInWallets.savings - Math.abs(totalInWallets.credits)"
- size="lg"
- vertical="center"
- )
+ .flex.items-center.bg.py-2.px-3.rounded-md
+ .grow.text-sm.leading-none {{ $t('total') }}
+ Amount(
+ :currency="$store.state.currencies.base"
+ :value="totalInWallets.counted + totalInWallets.savings - Math.abs(totalInWallets.credits)"
+ vertical="right"
+ )
//- Avaliable
- .walletsTotal__item(v-if="totalInWallets.counted !== totalInWallets.counted + totalInWallets.savings - Math.abs(totalInWallets.credits)")
- .walletsTotal__title {{ $t('avaliable') }}
- .walletsTotal__value
- Amount(
- :currency="$store.state.currencies.base"
- :value="totalInWallets.counted"
- size="lg"
- vertical="center"
- )
+ .flex.items-center.bg.py-2.px-3.rounded-md(v-if="totalInWallets.counted !== totalInWallets.counted + totalInWallets.savings - Math.abs(totalInWallets.credits)")
+ .grow.text-sm.leading-none {{ $t('avaliable') }}
+ Amount(
+ :currency="$store.state.currencies.base"
+ :value="totalInWallets.counted"
+ vertical="right"
+ )
</template>
<style lang="stylus" scoped>
-.walletsTotal
- display flex
- flex-wrap wrap
- align-items center
- gap $m8
-
- &__item
- flex 0 0 0
- align-self start
- justify-self start
-
- &__title
- opacity .6
- padding-right 0
- padding-bottom 6px
- font-size 12px
+.bg
+ background var(--c-item-bg-main)
</style>
<i18n lang="json5">
diff --git a/layouts/default.vue b/layouts/default.vue
index 3c47fec6..41795ab9 100644
--- a/layouts/default.vue
+++ b/layouts/default.vue
@@ -53,7 +53,7 @@ onMounted(() => {
</script>
<template lang="pug">
-.overflow-hidden.relative.h-full.min-w-base.font-roboto.text-slate-500.dark_text-gray-400.leading-none.antialiased.bg-white.dark_bg-dark3.max-w-7xl(
+.overflow-hidden.relative.h-full.min-w-base.font-roboto.text-slate-500.dark_text-gray-400.leading-none.antialiased.bg-white.dark_bg-dark3(
:class="touchClassNames"
)
LayoutModals
@@ -63,26 +63,56 @@ onMounted(() => {
name="modal"
)
- LazyAppUpdateAppModal(
- v-if="isShowUpdateApp"
- @onClose="isShowUpdateApp = false"
- )
+ //- LazyAppUpdateAppModal(
+ //- v-if="isShowUpdateApp"
+ //- @onClose="isShowUpdateApp = false"
+ //- )
.h-full.grid(
- class="grid-rows-[1fr_auto] xl_grid-cols-[auto_1fr]"
+ class="lg_grid-cols-[auto_1fr]"
)
- .hidden.xl_block
+ .hidden.lg_block
LayoutSidebar
- .overflow-hidden.h-full.xl_px-8.grid
+ .overflow-hidden.h-full.lg_px-8.grid
Nuxt(keep-alive :keep-alive-props="{ include: keepAliveInclude }")
+ .absolute.right-0.bottom-0.w-full
+
+ .hidden.createTrn.absolute.right-6.bottom-6.lg_flex(
+ @click="$store.dispatch('trnForm/openTrnForm', { action: 'create' })"
+ )
+ .btn: .mdi.mdi-plus
- .xl_hidden
- LayoutBottomMenu
+ .z-10.absolute.bottom-0.left-0.w-full.backdrop-blur.lg_hidden(
+ class="bg-white/70 dark_bg-dark3/70"
+ )
+ LayoutMenuBottom
</template>
<style lang="stylus">
@import '~assets/stylus/index'
@import '~assets/stylus/colors-dark'
@import '~assets/stylus/colors-light'
+
+.createTrn
+ cursor pointer
+ align-items flex-end
+ justify-content center
+ anim()
+
+ +media-hover()
+ .btn
+ transform scale(1.3)
+
+ .btn
+ display flex
+ align-items center
+ justify-content center
+ width 48px
+ height 48px
+ color var(--c-font-1)
+ font-size 32px
+ background var(--c-blue-1)
+ border-radius 50%
+ anim()
</style>
diff --git a/layouts/welcome.vue b/layouts/welcome.vue
index 12a9eea2..e94c7f68 100644
--- a/layouts/welcome.vue
+++ b/layouts/welcome.vue
@@ -63,10 +63,10 @@ onMounted(() => {
name="modal"
)
- LazyAppUpdateAppModal(
- v-if="isShowUpdateApp"
- @onClose="isShowUpdateApp = false"
- )
+ //- LazyAppUpdateAppModal(
+ //- v-if="isShowUpdateApp"
+ //- @onClose="isShowUpdateApp = false"
+ //- )
.layout__wrap.overflow-hidden.flex-grow.h-full.flex
transition(name="fadeIn" appear)
diff --git a/modules/menu/useMenuData.ts b/modules/menu/useMenuData.ts
index 4f9346d6..7057e3b4 100644
--- a/modules/menu/useMenuData.ts
+++ b/modules/menu/useMenuData.ts
@@ -15,15 +15,15 @@ export default function useMenuData() {
name: i18n.t('createTrn'),
},
index: {
- icon: 'mdi mdi-poll',
+ component: 'UiIconStat',
name: i18n.t('stat.title'),
},
wallets: {
- icon: 'mdi mdi-credit-card-multiple',
+ component: 'UiIconWallet',
name: i18n.t('wallets.name'),
},
categories: {
- icon: 'mdi mdi-folder-star',
+ component: 'UiIconCategory',
name: i18n.t('categories.name'),
},
history: {
@@ -42,6 +42,7 @@ export default function useMenuData() {
}))
function onClick(menuId: string) {
+ console.log(menuId)
menuId === 'trnForm'
? $store.dispatch('trnForm/openTrnForm', { action: 'create' })
: router.push(`/${menuId}`)
diff --git a/package.json b/package.json
index 3d21d218..c59ccfb9 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "finapp",
- "version": "3.5.1",
+ "version": "3.5.2",
"scripts": {
"dev": "cross-env NUXT_HOST=0.0.0.0 PORT=3010 nuxi dev",
"build": "nuxi generate",
diff --git a/pages/categories/_id/edit.vue b/pages/categories/_id/edit.vue
index ab5c9516..1d5fcb9b 100644
--- a/pages/categories/_id/edit.vue
+++ b/pages/categories/_id/edit.vue
@@ -1,3 +1,3 @@
<template lang="pug">
-CategoriesPagesIdEdit
+CategoriesPageIdEdit
</template>
diff --git a/pages/categories/_id/index.vue b/pages/categories/_id/index.vue
index 98cc70bc..153f618e 100644
--- a/pages/categories/_id/index.vue
+++ b/pages/categories/_id/index.vue
@@ -1,3 +1,3 @@
<template lang="pug">
-CategoriesPagesId
+CategoriesPageId
</template>
diff --git a/pages/categories/index.vue b/pages/categories/index.vue
index e0a52ca6..a4a2e1f3 100644
--- a/pages/categories/index.vue
+++ b/pages/categories/index.vue
@@ -1,57 +1,3 @@
-<script setup lang="ts">
-const { $store } = useNuxtApp()
-
-const catsIds = computed(() => $store.getters['categories/categoriesRootIds']?.sort((a, b) => {
- if ($store.state.categories.items[a].name < $store.state.categories.items[b].name) return -1
- if ($store.state.categories.items[a].name > $store.state.categories.items[b].name) return 1
- return 0
-}))
-</script>
-
-<script lang="ts">
-export default defineComponent({
- head() {
- return {
- title: this.$t('categories.title'),
- }
- },
-})
-</script>
-
<template lang="pug">
-.h-full.overflow.overflow-x-auto
- .py-6.px-3.font-nunito.text-neutral-800.dark_text-white.text-2xl.leading-none.font-semibold
- | {{ $t('categories.name') }}
-
- .max-w-3xl
- .pb-4
- CategoriesListSlot(
- :ids="catsIds"
- v-slot="{ categories }"
- )
- .shame1.px-3
- CategoriesItemCategoryItem(
- v-for="category in categories"
- :category="category"
- :slider="() => ({})"
- :id="category.id"
- :key="category.id"
- @onClick="id => $router.push(`/categories/${category.id}`)"
- )
-
- .pb-4.px-3.flex.gap-4.pt-4
- .button(@click="$store.dispatch('ui/setActiveTab', 'createCategory')") {{ $t('categories.new') }}
+CategoriesPageList
</template>
-
-<style lang="stylus" scoped>
-.shame1
- display grid
- grid-template-columns repeat(2, 1fr)
- grid-column-gap $m6
- grid-row-gap $m6
-
- +media(600px)
- grid-template-columns repeat(auto-fill, minmax(200px, 1fr))
- grid-column-gap $m6
- grid-row-gap $m6
-</style>
diff --git a/pages/wallets/_id/edit.vue b/pages/wallets/_id/edit.vue
index 1d002280..a50a0e1b 100644
--- a/pages/wallets/_id/edit.vue
+++ b/pages/wallets/_id/edit.vue
@@ -1,3 +1,3 @@
<template lang="pug">
-WalletsPagesIdEdit
+WalletsPageIdEdit
</template>
diff --git a/pages/wallets/_id/index.vue b/pages/wallets/_id/index.vue
index d8c80ded..83692e57 100644
--- a/pages/wallets/_id/index.vue
+++ b/pages/wallets/_id/index.vue
@@ -1,3 +1,3 @@
<template lang="pug">
-WalletsPagesId
+WalletsPageId
</template>
diff --git a/pages/wallets/index.vue b/pages/wallets/index.vue
index 94360850..758e5367 100644
--- a/pages/wallets/index.vue
+++ b/pages/wallets/index.vue
@@ -1,3 +1,3 @@
<template lang="pug">
-WalletsPagesList
+WalletsPageList
</template>
diff --git a/tailwind.config.js b/tailwind.config.js
index 0d09e176..98467597 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -40,6 +40,9 @@ module.exports = {
minWidth: {
base: '320px',
},
+ screens: {
+ '2sm': '400px',
+ },
},
},