Skip to content

Open source personal finance application

update 3.11.0

ilkome239e47669a0f
diff --git a/components/app/UpdateAppModal.vue b/components/app/UpdateAppModal.vue
index 513987b2..d50ded52 100644
--- a/components/app/UpdateAppModal.vue
+++ b/components/app/UpdateAppModal.vue
@@ -9,17 +9,19 @@ ModalBottom(
@onClose="$emit('onClose')"
@afterClose="$emit('afterClose')"
)
- //- template(slot="header")
- h3 {{ $t('app.update.title') }}
- p {{ $t('app.update.text') }}
+ .ta_center
+ //- template(slot="header")
+ h3 {{ $t('app.update.title') }}
+ p {{ $t('app.update.text') }}
- SharedButton(
- className="_blue _text-center"
- :title="$t('base.ok')"
- @onClick="$emit('onClose')"
- )
+ SharedButton(
+ className="_blue2 _text-center"
+ :title="$t('base.ok')"
+ @onClick="$emit('onClose')"
+ )
</template>
<style lang="stylus" scoped>
-//
+.ta_center
+ text-align center
</style>
diff --git a/components/base/modal/useTouchClose.ts b/components/base/modal/useTouchClose.ts
index 318b5a25..ef54c707 100644
--- a/components/base/modal/useTouchClose.ts
+++ b/components/base/modal/useTouchClose.ts
@@ -9,6 +9,7 @@ export default function useOnTouch () {
let config = {
dragOffset: 16,
whaitForScrollClassName: 'waitForScroll',
+ whaitForScrollSliderClassName: 'waitForScrollSlider',
doNotTouchClassName: 'doNotCloseModal',
animClassName: '_anim'
}
@@ -103,11 +104,14 @@ export default function useOnTouch () {
// wait until content scroll up inside
const waitForScroll = content.value.querySelector(`.${config.whaitForScrollClassName}`)
- if (waitForScroll && waitForScroll.scrollTop > 0) { return }
+ console.log('waitForScroll', waitForScroll)
// wait until content scroll up inside Swiper
const waitForScrollSlider = content.value.querySelector(`.swiper-slide-active .${config.whaitForScrollClassName}`)
if (waitForScrollSlider && waitForScrollSlider.scrollTop > 0) { return }
+
+ const waitForScrollSlider2 = content.value.querySelector(`.swiper-slide-active .${config.whaitForScrollSliderClassName}`)
+ if (waitForScrollSlider2 && waitForScrollSlider2.scrollTop > 0) { return }
}
}
diff --git a/components/chart/MobileStatLines.vue b/components/chart/MobileStatLines.vue
index cf8e5f4f..3ed5bf8f 100644
--- a/components/chart/MobileStatLines.vue
+++ b/components/chart/MobileStatLines.vue
@@ -22,15 +22,14 @@ export default {
<template lang="pug">
.chart
- .chart__name
- ChartPeriods
-
.chart__content
StatChartLines(
:isShowIncomes="activeTabStat === 'incomes' || activeTabStat === 'details' || activeTabStat === 'history'"
:isShowExpenses="activeTabStat === 'expenses' || activeTabStat === 'details' || activeTabStat === 'history'"
:chartType="periods[filterPeriod].grouped ? 'column' : 'spline'"
)
+
+ ChartPeriods
</template>
<style lang="stylus" scoped>
@@ -38,6 +37,6 @@ export default {
.chart
&__content
- height 220px
- padding 10px 0 0 4px
+ height 190px
+ padding 0 0 0 4px
</style>
diff --git a/components/layout/mobile/StatMenu.vue b/components/layout/mobile/StatMenu.vue
index e2fb60e4..5d93cf33 100644
--- a/components/layout/mobile/StatMenu.vue
+++ b/components/layout/mobile/StatMenu.vue
@@ -64,7 +64,7 @@ export default {
.menuItem
cursor pointer
flex-grow 1
- padding $m6 $m5
+ padding $m6 $m8
color var(--c-font-5)
font-size 12px
font-weight 500
diff --git a/components/layout/useUIView.ts b/components/layout/useUIView.ts
index 4b5c206f..a51e295d 100644
--- a/components/layout/useUIView.ts
+++ b/components/layout/useUIView.ts
@@ -5,7 +5,7 @@ const localName = 'finapp.ui'
const ui = reactive({
showMainChart: true,
- showPieChart: true,
+ showPieChart: false,
showCatsVerticalChart: true,
showRoundCats: true,
showCatsHorizontalList: true,
diff --git a/components/shared/button/Button.vue b/components/shared/button/Button.vue
index 4c04d257..5162fdf4 100644
--- a/components/shared/button/Button.vue
+++ b/components/shared/button/Button.vue
@@ -117,6 +117,9 @@ export default {
&:active
background var(--c-bg-3)
+ &._ttu
+ text-transform uppercase
+
&._borderBottom
width 100%
margin-bottom 0
@@ -226,6 +229,9 @@ export default {
border-radius 36px
anim()
+ +media-hover()
+ background var(--c-blue-1)
+
&._size_lg
padding 16px
font-size 16px
diff --git a/components/stat/Mobile.vue b/components/stat/Mobile.vue
index 8d8089c1..1225d359 100644
--- a/components/stat/Mobile.vue
+++ b/components/stat/Mobile.vue
@@ -70,13 +70,6 @@ export default {
LazyFilterRow(v-if="isShowFilter")
template(v-if="activeTabStat !== 'history'")
- .baseBox._noBd
- .boxFlew2(:class="{ _double: statAverage.incomes !== 0 && statAverage.expenses !== 0 }")
- .boxFlew2Item(v-if="statAverage.incomes !== 0")
- StatCatsPeriodCatsChartMobile(type="incomes")
- .boxFlew2Item(v-if="statAverage.expenses !== 0")
- StatCatsPeriodCatsChartMobile(type="expenses")
-
//- Loop throw incomes / expenses
template(
v-for="item in moneyTypes"
diff --git a/components/stat/StatChartLines.vue b/components/stat/StatChartLines.vue
index 30f12488..757268b8 100644
--- a/components/stat/StatChartLines.vue
+++ b/components/stat/StatChartLines.vue
@@ -195,7 +195,7 @@ export default {
chart: {
...chartOptions.chart,
- height: '200',
+ height: '180',
events: {
click (e) {
diff --git a/components/stat/chart/ChartItem.vue b/components/stat/chart/ChartItem.vue
deleted file mode 100644
index 0b695de0..00000000
--- a/components/stat/chart/ChartItem.vue
+++ /dev/null
@@ -1,206 +0,0 @@
-<script>
-export default {
- name: 'ChartItem',
-
- props: {
- period: {
- type: Object,
- required: true
- },
- maxAmountValue: {
- type: Number,
- required: true
- },
- parentClassName: {
- type: String,
- required: true
- }
- },
-
- data () {
- return {
- activeChartLeftOffset: null,
- hoverChart: null
- }
- },
-
- computed: {
- className () {
- const filterDate = this.$store.state.filter.date
- const filterPeriod = this.$store.state.filter.period
- const currentPeriodDate = this.period.date
- const hasTrns = this.period.expenses > 0 || this.period.incomes > 0
-
- return {
- _active: this.$day(parseInt(currentPeriodDate)).isSame(filterDate, filterPeriod),
- [`_${filterPeriod}`]: true,
- _grouped: this.$store.state.chart.periods[filterPeriod].grouped,
- _empty: !hasTrns && this.$store.state.chart.periods[filterPeriod].hideEmpty
- }
- },
- formatedPeriodName () {
- const dateValueOf = parseInt(this.period.date)
- const filterPeriod = this.$store.state.filter.period
- let formatedDate
-
- switch (filterPeriod) {
- case 'day':
- formatedDate = this.$day(dateValueOf).format('D')
- if (!this.$store.state.chart.periods[filterPeriod].grouped) {
- this.$day().isSame(dateValueOf, 'year')
- ? formatedDate = this.$day(dateValueOf).format('D.MM')
- : formatedDate = this.$day(dateValueOf).format('D.MM.YY')
- }
- return formatedDate
-
- case 'week':
- return this.$day(parseInt(dateValueOf)).week()
-
- case 'month':
- formatedDate = this.$day(dateValueOf).format('MMM')
- if (!this.$store.state.chart.periods[filterPeriod].grouped) {
- this.$day().isSame(dateValueOf, 'year')
- ? formatedDate = this.$day(dateValueOf).format('MMM')
- : formatedDate = this.$day(dateValueOf).format('MMM YY')
- }
- return formatedDate
-
- case 'year':
- return this.$day(dateValueOf).format('YYYY')
- }
- },
- periods () {
- return this.$store.state.chart.periods
- }
- },
-
- methods: {
- getStyle (amount) {
- return {
- height: `${Math.abs(amount) / Math.abs(this.maxAmountValue) * 100}%`
- }
- },
- handlePerioSelect () {
- this.$store.dispatch('filter/setDate', parseInt(this.period.date))
- },
- onMouseEnterChartItem (event) {
- const filterPeriod = this.$store.state.filter.period
- const isPeriodGrouped = this.$store.state.chart.periods[filterPeriod].grouped
- const values = this.period
- const parent = document.querySelector(this.parentClassName)
- const parentScrollLeft = parent.scrollLeft
- const targetOffset = event.target.offsetLeft
- const targetWidth = event.target.clientWidth
- const parentOffset = event.target.parentNode.parentNode.offsetLeft
- let offset
- isPeriodGrouped
- ? offset = `${targetOffset + (targetWidth / 2) + parentOffset - parentScrollLeft}px`
- : offset = `${targetOffset + (targetWidth / 2) - parentScrollLeft}px`
- this.$store.commit('chart/setHoveredPeriodValues', { values, offset })
- }
- }
-}
-</script>
-
-<template lang="pug">
-.chartItem(
- :class="className"
- @click="handlePerioSelect"
- @mouseenter="onMouseEnterChartItem"
- @mouseleave="$store.commit('chart/clearHoveredPeriodValues')")
- .chartItem__graph
- .chartItem__graph-box(v-if="period.expenses <= 0 && period.incomes <= 0")
- .chartItem__graph-line._empty
- .chartItem__graph-box(v-if="period.incomes > 0")
- .chartItem__graph-line._incomes(:style="getStyle(period.incomes)")
- .chartItem__graph-box(v-if="period.expenses > 0")
- .chartItem__graph-line._expenses(:style="getStyle(period.expenses)")
- .chartItem__name {{ formatedPeriodName }}
-</template>
-
-<style lang="stylus" scoped>
-@import "~assets/stylus/variables/margins"
-@import "~assets/stylus/variables/fonts"
-@import "~assets/stylus/variables/media"
-@import "~assets/stylus/variables/scroll"
-
-.chartItem
- cursor pointer
- min-width 30px
- padding $m5 $m5
- padding-top $m6
- flex-grow 1
- border-radius $m6
-
- &._empty
- display none
-
- &._week
- padding-right $m4
- padding-left $m4
-
- &._month
- padding-right $m4
- padding-left $m4
-
- &._year
- padding-right $m4
- padding-left $m4
-
- &._grouped._day
- padding-right 2px
- padding-left 2px
-
- &._grouped._week
- &._grouped._month
- padding-right 2px
- padding-left 2px
-
- &:hover
- background var(--c-bg-3)
-
- &._active
- color var(--c-font-2)
- background var(--c-bg-5)
-
- &__name
- padding-top 4px
- text-align center
- typo-small-upper(10px)
- white-space nowrap
-
- &__graph
- display flex
- justify-content center
-
- &-box
- display flex
- flex-flow column
- justify-content flex-end
- height 78px
-
- +media-ipad()
- height 98px
-
- ^[0]._grouped &
- height 58px
-
- +media-ipad()
- height 78px
-
- &-line
- width 6px
- min-height 1px
- margin 0 1px
- border-radius 6px
-
- &._expenses
- background var(--c-expenses-1)
-
- &._incomes
- background var(--c-incomes-1)
-
- &._empty
- width 2px
- background grey
-</style>
diff --git a/components/stat/chartOptions.js b/components/stat/chartOptions.js
index d19d187e..9484be77 100644
--- a/components/stat/chartOptions.js
+++ b/components/stat/chartOptions.js
@@ -123,6 +123,7 @@ export default {
},
yAxis: {
+ endOnTick: false,
cursor: 'pointer',
alternateGridColor: '',
gridLineColor: 'var(--c-bg-5)',
diff --git a/components/trnForm/TrnForm.vue b/components/trnForm/TrnForm.vue
index 8ae57e01..a4ebb58c 100644
--- a/components/trnForm/TrnForm.vue
+++ b/components/trnForm/TrnForm.vue
@@ -1,5 +1,6 @@
<script lang="ts">
-import Swiper from 'swiper'
+import dayjs from 'dayjs'
+import Swiper, { Pagination } from 'swiper'
import 'swiper/swiper-bundle.css'
import { ref, computed, watch, reactive, toRefs, useContext } from '@nuxtjs/composition-api'
import generateId from '~/utils/id'
@@ -9,6 +10,8 @@ import useCalculator from '~/components/trnForm/calculator/useCalculator'
import useTrnFormValidate from '~/components/trnForm/useTrnFormValidate'
import { successEmo, random } from '~/assets/js/emo'
+Swiper.use([Pagination])
+
export default {
name: 'TrnForm',
@@ -22,9 +25,11 @@ export default {
setup (props: any) {
const { store } = useContext()
- const { isShow } = toRefs(props)
const { initTouchModal, closeModal } = useTouchClose()
+ /**
+ * Wrappers
+ */
const wrappers = reactive({
container: ref(null),
content: ref(null),
@@ -36,48 +41,60 @@ export default {
}
})
+ /**
+ * Slider
+ */
const slider = ref<any>(null)
- const getHeight = ref<any>(null)
const sliderObj = ref<any>(null)
const { clearExpression } = useCalculator()
+ const maxHeight = ref('550px')
+
function setTrnFormHeight () {
- const trnFormHeight = store.state.trnForm.height
- const height = getHeight.value.clientHeight + 8
- const trnFormHeaderHeight = 0
- const newTrnFormHeight = height - trnFormHeaderHeight
+ const el = document.querySelector('.getHeight')
+ const height = el.clientHeight
- if (trnFormHeight !== newTrnFormHeight) {
- store.commit('trnForm/setTrnFormHeight', newTrnFormHeight)
- }
+ store.commit('trnForm/setTrnFormHeight', height)
+ maxHeight.value = `${height}px`
+
+ const observer = new ResizeObserver((entries) => {
+ for (const entry of entries) {
+ const height = entry.contentRect.height
+ store.commit('trnForm/setTrnFormHeight', height)
+ maxHeight.value = `${height}px`
+ }
+ })
+ observer.observe(el)
}
/**
- * Watch isShow
+ * isShow
*/
+ const { isShow } = toRefs(props)
watch(isShow, (value) => {
if (value) {
setTimeout(() => {
- initTouchModal({
- ...toRefs(wrappers),
- onClose: () => store.dispatch('trnForm/closeTrnForm')
- })
-
- setTrnFormHeight()
- if (sliderObj.value) {
- sliderObj.value.update()
- sliderObj.value.slideTo(1, 0)
- }
- else {
+ if (!sliderObj.value) {
+ initTouchModal({
+ ...toRefs(wrappers),
+ onClose: () => store.dispatch('trnForm/closeTrnForm')
+ })
sliderObj.value = new Swiper(slider.value, {
+ observer: true,
+ observeParents: true,
slidesPerView: 1,
autoHeight: true,
initialSlide: 1,
noSwipingClass: 'trnFormNoSwiping',
shortSwipes: false,
longSwipesRatio: 0.1,
- longSwipesMs: 60
+ longSwipesMs: 60,
+ pagination: {
+ el: '.trnForm__pagination',
+ clickable: true
+ }
})
+ setTrnFormHeight()
}
}, 10)
}
@@ -87,142 +104,125 @@ export default {
}, { immediate: true })
/**
- * Watch amountType
+ * Amounts
*/
const amountType = computed(() => store.state.trnForm.values.amountType)
- watch(amountType, () => {
- setTimeout(() => {
- setTrnFormHeight()
- sliderObj.value.update()
- }, 10)
- })
+ const isTransfer = computed(() => store.state.trnForm.values.amountType === 2)
+ /**
+ * Click on category
+ */
function onCategoryClick (categoryId) {
store.commit('trnForm/setTrnFormValues', { categoryId })
}
+ /**
+ * Click on wallet
+ */
function onClickWallet (walletId) {
store.commit('trnForm/setTrnFormValues', { walletId })
}
- return {
- ...toRefs(wrappers),
- closeModal,
-
- sliderObj,
- slider,
- getHeight,
-
- amountType,
+ /**
+ * Prepare values
+ */
+ function prepeareValues (): any {
+ let normalizedValues
- onCategoryClick,
- onClickWallet
- }
- },
+ const id = store.state.trnForm.values.trnId || generateId(dayjs().valueOf())
+ const { getResult } = useCalculator()
- computed: {
- show (): any {
- return this.$store.state.trnForm.show
- },
+ // Simple
+ if (!isTransfer.value) {
+ normalizedValues = {
+ amount: getResult.value,
+ amountFrom: getResult.value,
+ amountTo: getResult.value,
+ categoryId: store.state.trnForm.values.categoryId,
+ date: dayjs(store.state.trnForm.values.date).valueOf(),
+ description: store.state.trnForm.values.description || null,
+ groups: store.state.trnForm.values.groups || null,
+ type: Number(store.state.trnForm.values.amountType) || 0,
+ walletId: store.state.trnForm.values.walletId
+ }
+ }
- isTransfer (): any {
- return this.$store.state.trnForm.values.amountType === 2
- },
+ // Transfer
+ if (isTransfer.value) {
+ normalizedValues = {
+ amount: getResult.value,
+ amountFrom: getResult.value,
+ amountTo: getResult.value,
+ categoryId: 'transfer',
+ date: dayjs(store.state.trnForm.values.date).valueOf(),
+ walletId: store.state.trnForm.values.walletFromId,
+ walletFromId: store.state.trnForm.values.walletFromId,
+ walletToId: store.state.trnForm.values.walletToId,
+ type: 2,
+ description: store.state.trnForm.values.description || null,
+ groups: store.state.trnForm.values.groups || null
+ }
+ }
- isShowFirstWallets (): any {
- if (this.$store.getters['wallets/walletsSortedIds'].length >= 3) { return true }
- return false
+ return {
+ id,
+ values: normalizedValues
+ }
}
- },
- methods: {
- handleSubmitForm () {
+ /**
+ * Submit form
+ */
+ function handleSubmitForm () {
try {
const { validate } = useTrnFormValidate()
- const { id, values } = this.prepeareValues(this.isTransfer)
+ const { id, values } = prepeareValues()
const validateStatus = validate({
...values,
- walletFrom: this.$store.getters['wallets/getWalletWithId'](this.$store.state.trnForm.values.walletFromId),
- walletTo: this.$store.getters['wallets/getWalletWithId'](this.$store.state.trnForm.values.walletToId)
+ walletFrom: store.getters['wallets/getWalletWithId'](store.state.trnForm.values.walletFromId),
+ walletTo: store.getters['wallets/getWalletWithId'](store.state.trnForm.values.walletToId)
})
if (validateStatus.error) {
- this.$notify({
- type: 'error',
- title: validateStatus.error.title,
- text: validateStatus.error.text
- })
+ // this.$notify({
+ // type: 'error',
+ // title: validateStatus.error.title,
+ // text: validateStatus.error.text
+ // })
return
}
- this.$notify({
- type: 'success',
- text: 'Excellent transaction!',
- title: random(successEmo)
- })
+ // this.$notify({
+ // type: 'success',
+ // text: 'Excellent transaction!',
+ // title: random(successEmo)
+ // })
- this.$store.dispatch('trns/addTrn', { id, values })
+ store.dispatch('trns/addTrn', { id, values })
}
catch (e) {
console.log(e)
}
- },
-
- setTrnFormHeight () {
- const trnFormHeight = this.$store.state.trnForm.height
-
- const height = this.$refs.getHeight.clientHeight
- const trnFormHeaderHeight = 0
- const newTrnFormHeight = height - trnFormHeaderHeight - 10
+ }
- if (trnFormHeight !== newTrnFormHeight) {
- this.$store.commit('trnForm/setTrnFormHeight', newTrnFormHeight)
- }
- },
+ return {
+ closeModal,
- prepeareValues (isTransfer: boolean): any {
- let normalizedValues
+ ...toRefs(wrappers),
- const id = this.$store.state.trnForm.values.trnId || generateId(this.$day().valueOf())
- const { getResult } = useCalculator()
+ maxHeight,
+ slider,
+ sliderObj,
+ setTrnFormHeight,
- // Simple
- if (!isTransfer) {
- normalizedValues = {
- amount: getResult.value,
- amountFrom: getResult.value,
- amountTo: getResult.value,
- categoryId: this.$store.state.trnForm.values.categoryId,
- date: this.$day(this.$store.state.trnForm.values.date).valueOf(),
- description: this.$store.state.trnForm.values.description || null,
- groups: this.$store.state.trnForm.values.groups || null,
- type: Number(this.$store.state.trnForm.values.amountType) || 0,
- walletId: this.$store.state.trnForm.values.walletId
- }
- }
+ amountType,
+ isTransfer,
- // Transfer
- if (isTransfer) {
- normalizedValues = {
- amount: getResult.value,
- amountFrom: getResult.value,
- amountTo: getResult.value,
- categoryId: 'transfer',
- date: this.$day(this.$store.state.trnForm.values.date).valueOf(),
- walletId: this.$store.state.trnForm.values.walletFromId,
- walletFromId: this.$store.state.trnForm.values.walletFromId,
- walletToId: this.$store.state.trnForm.values.walletToId,
- type: 2,
- description: this.$store.state.trnForm.values.description || null,
- groups: this.$store.state.trnForm.values.groups || null
- }
- }
+ onCategoryClick,
+ onClickWallet,
- return {
- id,
- values: normalizedValues
- }
+ handleSubmitForm
}
}
}
@@ -246,39 +246,52 @@ export default {
transition(name="baseModalWrapAnim" appear)
.trnForm__wrap(
v-show="isShow"
- :style="{ maxHeight: `${$store.state.trnForm.height}px` }"
+ :style="{ maxHeight: maxHeight }"
ref="wrap"
)
.trnForm__handler(
- @click="closeModal"
ref="handler"
+ @click="closeModal"
)
+ .trnForm__closure(@click="closeModal")
+ svg(
+ viewBox='0 0 24 24'
+ fill='none'
+ stroke='#000'
+ stroke-linecap='round'
+ stroke-linejoin='round'
+ stroke-width='1.5'
+ )
+ path(d='M.75 23.249l22.5-22.5')
+ path(d='M23.25 23.249L.75.749')
//- Content
.trnForm__scroll(ref="content")
.trnForm__content
.swiper-container(ref="slider")
.swiper-wrapper
- .swiper-slide(:style="{ minHeight: `${$store.state.trnForm.height}px` }")
- div(style="padding: 10px 0 10px 0")
- WalletsList3(
- :activeItemId="$store.state.trnForm.values.walletId"
- :limit="4"
- :showBase="false"
- ui="widget"
- @onClick="onClickWallet"
- )
-
- div(style="padding: 0 0 10px 0")
- CategoriesView(
- :ids="$store.getters['categories/lastUsedCategoriesIdsByDate']"
- :activeItemId="$store.state.trnForm.values.categoryId"
- ui="_flat"
- :noPaddingBottom="true"
- @onClick="onCategoryClick"
- )
-
- .swiper-slide(ref="getHeight")
+ .swiper-slide(:style="{ height: maxHeight }")
+ .scroll.waitForScrollSlider
+ div(style="paddingBottom: 16px")
+ div(style="padding: 20px 0 10px 0")
+ WalletsList3(
+ :activeItemId="$store.state.trnForm.values.walletId"
+ :limit="4"
+ :showBase="false"
+ ui="widget"
+ @onClick="onClickWallet"
+ )
+
+ div(style="padding: 0 0 10px 0")
+ CategoriesView(
+ :ids="$store.getters['categories/lastUsedCategoriesIdsByDate']"
+ :activeItemId="$store.state.trnForm.values.categoryId"
+ ui="_flat"
+ :noPaddingBottom="true"
+ @onClick="onCategoryClick"
+ )
+
+ .swiper-slide.getHeight
.trnForm__title(v-if="$store.state.trnForm.values.trnId") {{ $t('trnForm.titleEditTrn') }}
.trnForm__title(v-if="!$store.state.trnForm.values.trnId") {{ $t('trnForm.titleCreateTrn') }}
@@ -293,42 +306,35 @@ export default {
@onSubmit="handleSubmitForm"
)
- template(v-if="$store.getters['categories/lastUsedCategoriesIdsByDate'] && $store.getters['categories/lastUsedCategoriesIdsByDate'].length")
- .trnFormNoSwiping2
- .trnForm__quickCats
- .formTitle {{ $t('categories.lastUsedTitle') }} {{ $t('categories.title') }}
- CategoriesView(
- :ids="$store.getters['categories/lastUsedCategoriesIdsByDate']"
- :noPaddingBottom="true"
- ui="_flat"
- @onClick="categoryId => $store.commit('trnForm/setTrnFormValues', { categoryId })"
- )
- template(v-else)
- .trnFormNoSwiping2(v-if="$store.getters['categories/quickSelectorCategoriesIds'].length")
- //- TrnFormCategories(:show="show")
- .trnForm__quickCats
- .formTitle {{ $t('categories.favoriteTitle') }}
- CategoriesView(
- :ids="$store.getters['categories/quickSelectorCategoriesIds']"
- :noPaddingBottom="true"
- ui="_flat"
- @onClick="categoryId => $store.commit('trnForm/setTrnFormValues', { categoryId })"
- )
+ .trnFormNoSwiping2(
+ v-if="$store.getters['categories/quickSelectorCategoriesIds'].length"
+ style="paddingBottom: 12px"
+ )
+ //- TrnFormCategories(:show="show")
+ .trnForm__quickCats
+ .formTitle {{ $t('categories.favoriteTitle') }}
+ CategoriesView(
+ :ids="$store.getters['categories/quickSelectorCategoriesIds']"
+ :noPaddingBottom="true"
+ ui="_flat"
+ @onClick="categoryId => $store.commit('trnForm/setTrnFormValues', { categoryId })"
+ )
//- Mobile
template(v-if="$store.state.ui.mobile")
+ TrnFormTypes
TrnFormAmount
TrnFormCalendar
TrnFormCalculator(@onSubmit="handleSubmitForm")
TrnFormHeader
- TrnFormHeaderTransfer(v-if="isTransfer")
+ TrnFormHeaderTransfer(v-show="isTransfer")
- .swiper-slide(:style="{ minHeight: `${$store.state.trnForm.height}px` }")
- div(v-if="sliderObj")
- TrnFormTrns(
- :slider="sliderObj"
- onlyList
- )
+ .swiper-slide(:style="{ height: maxHeight }")
+ TrnFormTrns(
+ v-if="sliderObj"
+ :slider="sliderObj"
+ )
+ .trnForm__pagination
//- Modals
TrnFormModalCats
@@ -341,10 +347,91 @@ export default {
TrnFormModalTrn
</template>
+<style lang="stylus">
+@import '~assets/stylus/variables'
+
+.trnForm
+ &__handler
+ z-index 2
+ position absolute
+ top 0
+ left 0
+ display flex
+ align-items center
+ justify-content center
+ width 100%
+ height 16px
+
+ &:after
+ content ''
+ display block
+ width 32px
+ height 4px
+ background var(--c-bg-8)
+ border-radius 4px
+
+ &__closure
+ z-index 3
+ cursor pointer
+ position absolute
+ top 4px
+ right 4px
+ display flex
+ align-items center
+ justify-content center
+ width 40px
+ height 40px
+ border-radius 50%
+ anim()
+
+ +media-hover()
+ background var(--c-blue-1)
+
+ svg
+ anim()
+ width 12px
+ height 12px
+ stroke var(--c-font-4)
+
+ +media-hover()
+ svg
+ width 18px
+ height 18px
+ stroke var(--c-font-1)
+
+ &__title
+ padding 0 $m8
+ padding-top $m9
+ padding-bottom $m7
+ color var(--c-font-3)
+ font-size 22px
+ font-weight 700
+ letter-spacing 1px
+ text-align center
+ fontFamilyNunito()
+
+ @media $media-laptop
+ padding-bottom $m7
+ border-radius 16px
+
+ &__pagination
+ .swiper-pagination-bullet
+ opacity 1
+ width 6px
+ height 6px
+ margin 0 4px
+ background var(--c-bg-9)
+ border-radius 50%
+ anim()
+
+ &-active
+ width 10px
+ background var(--c-bg-10)
+ border-radius 4px
+</style>
+
<style lang="stylus" scoped>
-@import '~assets/stylus/variables/animations'
-@import '~assets/stylus/variables/margins'
-@import '~assets/stylus/variables/media'
+@import '~assets/stylus/variables'
$transition-style = cubic-bezier(.17, .04, .03, 1)
@@ -376,6 +463,12 @@ $transition-style = cubic-bezier(.17, .04, .03, 1)
&-leave-to
opacity 1
+.scroll
+ overflow hidden
+ overflow-y auto
+ height 100%
+ scrollbar()
+
.trnForm
&__overflow
@media $media-phone
@@ -386,20 +479,6 @@ $transition-style = cubic-bezier(.17, .04, .03, 1)
height 100%
anim()
- &__title
- padding $m8
- padding-bottom 0
- color var(--c-font-3)
- font-size 16px
- font-weight 700
- letter-spacing .5px
- text-align center
- fontFamilyNunito()
-
- @media $media-laptop
- padding-bottom $m7
- border-radius 16px
-
&__quickCats
opacity .8
padding-bottom $m7
@@ -411,7 +490,6 @@ $transition-style = cubic-bezier(.17, .04, .03, 1)
overflow hidden
position relative
background var(--color-bg-canvas)
- border 1px solid var(--c-bg-1)
border-radius 16px 16px 0 0
box-shadow 0 0 10px 5px var(--c-bg-1)
@@ -419,30 +497,24 @@ $transition-style = cubic-bezier(.17, .04, .03, 1)
anim(200ms)
@media $media-laptop
+ border 1px solid var(--c-bg-1)
border-radius 16px
- &__content
- padding-top 8px
+ &__scroll
+ background var(--color-bg-canvas)
- &__handler
+ &__pagination
z-index 2
position absolute
- top 0
- left 0
+ left 50%
+ bottom 0
display flex
align-items center
justify-content center
- width 100%
- height 16px
-
- &:after
- content ''
- display block
- width 32px
- height 4px
- background var(--c-bg-8)
- border-radius 4px
-
- &__scroll
- background var(--color-bg-canvas)
+ width auto
+ padding $m5
+ background alpha(#171717, .9)
+ border-radius $m5
+ backdrop-filter blur(12px)
+ transform translateX(-50%)
</style>
diff --git a/components/trnForm/TrnFormAmount.vue b/components/trnForm/TrnFormAmount.vue
index 3f4b0685..76f5b9a7 100644
--- a/components/trnForm/TrnFormAmount.vue
+++ b/components/trnForm/TrnFormAmount.vue
@@ -30,12 +30,9 @@ export default {
break
case 1:
if (this.$store.getters['wallets/walletsSortedIds'].length > 1) {
- nextAmountType = 2
+ nextAmountType = 0
}
break
- case 2:
- nextAmountType = 0
- break
}
this.$store.commit('trnForm/setTrnFormValues', {
@@ -50,29 +47,18 @@ export default {
.trnFormAmount(:class="className")
.trnFormAmount__wrap(@click="handleChangeAmountType")
.trnFormAmount__in
- .trnFormAmount__icon
- .mdi.mdi-minus(v-if="amountType === 0")
- .mdi.mdi-plus(v-if="amountType === 1")
- .mdi.mdi-swap-horizontal(v-if="amountType === 2")
-
.trnFormAmount__content
- .trnFormAmount__type
- template(v-if="amountType === 0") {{ $t('money.expenses') }}
- template(v-if="amountType === 1") {{ $t('money.incomes') }}
- template(v-if="amountType === 2 && $store.getters['wallets/walletsSortedIds'].length > 1") {{ $t('money.transfer') }}
-
- .trnFormAmount__value {{ expression }}
.trnFormAmount__evaluation {{ isSum ? null : getResult }}
+ .trnFormAmount__value {{ expression }}
</template>
<style lang="stylus" scoped>
-@import '~assets/stylus/variables/fonts'
-@import '~assets/stylus/variables/margins'
-@import '~assets/stylus/variables/media'
+@import '~assets/stylus/variables'
.trnFormAmount
&__wrap
padding $m7 $m7
+ padding-top $m6
text-align right
^[0]._expenses &
@@ -83,18 +69,8 @@ export default {
&__in
display flex
- align-items center
justify-content center
- &__icon
- padding-right $m6
- font-size 32px
-
- &__type
- align-self center
- padding-bottom $m6
- color var(--c-font-3)
-
&__content
flex-grow 1
@@ -118,6 +94,6 @@ export default {
&__evaluation
opacity .8
- height 12px
+ height 14px
font-size 14px
</style>
diff --git a/components/trnForm/TrnFormAmountPc.vue b/components/trnForm/TrnFormAmountPc.vue
index 24296905..2ab9d794 100644
--- a/components/trnForm/TrnFormAmountPc.vue
+++ b/components/trnForm/TrnFormAmountPc.vue
@@ -20,14 +20,6 @@ export default {
_incomes: amountType.value === 1
}))
}
- },
-
- methods: {
- setAmountType (amountType) {
- this.$store.commit('trnForm/setTrnFormValues', {
- amountType
- })
- }
}
}
</script>
@@ -35,22 +27,7 @@ export default {
<template lang="pug">
.amountInputLaptop(:class="className")
.trnFormAmountPc
- .trnFormAmountPc__types
- .trnFormAmountPc__type._expenses(
- @click="() => setAmountType(0)"
- :class="{ _active: amountType === 0 }"
- ) {{ $t('money.expenses') }}
-
- .trnFormAmountPc__type._incomes(
- @click="() => setAmountType(1)"
- :class="{ _active: amountType === 1 }"
- ) {{ $t('money.incomes') }}
-
- .trnFormAmountPc__type(
- v-if="$store.getters['wallets/walletsSortedIds'].length > 1"
- @click="() => setAmountType(2)"
- :class="{ _active: amountType === 2 }"
- ) {{ $t('trnForm.transferTitle') }}
+ TrnFormTypes
.trnFormAmount(:class="className")
.trnFormAmount__value {{ expression }}
@@ -58,9 +35,7 @@ export default {
</template>
<style lang="stylus" scoped>
-@import '~assets/stylus/variables/fonts'
-@import '~assets/stylus/variables/margins'
-@import '~assets/stylus/variables/media'
+@import '~assets/stylus/variables'
.amountInputLaptop
&__evaluation
@@ -83,37 +58,6 @@ export default {
border-top 1px solid var(--c-bg-2)
border-bottom 1px solid var(--c-bg-2)
- &__types
- display flex
- justify-content space-between
- padding $m8 $m9
- padding-bottom $m5
-
- &__type
- margin (- $m6) (- $m7)
- padding $m6 $m7
- font-header-1()
- color var(--c-font-4)
-
- &:hover
- @media $media-laptop
- color var(--c-font-4)
- background var(--c-bg-5)
-
- &._active
- opacity 1
- color var(--c-font-2)
-
- &:hover
- @media $media-laptop
- background none
-
- &._incomes
- color var(--c-incomes-1)
-
- &._expenses
- color var(--c-expenses-1)
-
.trnFormAmount._incomes .trnFormAmountPc__input__value
color var(--c-incomes-1)
diff --git a/components/trnForm/TrnFormCalendar.vue b/components/trnForm/TrnFormCalendar.vue
index 31310a02..7e310faf 100644
--- a/components/trnForm/TrnFormCalendar.vue
+++ b/components/trnForm/TrnFormCalendar.vue
@@ -35,7 +35,7 @@ export default {
.trnFormMeta__date
.trnFormDate
.trnFormDate__item._icon(@click="setPrevDay()"): .mdi.mdi-chevron-left
- .trnFormDate__item(@click="$store.commit('trnForm/toogleTrnFormModal', 'calendar')") {{ formatedDate }}
+ .trnFormDate__item._date(@click="$store.commit('trnForm/toogleTrnFormModal', 'calendar')") {{ formatedDate }}
.trnFormDate__item._icon(:class="{ _disable: isToday }" @click="setNextDay()"): .mdi.mdi-chevron-right
.trnFormMeta__desc(
@@ -49,8 +49,9 @@ export default {
@import '~assets/stylus/variables'
.trnFormMeta
- display flex
- align-items stretch
+ display grid
+ grid-template-columns repeat(5, minmax(10px, 1fr))
+ padding 0 $m6
border-top 1px solid var(--c-bg-3)
@media $media-laptop
@@ -58,21 +59,18 @@ export default {
border-top 0
&__date
- flex-grow 1
+ grid-column 1/5
+ grid-row 1/-1
&__desc
position relative
- width calc(100%/5)
- padding $m7 $m9
+ padding $m6
color var(--c-font-4)
- font-size 20px
+ font-size 22px
text-align center
+ border-radius $m7
- &:hover
- @media $media-laptop
- background var(--c-bg-5)
-
- &:active
+ +media-hover()
background var(--c-bg-5)
&._active
@@ -88,10 +86,10 @@ export default {
border-radius 50%
.trnFormDate
- display flex
- align-items center
- flex-grow 1
+ display grid
height 100%
+ grid-template-columns repeat(4, minmax(10px, 1fr))
+ font-size 12px
font-weight 500
text-align center
@@ -101,12 +99,13 @@ export default {
justify-content center
flex-grow 1
height 100%
+ border-radius $m7
- &:hover
- @media $media-laptop
- background var(--c-bg-5)
+ &._date
+ grid-column 2/4
+ color var(--c-font-3)
- &:active
+ +media-hover()
background var(--c-bg-5)
&._icon
diff --git a/components/trnForm/TrnFormCategories.vue b/components/trnForm/TrnFormCategories.vue
index 14865be5..771fe164 100644
--- a/components/trnForm/TrnFormCategories.vue
+++ b/components/trnForm/TrnFormCategories.vue
@@ -18,26 +18,26 @@ export default {
}
},
- computed: {
- modalStyle () {
- return { height: `${this.$store.state.trnForm.height - 48}px` }
- }
- },
-
watch: {
show: {
handler (isShow) {
const initialSlide = this.$store.getters['categories/quickSelectorCategoriesIds'] && this.$store.getters['categories/quickSelectorCategoriesIds'].length > 0 ? 1 : 2
this.$nextTick(() => {
if (isShow && this.$refs.trnFormCategories) {
- this.slider = new Swiper(this.$refs.trnFormCategories, {
- slidesPerView: 1,
- autoHeight: true,
- initialSlide,
- shortSwipes: false,
- longSwipesRatio: 0.1,
- longSwipesMs: 60
- })
+ if (this.slider) {
+ this.slider.update()
+ }
+ else {
+ this.slider = new Swiper(this.$refs.trnFormCategories, {
+ observer: true,
+ slidesPerView: 1,
+ autoHeight: false,
+ initialSlide,
+ shortSwipes: false,
+ longSwipesRatio: 0.1,
+ longSwipesMs: 60
+ })
+ }
}
})
},
@@ -62,44 +62,40 @@ export default {
</script>
<template lang="pug">
-.trnFormCategories
- .bottomNav
- .switcher(v-if="slider")
- .switcher__item(
- :class="{ _active: slider.activeIndex === 0 }"
- @click="slider.slideTo(0)"
- ) {{ $t('categories.lastUsedTitle') }}
- .switcher__item(
- :class="{ _active: slider.activeIndex === 1 }"
- @click="slider.slideTo(1)"
- ) {{ $t('categories.favoriteTitle') }}
- .switcher__item(
- :class="{ _active: slider.activeIndex === 2 }"
- @click="slider.slideTo(2)"
- ) {{ $t('categories.allTitle') }}
-
- .swiper-container(ref="trnFormCategories")
- .swiper-wrapper
- .swiper-slide
- .scrollBlock.waitForScroll(
- v-if="$store.getters['categories/lastUsedCategoriesIdsByDate'] && $store.getters['categories/lastUsedCategoriesIdsByDate'].length > 0"
- :style="modalStyle"
- )
- .marginBottom
+.contentWrap
+ .switcherList(v-if="slider")
+ .menuItem(
+ :class="{ _active: slider.activeIndex === 0 }"
+ @click="slider.slideTo(0)"
+ ) {{ $t('categories.lastUsedTitle') }}
+ .menuItem(
+ :class="{ _active: slider.activeIndex === 1 }"
+ @click="slider.slideTo(1)"
+ ) {{ $t('categories.favoriteTitle') }}
+ .menuItem(
+ :class="{ _active: slider.activeIndex === 2 }"
+ @click="slider.slideTo(2)"
+ ) {{ $t('categories.allTitle') }}
+
+ .contentWrap__box
+ .swiper-container(ref="trnFormCategories")
+ .swiper-wrapper
+ .swiper-slide
+ .scrollBlock.waitForScrollSlider(
+ v-if="$store.getters['categories/lastUsedCategoriesIdsByDate'] && $store.getters['categories/lastUsedCategoriesIdsByDate'].length > 0"
+ )
CategoriesView(
:activeItemId="$store.state.trnForm.values.categoryId"
:ids="$store.getters['categories/lastUsedCategoriesIdsByDate']"
:noPaddingBottom="true"
@onClick="handleCategoryClick"
ui="_flat"
- )
+ )
- .swiper-slide
- .scrollBlock.waitForScroll(
- v-if="$store.getters['categories/quickSelectorCategoriesIds'] && $store.getters['categories/quickSelectorCategoriesIds'].length"
- :style="modalStyle"
- )
- .marginBottom
+ .swiper-slide
+ .scrollBlock.waitForScrollSlider(
+ v-if="$store.getters['categories/quickSelectorCategoriesIds'] && $store.getters['categories/quickSelectorCategoriesIds'].length"
+ )
CategoriesView(
:activeItemId="$store.state.trnForm.values.categoryId"
:ids="$store.getters['categories/quickSelectorCategoriesIds']"
@@ -108,9 +104,8 @@ export default {
ui="_flat"
)
- .swiper-slide
- .scrollBlock.waitForScroll(:style="modalStyle")
- .marginBottom
+ .swiper-slide
+ .scrollBlock.waitForScrollSlider
CategoriesView(
:ids="$store.getters['categories/categoriesRootIds']"
:noPaddingBottom="true"
@@ -121,53 +116,51 @@ export default {
<style lang="stylus" scoped>
@import '~assets/stylus/variables'
-$border = 1px
-
-.trnFormCategories
+.contentWrap
+ overflow hidden
position relative
+ display grid
+ grid-template-rows auto 1fr
+
+ &__box
+ overflow hidden
+ height 100%
+
+ .swiper-container
+ .swiper-container .swiper-slide
+ height 100%
.scrollBlock
overflow hidden
- overflow-y auto
- scrollbar()
-
-.marginBottom
- margin-top 50px
- margin-bottom 36px
-
-.bottomNav
- z-index 10
- position absolute
- top 0
- left 0
- width 100%
- padding 0
- background var(--color-bg-canvas)
-
-.switcher
+ overflowScrollY()
+ height 100%
+ padding-top $m6
+ padding-bottom $m8
+
+.switcherList
display flex
- align-items center
- padding 0 $m7
+ justify-content center
+ padding $m6
-.switcher__item
+.menuItem
cursor pointer
- flex-grow 1
- padding $m6 $m7
+ margin 0 $m5
+ padding $m6 $m8
color var(--c-font-5)
font-size 12px
font-weight 500
font-roboto()
text-align center
- border-bottom $border solid var(--c-bg-2)
+ border 1px solid transparent
+ border-radius 50px
&:active
- background var(--c-bg-5)
- border-radius $m6 $m6 0 0
- border-bottom $border solid var(--c-bg-2)
+ color var(--c-font-2)
+ background var(--c-blue-1)
&._active
cursor default
color var(--c-font-3)
- background none
- border-bottom $border solid var(--c-blue-1)
+ background var(--c-bg-5)
+ border 1px solid var(--c-bg-5)
</style>
diff --git a/components/trnForm/TrnFormHeader.vue b/components/trnForm/TrnFormHeader.vue
index 05c2ff02..1f57c6b9 100644
--- a/components/trnForm/TrnFormHeader.vue
+++ b/components/trnForm/TrnFormHeader.vue
@@ -41,6 +41,7 @@ export default {
grid-template-columns repeat(2, 1fr)
grid-column-gap $m7
grid-row-gap $m7
- padding $m7
+ padding 0 $m7
padding-top 0
+ padding-bottom $m9
</style>
diff --git a/components/trnForm/TrnFormHeaderTransfer.vue b/components/trnForm/TrnFormHeaderTransfer.vue
index 687c3088..f2732900 100644
--- a/components/trnForm/TrnFormHeaderTransfer.vue
+++ b/components/trnForm/TrnFormHeaderTransfer.vue
@@ -81,7 +81,7 @@ export default {
.trnFormHeaderItem
&__desc
margin-bottom 2px
- color var(--c-font-2)
+ color var(--c-font-4)
font-size 12px
.walletItemGrid
diff --git a/components/trnForm/TrnFormTrns.vue b/components/trnForm/TrnFormTrns.vue
index fe5ae53a..2b1ac01c 100644
--- a/components/trnForm/TrnFormTrns.vue
+++ b/components/trnForm/TrnFormTrns.vue
@@ -122,10 +122,13 @@ export default {
},
changeFilter (filterBy) {
+ const trnForm = document.querySelector('.trnForm')
+ const trnsListScroll = trnForm.querySelector('.trnsListScroll')
+ trnsListScroll.scrollTop = 0
+
this.filterBy = filterBy
this.pageNumber = 1
setTimeout(() => {
- this.slider.update()
this.slider.slideTo(2, 0)
}, 100)
},
@@ -140,38 +143,37 @@ export default {
</script>
<template lang="pug">
-.trnsList
+.contentWrap
.switcherList
- .switcher
- .switcher__content
- .switcher__item._text(@click="changeFilter('wallet')" :class="{ _active: filterBy === 'wallet' }") {{ $t('trnForm.filterWallet') }}
- .switcher__item._text(@click="changeFilter('walletAndCategory')" :class="{ _active: filterBy === 'walletAndCategory' }") {{ $t('trnForm.filterWalletAndCategory') }}
- .switcher__item._text(@click="changeFilter('all')" :class="{ _active: filterBy === 'all' }") {{ $t('trnForm.filterAll') }}
-
- .container(v-if="trnsIds.length === 0") No transactions
-
- .trnsList__content
- .trnsList__grid(:class={ _onlyList: onlyList })
- .trnsList__day(v-for="(trnsIds, date) in groupedTrns")
- .trnsList__header: TrnsListDate(:date="date")
- .trnsList__trns
- TrnsItemTrnItem(
- 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]"
- :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")
- SharedButton(
- :class="['_text-center _border _inline']"
- :title="$t('trns.more')"
- @onClick="showMoreTrns"
- )
+ .menuItem(@click="changeFilter('wallet')" :class="{ _active: filterBy === 'wallet' }") {{ $t('trnForm.filterWallet') }}
+ .menuItem(@click="changeFilter('walletAndCategory')" :class="{ _active: filterBy === 'walletAndCategory' }") {{ $t('trnForm.filterWalletAndCategory') }}
+ .menuItem(@click="changeFilter('all')" :class="{ _active: filterBy === 'all' }") {{ $t('trnForm.filterAll') }}
+
+ .contentWrap__box.waitForScroll.trnsListScroll
+ .container(v-if="trnsIds.length === 0") No transactions
+
+ .scrollBlock
+ .trnsList__content
+ .trnsList__day(v-for="(trnsIds, date) in groupedTrns")
+ .trnsList__header: TrnsListDate(:date="date")
+ .trnsList__trns
+ TrnsItemTrnItem._trnForm(
+ 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]"
+ :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")
+ SharedButton(
+ :class="['_text-center _border _inline']"
+ :title="$t('trns.more')"
+ @onClick="showMoreTrns"
+ )
</template>
<style lang="stylus" scoped>
@@ -190,70 +192,7 @@ export default {
text-align center
fontFamilyNunito()
-.switcherList
- display flex
- align-items center
- justify-content center
- margin $m7
- margin-bottom (- $m5)
- border-radius 12px
-
- +media-laptop()
- margin-bottom $m7
-
-.switcher
- position relative
- position sticky
- top 0
-
- &__content
- display flex
- align-items stretch
- justify-content stretch
-
- &__item
- display flex
- align-items center
- justify-content center
- text-align center
- border-radius 12px
-
- +media-hover()
- background var(--c-bg-3)
-
- &._text
- opacity .6
- min-width 48px
- padding $m5 $m7
- font-size 12px
- border-radius 12px
-
- &._active
- opacity 1
- background var(--c-bg-1)
-
- &._icon
- opacity .6
- padding $m6 $m6
- font-size 22px
- border-radius 8px
-
- &._active
- opacity 1
-
.trnsList
- padding-bottom 8px
-
- +media-laptop()
- padding 0
-
- &__grid
- display grid
- grid-template-rows 1fr
- grid-template-columns 1fr
- grid-column-gap 8px
- grid-row-gap 8px
-
&__day
overflow hidden
border-bottom 1px solid var(--c-bg-3)
@@ -261,7 +200,6 @@ export default {
padding-bottom 16px
&:first-child
- margin-top $m9
border-top 0
+media-laptop()
@@ -280,4 +218,50 @@ export default {
&__pages
padding 16px 8px
padding-top 0
+
+.contentWrap
+ position relative
+ display grid
+ grid-template-rows auto 1fr
+ height 100%
+
+ &__box
+ overflow hidden
+ overflow-y auto
+ scrollbar()
+
+.scrollBlock
+ padding-top $m6
+ padding-bottom $m8
+
+.switcherList
+ display flex
+ justify-content center
+ width 100%
+ padding $m6
+ padding-top $m8
+ background alpha(#171717, .9)
+ backdrop-filter blur(12px)
+
+.menuItem
+ cursor pointer
+ margin 0 $m5
+ padding $m6 $m8
+ color var(--c-font-5)
+ font-size 12px
+ font-weight 500
+ font-roboto()
+ text-align center
+ border 1px solid transparent
+ border-radius 50px
+
+ &:active
+ color var(--c-font-2)
+ background var(--c-blue-1)
+
+ &._active
+ cursor default
+ color var(--c-font-3)
+ background var(--c-bg-5)
+ border 1px solid var(--c-bg-5)
</style>
diff --git a/components/trnForm/TrnFormTypes.vue b/components/trnForm/TrnFormTypes.vue
new file mode 100644
index 00000000..b7667b02
--- /dev/null
+++ b/components/trnForm/TrnFormTypes.vue
@@ -0,0 +1,74 @@
+<script>
+import { computed, useContext } from '@nuxtjs/composition-api'
+
+export default {
+ name: 'TrnFormTypes',
+
+ setup () {
+ const { store } = useContext()
+
+ const amountType = computed(() => store.state.trnForm.values.amountType)
+
+ function setAmountType (amountType) {
+ store.commit('trnForm/setTrnFormValues', {
+ amountType
+ })
+ }
+
+ return {
+ amountType,
+ setAmountType
+ }
+ }
+}
+</script>
+
+<template lang="pug">
+.trnFormTypes
+ .menuItem._expenses(
+ @click="() => setAmountType(0)"
+ :class="{ _active: amountType === 0 }"
+ ) {{ $t('money.expenses') }}
+
+ .menuItem._incomes(
+ @click="() => setAmountType(1)"
+ :class="{ _active: amountType === 1 }"
+ ) {{ $t('money.incomes') }}
+
+ .menuItem(
+ v-if="$store.getters['wallets/walletsSortedIds'].length > 1"
+ @click="() => setAmountType(2)"
+ :class="{ _active: amountType === 2 }"
+ ) {{ $t('trnForm.transferTitle') }}
+</template>
+
+<style lang="stylus" scoped>
+@import '~assets/stylus/variables'
+
+.trnFormTypes
+ display flex
+ justify-content center
+ padding $m6
+
+.menuItem
+ cursor pointer
+ margin 0 $m5
+ padding $m6 $m8
+ color var(--c-font-5)
+ font-size 12px
+ font-weight 500
+ font-roboto()
+ text-align center
+ border 1px solid transparent
+ border-radius 50px
+
+ &:active
+ color var(--c-font-2)
+ background var(--c-blue-1)
+
+ &._active
+ cursor default
+ color var(--c-font-3)
+ background var(--c-bg-5)
+ border 1px solid var(--c-bg-5)
+</style>
diff --git a/components/trnForm/calculator/TrnFormCalculator.vue b/components/trnForm/calculator/TrnFormCalculator.vue
index e0006941..e9c09644 100644
--- a/components/trnForm/calculator/TrnFormCalculator.vue
+++ b/components/trnForm/calculator/TrnFormCalculator.vue
@@ -51,12 +51,12 @@ export default {
<template lang="pug">
div
.trnFormSharedButton(v-if="pc")
- .calcItem._sum(
+ .calcItem._sum._pc(
@click="isSum ? $emit('onSubmit') : handleTouch('=')"
)
SharedButton(
:title="isSum ? $t('trnForm.saveTrnButton') : $t('trnForm.calcTrnButton')"
- className="_blue _text-center"
+ className="_blue2 _text-center _ttu"
)
.trnFormCalculator(v-if="!pc")
@@ -111,10 +111,7 @@ div
</template>
<style lang="stylus" scoped>
-@import '~assets/stylus/variables/animations'
-@import '~assets/stylus/variables/margins'
-@import '~assets/stylus/variables/fonts'
-@import '~assets/stylus/variables/media'
+@import '~assets/stylus/variables'
.trnFormButton
padding $m7
@@ -141,15 +138,19 @@ div
padding-left 4px
color var(--c-font-1)
+ ~/._pc
+ padding 0 $m7
+
&__in
display flex
align-items center
justify-content center
width 40px
height 40px
- font-size 22px
+ font-size 26px
border-bottom 0
border-right 0
+ background var(--c-bg-4)
border-radius 50%
@media $media-phone-normal
@@ -157,6 +158,7 @@ div
~/._num &
color var(--c-font-3)
+ font-size 22px
background var(--c-bg-5)
~/._act &
diff --git a/components/trnForm/modal/TrnFormModal.vue b/components/trnForm/modal/TrnFormModal.vue
index ec93b2dc..b415e121 100644
--- a/components/trnForm/modal/TrnFormModal.vue
+++ b/components/trnForm/modal/TrnFormModal.vue
@@ -73,28 +73,21 @@ export default {
if (this.$store.state.trnForm.height < this.$store.state.ui.height) {
if (this.position === 'bottom') {
return {
- maxHeight: `${this.$store.state.trnForm.height - this.headerHeight}px`
+ maxHeight: `${this.$store.state.trnForm.height}px`
}
}
return {
- height: `${this.$store.state.trnForm.height - this.headerHeight}px`
+ height: `${this.$store.state.trnForm.height}px`
}
}
else {
return {
- height: `${this.$store.state.ui.height - this.headerHeight}px`
+ height: `${this.$store.state.ui.height}px`
}
}
}
},
- watch: {
- show: {
- handler: 'updateHeight',
- immediate: true
- }
- },
-
methods: {
afterClose () {
if (this.$listeners.afterClose) {
@@ -102,12 +95,6 @@ export default {
}
},
- updateHeight () {
- this.$nextTick(() => {
- this.headerHeight = this.$refs.header.clientHeight
- })
- },
-
onClose () {
if (this.$listeners.onClose) {
this.$listeners.onClose()
@@ -132,28 +119,35 @@ export default {
transition(name="baseModalWrapAnim" appear)
.trnFormModal__wrap(
v-show="isShow"
+ :style="modalStyle"
ref="wrap"
)
- .trnFormModal__header(
- ref="header"
+ .trnForm__handler(
+ ref="handler"
@click="closeModal"
)
- .trnFormModal__header__title(v-if="title") {{ title }}
- .trnFormModal__header__close: .mdi.mdi-close
+ .trnForm__closure(@click="closeModal")
+ svg(
+ viewBox='0 0 24 24'
+ fill='none'
+ stroke='#000'
+ stroke-linecap='round'
+ stroke-linejoin='round'
+ stroke-width='1.5'
+ )
+ path(d='M.75 23.249l22.5-22.5')
+ path(d='M23.25 23.249L.75.749')
.trnFormModal__scroll(
- :style="modalStyle"
:class="{ _noPadding: noPadding }"
ref="content"
)
+ .trnForm__title(v-if="title") {{ title }}
slot
</template>
<style lang="stylus" scoped>
-@import '~assets/stylus/variables/animations'
-@import '~assets/stylus/variables/fonts'
-@import '~assets/stylus/variables/media'
-@import '~assets/stylus/variables/margins'
+@import '~assets/stylus/variables'
.baseModalOveflowAnim
&-enter-active
@@ -230,12 +224,15 @@ export default {
overflow hidden
overflow-y auto
max-height 100%
- padding $m7 0
+ padding-bottom $m7
scrollbar()
&._noPadding
overflow hidden
- margin-bottom (- $m7)
+ display grid
+ grid-template-rows auto 1fr
+ display grid
+ flex-grow 1
padding-bottom 0
&__header
@@ -261,6 +258,7 @@ export default {
&__title
flex-grow 1
+ text-align center
&__close
color var(--c-font-4)
diff --git a/components/trnForm/modal/TrnFormModalCalendar.vue b/components/trnForm/modal/TrnFormModalCalendar.vue
index 2f6466a5..a9e9f6cc 100644
--- a/components/trnForm/modal/TrnFormModalCalendar.vue
+++ b/components/trnForm/modal/TrnFormModalCalendar.vue
@@ -48,7 +48,6 @@ export default {
LazyTrnFormModal.doNotCloseTrnModal(
v-if="isShow"
:isShow="isShow"
- :position="$store.state.ui.mobile ? 'bottom' : null"
title="Date"
@onClose="$store.commit('trnForm/toogleTrnFormModal', 'calendar')"
)
diff --git a/components/trnForm/modal/TrnFormModalCats.vue b/components/trnForm/modal/TrnFormModalCats.vue
index 4eff6df8..01ccaf1b 100644
--- a/components/trnForm/modal/TrnFormModalCats.vue
+++ b/components/trnForm/modal/TrnFormModalCats.vue
@@ -18,7 +18,6 @@ export default {
<template lang="pug">
TrnFormModal.doNotCloseTrnModal(
:isShow="isShow"
- :position="$store.state.ui.mobile ? 'bottom' : null"
:title="$t('categories.name')"
@onClose="$store.commit('trnForm/toogleTrnFormModal', 'categories')"
noPadding
diff --git a/components/trnForm/modal/TrnFormModalTransferFrom.vue b/components/trnForm/modal/TrnFormModalTransferFrom.vue
index ac37b042..80ec0f9a 100644
--- a/components/trnForm/modal/TrnFormModalTransferFrom.vue
+++ b/components/trnForm/modal/TrnFormModalTransferFrom.vue
@@ -29,6 +29,7 @@ LazyTrnFormModal.doNotCloseTrnModal(
v-if="isShow"
:isShow="isShow"
title="Transfer from wallet"
+ position="bottom"
@onClose="$store.commit('trnForm/toogleTrnFormModal', 'transferFrom')"
)
WalletsList3(@onClick="setWalletFromId")
diff --git a/components/trnForm/modal/TrnFormModalTransferTo.vue b/components/trnForm/modal/TrnFormModalTransferTo.vue
index 54628bb1..fab45ca1 100644
--- a/components/trnForm/modal/TrnFormModalTransferTo.vue
+++ b/components/trnForm/modal/TrnFormModalTransferTo.vue
@@ -29,6 +29,7 @@ LazyTrnFormModal.doNotCloseTrnModal(
v-if="isShow"
:isShow="isShow"
title="Transfer to wallet"
+ position="bottom"
@onClose="$store.commit('trnForm/toogleTrnFormModal', 'transferTo')"
)
WalletsList3(@onClick="setWalletToId")
diff --git a/components/trns/item/TrnItem.vue b/components/trns/item/TrnItem.vue
index 88256491..4b17fa46 100644
--- a/components/trns/item/TrnItem.vue
+++ b/components/trns/item/TrnItem.vue
@@ -266,8 +266,7 @@ export default {
</template>
<style lang="stylus" scoped>
-@import '~assets/stylus/variables/margins'
-@import '~assets/stylus/variables/media'
+@import '~assets/stylus/variables'
.transfer
padding-top $m5
@@ -305,9 +304,6 @@ export default {
&._stat
background var(--c-bg-5)
- &._active
- background var(--c-bg-1)
-
&__amount
align-self center
@@ -441,4 +437,17 @@ export default {
&__amount
^[0]._history &
//
+
+ &._active
+ &._history
+ &._trnForm
+ margin-right - ($m7)
+ margin-left - ($m7)
+ padding-right ($m7)
+ padding-left ($m7)
+
+ &._active
+ background var(--c-bg-1)
+ border-top 1px solid var(--c-blue-1)
+ border-bottom 1px solid var(--c-blue-1)
</style>
diff --git a/components/wallets/form/WalletForm.vue b/components/wallets/form/WalletForm.vue
index db29adf5..c9609219 100644
--- a/components/wallets/form/WalletForm.vue
+++ b/components/wallets/form/WalletForm.vue
@@ -160,7 +160,8 @@ LayoutComponentWrap
SharedInputsCheckbox(
v-model="wallet.countTotal"
:title="$t('wallets.form.total.placeholder')"
- :alt="true")
+ :alt="true"
+ )
//- colors
Portal(
diff --git a/layouts/default.vue b/layouts/default.vue
index d873694b..df180a14 100644
--- a/layouts/default.vue
+++ b/layouts/default.vue
@@ -1,12 +1,20 @@
<script>
-import { ref, computed, useContext, onMounted } from '@nuxtjs/composition-api'
+import { ref, computed, useContext, useFetch, onMounted } from '@nuxtjs/composition-api'
import debounce from '~/utils/debounce'
import detectTouch from '~/assets/js/isTouchDevice'
+import useUIView from '~/components/layout/useUIView'
export default {
name: 'DefaultLayout',
setup () {
+ const { store } = useContext()
+
+ useFetch(async () => {
+ const { initUI } = useUIView()
+ await initUI()
+ })
+
/**
* Update modal
*/
@@ -34,8 +42,6 @@ export default {
/**
* Page dimensions
*/
- const { store } = useContext()
-
function getPageDimensions () {
const width = document.documentElement.clientWidth
const height = document.documentElement.clientHeight
@@ -64,7 +70,7 @@ export default {
//- Continue to app
transition(name="fadeInSlow" appear)
- template(v-if="$store.state.app.status.ready")
+ template(v-show="$store.state.app.status.ready && !$fetchState.pending")
Nuxt
//- Notifications
diff --git a/locales/en-US.js b/locales/en-US.js
index e6dc7c64..4e753a61 100644
--- a/locales/en-US.js
+++ b/locales/en-US.js
@@ -23,7 +23,7 @@ export default {
createTrnButton: 'Create transaction',
createTransferButton: 'Create transfer',
titleEditTrn: 'Edit transaction',
- titleCreateTrn: 'Create new transaction',
+ titleCreateTrn: 'Add transaction',
filterWalletAndCategory: 'Wallet & Category',
filterWallet: 'Wallet only',
filterAll: 'Everything',
diff --git a/pages/index.vue b/pages/index.vue
index ffd4b3b3..65364d4f 100644
--- a/pages/index.vue
+++ b/pages/index.vue
@@ -1,6 +1,4 @@
<script>
-import useUIView from '~/components/layout/useUIView'
-
export default {
name: 'IndexPage',
@@ -9,8 +7,6 @@ export default {
!this.$store.getters['categories/hasCategories']) {
this.$router.replace('/welcome')
}
- const { initUI } = useUIView()
- initUI()
}
}
</script>
diff --git a/static/icons/close.svg b/static/icons/close.svg
new file mode 100644
index 00000000..0730bf80
--- /dev/null
+++ b/static/icons/close.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" xmlns:v="https://vecta.io/nano"><path d="M.75 23.249l22.5-22.5"/><path d="M23.25 23.249L.75.749"/></svg>
\ No newline at end of file
diff --git a/store/categories/getters.js b/store/categories/getters.js
index bbe196fa..cfecbbea 100644
--- a/store/categories/getters.js
+++ b/store/categories/getters.js
@@ -87,7 +87,7 @@ export default {
if (state.items && rootGetters['trns/hasTrns']) {
for (const trnId of sortedTrnsIds.slice(0, 500)) {
- if (lastCategoriesIds.length < 18) {
+ if (lastCategoriesIds.length < 21) {
const categoryId = trns[trnId].categoryId
const category = state.items[categoryId]
if (category && (category.showInLastUsed || category.showInLastUsed === undefined)) {
diff --git a/store/trnForm/index.js b/store/trnForm/index.js
index 68e56ae4..774b27cd 100644
--- a/store/trnForm/index.js
+++ b/store/trnForm/index.js
@@ -14,7 +14,7 @@ export const baseModalState = {
export const state = () => ({
action: 'create',
- height: 0,
+ height: '100%',
modal: baseModalState,
transfer: {